aspose file tools*
The moose likes Websphere and the fly likes Websphere MQ failover Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Websphere MQ failover" Watch "Websphere MQ failover" New topic
Author

Websphere MQ failover

Syed Mahdi
Ranch Hand

Joined: Aug 27, 2004
Posts: 45
Hi guys,

I am developing an MQ client using the Ibm.mq.jar provided with the MQ. to connect to MQ manager and to put and get from the queues. The issue is that my app that is going to use it is in cluster mode. (not talking about the MQ cluster here). I need to know if IBM websphere6.1 has any functionality to actually bind my component some how to the extent that when It puts and the node in cluster goes down the next node takes the operation and reads from the node and delivers it back to the user.


I will appreciate any help or tips on countering this scenario.

Thanks.
T.Rob Wyatt
Greenhorn

Joined: Mar 10, 2011
Posts: 11
Since you specified that WMQ clustering is not used then there is only one instance of the queue. When multiple application instances are reading off the same queue, they are all competing for the same messages. If one application fails, the other instances will continue to consume off the queue and receive messages that the first instance would have received. If one application puts a message, commits it and then attempts to read it back, it is entirely possible that another application will already have read it before the first can get it, if they are reading in FIFO order. Of course, if they are reading by MsgID or CorrelID then the other app instance would somehow have to be passed the ID in order to select that specific message.
Syed Mahdi
Ranch Hand

Joined: Aug 27, 2004
Posts: 45
I am not talking about issues with MQ clustering (even though we do have MQ clustered). I am talking about cluster of web sphere and my web app accessing MQ through my adapter. if there are two nodes in a cluster and both have my MQ adapter to access the MQ and one goes down half way thru the communication how can i transfer that state to the other node telling it to complete the half done communication. Does websphere has any feature to register what is happening on the MQ level.
T.Rob Wyatt
Greenhorn

Joined: Mar 10, 2011
Posts: 11
Syed Mahdi wrote:...if there are two nodes in a cluster and both have my MQ adapter to access the MQ and one goes down half way thru the communication how can i transfer that state to the other node telling it to complete the half done communication. Does websphere has any feature to register what is happening on the MQ level.


Transactional sessions. When the first node goes down the transaction will roll back so that instead of a "half done communication" that unit of work reverts back to an "unstarted communication."
Syed Mahdi
Ranch Hand

Joined: Aug 27, 2004
Posts: 45
ok.. thats an idea, how do i bind the communication in a transaction or transactional sessions. a reversal is better than a half done communication.
T.Rob Wyatt
Greenhorn

Joined: Mar 10, 2011
Posts: 11
You should be able to specify a transacted session and get 1-phase commit. Just use the COMMIT verb after each set of messages. Since you aren't using transactions now I'll assume that you don't need 2-phase commit but if you did you'd need to use an XAConnectionFactory instead of a ConnectionFactory. If you needed 2-phase commits the app server configuration would impact your app. With 1-phase commit there are some app server settings that would provide transaction management in the container but in this case it's probably easiest to just specify a transacted session and issue COMMITs. Just remember that the scope of the transaction is the session. So if you have multiple threads, each must have its own session or else they will COMMIT against each other's work which is probably not what you want.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Websphere MQ failover