Showing posts with label JMS. Show all posts
Showing posts with label JMS. Show all posts

Thursday, October 14, 2010

WebSphere Application Server SIBus as MQ queue manager

You may find yourself developing (legacy) message driven beans (MDBs) using listener port mechanism to connect to WMQ. If you want to test the MDBs (point-2-point) you need connection to WebShere MQ (at least if you are on WAS v6.x). Typically developers don't have dedicated WMQ so that could be a problem. I have used two workarounds. If you only have WAS on your disposal you could do:
  1. (Scenario one) Test MDB using activation specification (JCA 1.5 AS) instead of LP
  2. (Scenario two) Use SIBus to mimic WMQ and test as you would if you had WMQ

Scenario one

Both solution requires use of service integration bus (SIBus). If you are okey to use AS resource instead of LP then go ahead and create needed queues on SIBus, JNDI queues, queue conn. factories and AS. You can replace LP with AS in development tool (open ejb-jar.xml in RAD) or when application is deployed in WAS admin console. Because you created default messaging provider resources if you like to test MQ scenario you should have MQ resource set in JNDI also. That is inconvenient so you could use built in SIBus feature called MQ Client Link (not MQ Link, that's something different).

Scenario two

You define new MQ Client Link in your SIBus messaging engine (details here). You need give link name (not so important), define MQ channel name and Queue manager name. Those fields are important and you can enter something like WAS.JMS.SVRCONN and DEVQM respectively. So far so good. BTW this feature is added to SIBus so WAS v5 apps could be migrated to WAS v6 and use default messaging provide instead v5's embedded messaging (details here).
To keep things simple if you already have resources defined to connect to WMQ (queue, queue conn. factory, LP) all you need to do is change queue connection factory. Accordingly to given queue manager name and MQ channel name you should change it so it has properties like one below. 
MQ queue connection factory
Picture of queue manager connection factory (important fields shown)

You can find correct port on servers page in admin console. Look for SIB_MQ_ENDPOINT_ADDRESS port.
By default, this is 5558. Everything defined, after server restart, you can use JNDI resources and test MDB. Also note that JNDI mq queues
have the same base queue name as the queues defined on SIBus (same as on WMQ).  One can also use JNDI resources from client applications (let say to put message).





Saturday, May 9, 2009

Tools for connecting to IBM WAS Service Integration Bus

For the past year me and my colleagues at CROZ were doing a lot of work that included using service integration bus (SIB) and WAS 6.1 as JMS provider. Very often we needed to look are there any messages in queue or send test message. Two basic tools that does the job comes with WAS distribution:
  • WAS admin console

  • Universal test client (UTC)
Admin console can be used for looking queue (and topic) status at runtime. You can use UTC for sending and posting message using JMS API. However admin console is very cumbersome to use because you need to make 10 clicks to see message content and UTC is okay only for basic scenario.

So what other tools you can use to connect to SIB? Preferably stand alone one.

There are actually 3 nice tools from IBM and few from open source community that are very handy. From IBM you have:
  1. Service Integration Bus Explorer
  2. Service Integration Bus Performance
  3. IBM Client Application Tool for JMS


There are also very nice open source tools that can be connected to WAS SIB. I will mention :
  1. Hermes JMS
  2. Apache JMeter

Service Integration Bus Explorer

SIB explorer Tool that we used the most was SIB Explorer. It is stand alone tool from IBM alphaWorks. Installation is simple and described here. Trickier part is downloading SWT libraries. I have in my swt dir (version number may vary)
  • org.eclipse.swt.win32.win32.x86_3.3.2.v3347a.jar
  • org.eclipse.swt_3.3.2.v3347.jar
  • swt-gdip-win32-3347.dll
  • swt-win32-3347.dll
The reason this tool is very handy is that everything is there and you don't need to click too much. If you like to see what messages are in what queue you just open queue points and there you have all queues with their current depth. However for putting new messages in queue it is not so great because you can't add any message property (for instance targetService for SOAP/JMS).

Service Integration Bus Performance

If you need to get some SIB performance related data this tool can be very useful. You can use it to monitor thread pools, queues, topic spaces, communication and data store in near real time (with refresh every 2s). We didn't use it much as we have ITCAM but data it provides can be used for performance tuning. Also you can detect some anomalies like messages with inadequate reliability level.

IBM Client Application Tool for JMS

If you need to experiment a lot with putting messages in queue than you should probably use this tool. It also come from IBM alphaWorks but it doesn't require SWT libraries. However this tool connects to WAS JNDI so you need to have JMS JNDI resources defined. Dan Zrobok has wrote how to connect to the WAS from this tool. Once you connect you can send and receive message (tabs Message Producer and PtoP Message Consumer). Very nice feature is registering new Message Listener. Window pops up for every new message that is deliverd to destination that listener listens to.

Hermes JMS

One more tool you can use for exploring SIB destinations and posting is Hermes JMS. It can be quite handy if you have (or wanna have) messages stored in files and use them for testing. Also you can save messages to file from destinations for later use. Unfortunately Hermes JMS doesn't come with SIB adapter (only with WebSphere MQ one) so you must set it up on your own. It isn't trivial but you can start with downloading "IBM Client for JMS on J2SE with IBM WebSphere Application Server" and installing it. There are also some resources on the web available describing the whole procedure.

Apache JMeter

Another tool that can be very useful is Apache JMeter. With JMeter you can send and receive P2P messages using JMS Point-to-Point sampler. Publish-Subscribe functionality is also available. I was using JMeter for performance testing and also for functional testing. It is really great because you can set up JMS test case and test your messaging infrastructure with it. To set it up connect to the WAS SIB, you will also need IBM Client for JMS on J2SE with IBM WebSphere Application Server. If you need instructions on any of these tools please reply and maybe I'll blog about it.