You can develop a user exit that lets you send an XML message
to a specific JMS message destination based on the content of the
message.
About this task
For example, you may want to create a simple XML message
whenever a new employee is created. You can detect new employees by
monitoring inserts into the dbo.Employee table and
create an source table to XML mapping using all columns from this
table. You can then send the XML message to a JMS queue called HR1
and
also send this XML message to another queue called IT1
each
time a new employee is added to the IT department.
Procedure
- Click
.
Ensure that you are connected to a CDC Replication Engine for Event Server datastore.
- Click
.
Ensure that you have created a subscription that uses the CDC Replication Engine for Event Server datastore as the target.
- Ensure that you have created at least one source table to XML message
destination mapping within this subscription.
- Select the table mapping and right-click Open
Details....
- Click the User Exits tab.
- Choose Java Class from the User
Exit Type box.
- In the Class Name box, enter the Java™ class name of the user exit that implements the UserExitIF interface if
you have developed the user exit in Java.
- Enter the parameters that you want to make available to the user exit
program in the Parameter box.
You can access the parameters in the Java class by invoking
the getParameter() method during the initialization process. There are no conventions for specifying
the parameters. The values you type in this box are free-form. The string of parameter values cannot
exceed 255 characters in length.
- Enable the Before or
After check box for one or more of the following operations:
- Insert
- The CDC Replication Engine for Event Server runs the user exit before
or after applying an insert operation to a table you have staged, before or after applying an insert
operation to a JMS message destination, or both.
- Update
- The CDC Replication Engine for Event Server runs the user exit before
or after applying an update operation to a table you have staged, before or after applying an update
operation to a JMS message destination, or both.
- Delete
- The CDC Replication Engine for Event Server runs the user exit before
or after applying a delete operation to a table you have staged, before or after applying a delete
operation to a JMS message destination, or both.
- Refresh
- The CDC Replication Engine for Event Server runs the user exit before
or after applying a refresh operation to a table you have staged, before or after applying a refresh
operation to a JMS message destination, or both.
- Truncate
- The CDC Replication Engine for Event Server runs the user exit before
or after applying a truncate operation to a table you have staged, before or after applying a
truncate operation to a JMS message destination, or both.
- Click Save.
You can start mirroring on the subscription that contains the source table assigned to a JMS
message destination. The user exit program will set the new destination before the CDC Replication Engine for Event Server applies the operation to a JMS message
destination.