0

I have a MDB deployed on Jboss that gets messages from a Websphere MQ queue,looking in each message header for GroupId and Sequence information.Once it gets all sequences for a group,puts together the payload of each message it received to form one big message and sends it to another system.

Now the MDB will be deployed in a Websphere Application Server 7 clustered environment and I don't know for sure if there is any caching/configuration available to gather all message sequences for a group by one instance of the cluster(otherwise,if one instance receives some message parts and another instance the rest,in the end the MDB won't be able to put together one big message)

I read that the jms-ra resource adaptor can be configured with con.sun.genericra.loadbalancing.selector= (e.g JMSType = 'Instance1' and so on for the other instances) The JMSType header should be present in the message and should be 'Instance1', for instance 1 to process this message.

But I'm not sure if the system that will put the messages in the queue from where the MDB picks them up will send such information in their message headers.

Is there a way to configure the cluster to achieve this?

kien
  • 11
  • 4

1 Answers1

0

When working in cluster environment, MDBs work independently. There are several ways to achieve syncronization.

1) You can use selectors to divide message flows between cluster nodes. Here is the docs http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzal.doc%2Ffg20180_.htm The main problem is that selectors need some info in message properties to make their job. Somebody must put them there.

2) You can make syncronization on "shared" data collector, such as DB. You will put received messages there. Further processing can be made async or on last message come basis.

3) You can make a "proxy" yourself. You can make additional "internal" queue. Take messages by several MDB from external queue, anylize them and put properties needed for point 1. Then put messages in internal queue and read them as in point 1 using selectors by different nodes.

  • I thought of going for something similar to what described at point number two,but finally it was decided to follow this (figure no.6) http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.multiplatform.doc%2Finfo%2Fae%2Fae%2Fcjn_mdb_endpt_overview.html – kien Feb 17 '14 at 12:36
  • This variant will probably need some structure changes in your software. In your case only one MDB will work at the same time, so if the work is made in the processes of MDB, you will have only one working server at the same time. You will have to make architecture something like in point 3, to make application work well on cluster. – Nasonov Nikita Feb 18 '14 at 13:52
  • Reading http://www.ibm.com/developerworks/websphere/library/techarticles/0602_currie/0602_currie.html made things a lot easier(by setting the message selector JMS_IBM_Last_Msg_In_Group=TRUE on the defined activation specification in Websphere) – kien Feb 18 '14 at 20:26