IBM WebSphere JMS event publisher is used to publish events in m ap, XML, JSON, and text formats via JMS transport.
...
- If you set up WSO2 CEP/DAS on a different machine from WebSphere MQ, copy
C:/JNDI-Directory
to that machine. The bindings file allows you to access WebSphere queues from any machine in the network. - Copy the following JAR files from the
<WebSphere_MQ_HOME>/java/lib
directory to the<PRODUCT_HOME>/repository/components/lib/
directory .com.ibm.mqjms.jar
fscontext.jar
providerutil.jar
com.ibm.mq.jmqi.jar
dhbcore.jar
- If you are using WebSphere MQ version 6.0 instead of version 7.0, add the following two JAR files. You might not find
com.ibm.mq.jmqi.jar
in version 6.0.-
com.ibm.mq.jar
connector.jar
Optionally, you might have to add the following jars as well.
jms.jar
jndi.jar
jta.jar
ldap.jar
-
- If you are using WebSphere MQ version 7.1 or later, add the following jars to the
<
PRODUCT
_HOME>/repository/components/dropins/
directory.com.ibm.mq_2.0.0.jar
fscontext_1.0.0.jar
Add the following files to the
<
PRODUCT_HOME>/repository/components/lib/
directory.jms.jar
jta.jar
Log in to the JMSAdmin tool and create a queue named bogusq by running the following commands in JMSAdmin shell.
Code Block DEFINE Q(bogusq) QMGR(mymgr) ALTER Q(bogusq) QUEUE(localq)
Note localq is the queue we created earlier. We use two queues for the queue scenario, and the queue named bogusq is defined as the default destination since we need the default queue ( ivtQ ) for our proxy service only. If we use ivtQ here, all the services deployed in CEP (XKMS, echo, wso2carbon-sts etc.) will start listening on the same queue.
Repeat these steps for the topic scenarios. For example:
Code Block DEFINE T(bogust) ALTER T(bogust) TOPIC(localt)
Note localt is the topic we created earlier.
Configure the
<PRODUCT_HOME>\repository\conf\axis2\axis2.xml
file as follows:Code Block language html/xml <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener"> <parameter name="myTopicConnectionFactory" locked="false"> <parameter name="java.naming.factory.initial" locked="false">com.sun.jndi.fscontext.RefFSContextFactory</parameter> <parameter name="java.naming.provider.url" locked="false">file:/C:/JNDI-Directory</parameter> <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">ivtQCF</parameter> <parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter> </parameter> <!--parameter name="SQProxyCF" locked="false"> <parameter name="java.naming.factory.initial">com.sun.jndi.fscontext.RefFSContextFactory</parameter> <parameter name="java.naming.provider.url">file:/C:/JNDI-Directory</parameter> <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">ivtQCF</parameter> <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter> </parameter--> <parameter name="default" locked="false"> <parameter name="java.naming.factory.initial" locked="false">com.sun.jndi.fscontext.RefFSContextFactory</parameter> <parameter name="java.naming.provider.url" locked="false">file:/C:/JNDI-Directory</parameter> <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">ivtQCF</parameter> <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter> </parameter> </transportReceiver>
You will comment and uncomment the non-default connection factories depending on which scenario you are running, as described in the next section.
Info For details on the JMS configuration parameters used in the code segments, see JMS Connection Factory Parameters.
...
Specify the Static and Dynamic Adapter Properties, when creating an IBM WebSphere JMS event publisher using the management console as shown below.
Info |
---|
After entering the above adapter properties, select the select the Message Format which that you want to apply on the published events . Also, click Advanced to to define custom output mappings based on the Message Format you you selected. For more information on custom output mapping types, see Publishing Events in Various Event Formats Output Mapping Types. |
You can also d efine the respective adapter properties of the event publisher based on the transport type within the <to>
element of the event publisher configuration in the <PRODUCT_HOME>/repository/deployment/server/eventpublishers/
directory as follows.
...
Adapter Property | Description | Configuration file property | Example |
---|---|---|---|
JNDI Initial Context Factory Class | The JNDI initial context factory class. The class must implement the java.naming.spi.InitialContextFactory interface | java.naming.factory.initial | com.sun.jndi.fscontext.RefFSContextFactory |
JNDI Provider URL | URL of the JNDI provider | java.naming.provider.url | file:/C:/JNDI-Directory |
Username | Valid username for the JMS connection | transport.jms.UserName | jms-user |
Password | Valid password for the JMS connection | transport.jms.Password | jms-password |
Connection Factory JNDI Name | The JNDI name of the connection factory | transport.jms.ConnectionFactoryJNDIName | ivtQCF |
Destination Type | The sort order for messages that arrive on a specific destination | transport.jms.DestinationType | topic/queue |
Destination | The topic or queue to which WSO2 CEP/DAS sends messages by publishing | transport.jms.Destination | test_topic |
...
Adapter Property | Description | Configuration file property | Example |
---|---|---|---|
Header | Define transport headers as a valid header name in a header value pair format | transport.jms.Header | header_name1:header_value1,header_name2:header_value2 |