The configurations of the IBM WebSphere MQ output JMS event adapter are explained below. It can be configured with
Follow the steps below to set up the prerequisites before starting the configuration.
- Start WSO2 BAM.
- Download and install WebSphere MQ pack with the latest fixes. For more information on installing, see the IBM documentation).
Configuring WebSphere MQ
Follow the instructions below to configure WebSphere MQ.
Configuring JMSAdmin.conf File
Go to the
<WebSphere_MQ_HOME>\java\bindirectory and open the
JMSAdmin.configfile in a text editor.
Comment out the existing INITIAL_CONTEXT_FACTORY and add a INITIAL_CONTEXT_FACTORY named com.sun.jndi.fscontext.RefFSContextFactory.
Comment out the default PROVIDER_URL and use a directory path instead. Ensure the directory is created in the file system (e.g., C:/JNDI-Directory).If there are .bindings files of earlier versions already existing in this folder, delete them. It should typically be an empty folder.
JMSAdmin.configfile should now look similar to this:
- Restart the WebSphere MQ service.
Creating the Queue in WebSphere MQ
- Start IBM WebSphere MQ Explorer and create a new queue manager. Make sure you select make this the default queue manager check box. Leave default values on the other fields.
- Select the options to Start Queue Manager, Autostart Queue Manager, and Create server connection channel, and then click Next.
- Select the option to create a listener configuration for TCP/IP, and provide a port number ( e.g., 1415 ).
- Select the created Queue manager and expand its navigation tree. Click Queues in the tree and create a new local queue (e.g., localq).
- Keep the default configurations and click Finish.
- Click Topics in the tree view and create a new local topic (e.g., localt).
- Right-click Channels under Advanced and select New > Server-connection Channel. Provide a name for the channel (e.g., myChannel), and click Next.
- Set the transmission protocol as TCP and click Finish.
A listener is created and is running on the given port (e.g., 1415). You should be able to view it by clicking the listeners icon.
Generating the .bindings file
Go to the
/java/bindirectory and invoke the IVT app by running the following command:
Create the default set of JNDI bindings by running the following command on the command prompt:
Execute the IVTRun tool as follows.
- You have now enabled and verified JNDI support. Now go to C:/JNDI-Directory to view the .bindings file there.
- Start the JMSAdmin tool by running the jmsadmin.bat file.
Modify the JNDI bindings by executing the following commands:
- In IBM WebSphere MQ Explorer, select JMS Administered Objects from the tree view on the left, and then select Add initial context. Once done, select File system and enter the JNDI directory path. This will bring up all created queues and topics.
You have now set up and configured IBM WebSphere MQ in your environment.
Configuring WSO2 BAM
Follow the instructions below to configure WSO2 BAM.
- If you set up WSO2 BAM on a different machine from WebSphere MQ, copy
C:/JNDI-Directoryto 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/libdirectory to the
- 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.jarin version 6.0.
Optionally, you might have to add the following jars as well.
- If you are using WebSphere MQ version 7.1 or later, add the following jars to the
Add the following files to the
Log in to the JMSAdmin tool and create a queue named bogusq by running the following commands in JMSAdmin shell.
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 BAM (XKMS, echo, wso2carbon-sts etc.) will start listening on the same queue.
Repeat these steps for the topic scenarios. For example:
localt is the topic we created earlier.
<BAM_HOME>\repository\conf\axis2\axis2.xmlfile as follows:
You will comment and uncomment the non-default connection factories depending on which scenario you are running, as described in the next section.For details on the JMS configuration parameters used in the code segments, see JMS Connection Factory Parameters.
Configuring the IBM WebSphere MQ output JMS event adapter
Configure using the management console
Follow the instructions below to configure IBM WebSphere MQ output JMS event adapter using the management console. This deploys the event adapter in the
Start ActiveMQ, and then start the product.
- Log in to the product's management console and click Configure.
- Click Output Event Adaptors in the Event Processor Configs menu, and then click Add Output Event Adaptor.
- Enter details as shown in the below example.
- Click Add Event Adaptor.
Configure using a configuration file
Follow the instructions below to configure ActiveMQ output JMS event adapter using a configuration file.
Create an XML file with the following ActiveMQ output JMS event adapter configurations. Output event adapter implementation must start with
<outputEventAdaptor>as the root element.
Add the XML file to
<PRODUCT_HOME>/repository/deployment/server/outputeventadaptors/directory. Since hot deployment is enabled, you can simply add/remove files to deploy/undeploy to/from the server.
After an adapter is successfully added, it gets added to the list of adapters displayed under Event Processor Configs in the Configure menu of the product's management console. Click Edit to change its configuration and redeploy it. This opens an XML-based editor allowing you to edit the event adapter configurations from the UI. Do your modifications and click Update. You can also delete it, enable/disable statistics or enable/disable tracing on it using the provided options in the UI.