To use a message listener port to put the event XML into
a WebSphere MQ queue, you create resources, including a message listener
port, and update the IBM_WBM_EMITTER SERVICE application to use the
message listener port.
About this task
Note: The preferred method for sending
an event XML from WebSphere MQ is to use a JMS activation specification,
not a message listener port. Refer to "Using a JMS activation specification
to put the event XML into a WebSphere MQ queue."
When you follow
the steps, the following resources are created.
Type of resource |
Example resource name or value |
WebSphere MQ |
Queue manager |
MQQmgr |
TCP listener |
1414 (port number) |
Server-connection channel |
ServerConnChannel |
Local queue |
AppEventQ |
WebSphere® Application
Server |
JMS queue connection factory (WebSphere MQ messaging
provider) |
MQQCF (JNDI: jms/eventemitter/qcf) |
JMS queue (WebSphere MQ messaging provider) |
MQQueue (JNDI: jms/eventemitter/queue) |
Message listener port |
EventEmitterQueueListener |
Procedure
- Check for the queue manager listener port and
create a server-connection channel and a local queue:
- In the WebSphere MQ Explorer, click the
queue manager. Open the Advanced folder and
click the Listeners folder to check for the
TCP listener. Note the port number. By default, a TCP listener is
created when a queue manager is created. If no TCP listener exists,
you can create one and specify a port number for it by right-clicking
the Listeners folder, clicking New,
and selecting TCP Listener.
- In the WebSphere MQ Explorer, click the
queue manager. Open the Advanced folder. Right-click
the Channels folder, click New,
and select Server-Connection Channel. Enter
a name for the channel and click Finish. Note
the channel name.
- In the WebSphere MQ Explorer, click the
queue manager. Right-click the Queues folder,
click New, and select Local Queue.
Enter a name for the queue (such as AppEventQ)
and click Finish. Note the queue name. This queue is where applications put their event XML.
- Create a JMS queue connection factory using the WebSphere
MQ messaging provider:
- In the WebSphere Application
Server administrative
console, select . Select
a Scope and click New. Select WebSphere
MQ messaging provider as the JMS resource provider and
click OK.
- In step 1 of the wizard, enter the name
and the JNDI name. For example, the name could be MQQCF and
the JNDI name could be jms/eventemitter/qcf.
- In step 2 of the wizard, select the default
connection method Enter all the required information into
this wizard. In step 2.1, enter the queue manager name,
for example MQQmgr. In step 2.2, enter the
connection information. Select Client as the
transport type and enter the host name of the machine that hosts the
queue manager, the port number of the TCP listener that you noted
in step 1a, and the name of the server-connection channel that you
created in step 1b.
- In step 3 of the wizard, click Test
Connection to verify that all the information is correct
and you have a successful test connection.
- To complete the setting and save the configuration,
click Next and Finish.
- Create a JMS queue using the WebSphere MQ messaging
provider:
- In the administrative console, select . Select a scope and click New.
Select WebSphere MQ messaging provider as the
JMS resource provider and click OK.
- In the Configuration panel, enter the name
and the JNDI name for the queue. For example, the name could be MQQueue and
the JNDI name could be jms/eventemitter/queue.
In the Queue name field, enter the WebSphere
MQ queue name that you created in step 1c.
- Create a message listener port using the JMS queue connection
factory and JMS queue that you created:
- In the administrative console, select and
click the target server (for stand-alone server, the default name
is server1) in the list.
- In the Configuration tab,
under Communications, select .
- Click Listener Ports,
and then click New. Enter a name for the message
listener, such as EventEmitterQueueListener.
Enter the JNDI name of the JMS queue connection factory that you entered
in step 2b, for example jms/eventemitter/qcf,
and the JNDI name for the queue destination that you entered in step
3b, for example jms/eventemitter/queue.
- Click Apply and Save.
- Update the resources of the IBM_WBM_EMITTER SERVICE application
to use the message listener port that you created:
- In the administrative console, select and
click IBM_WBM_EMITTER_SERVICE.
- In the Configuration tab,
under Enterprise JavaBeans Properties, click Message Driven
Bean listener bindings.
- In the Listener Bindings column, select Listener
Port and enter the name of the message listener port that
you created in step 4c, such as EventEmitterQueueListener.
- Click OK and save
the change.
- Restart the IBM® Business Monitor server.
Results
You have finished the configuration. If applications
put event XML onto the local WebSphere MQ queue, the JMS event emitter
service wraps the XML in a Common Base Events envelope and sends it
to the common event infrastructure (CEI) server for the
IBM Business Monitor server
to process.
What to do next
Optional: To verify that the configuration is
working, send a test message to the local WebSphere MQ queue.
- In the WebSphere MQ Explorer, right-click the local queue (such
as AppEventQ) and select Put Test
Message.
- Open the Common Base Event browser and click Get Events.
One event is received. Select the event to open the details. You can
see that the input test message is included in the any slot.
- In the WebSphere MQ Explorer, you can see that the queue depth
of the local queue is 0.
The JMS event emitter service has successfully retrieved the
message from the WebSphere MQ queue, wrapped it into the xs:any slot
in a Common Base Event, and sent it out to the CEI server.