Author |
Message
|
gavon stone |
Posted: Thu May 12, 2005 12:12 pm Post subject: jms message loss |
|
|
Novice
Joined: 09 Mar 2005 Posts: 16
|
Is there a way of making sure via websphere MQ that whenever I use JMS to receive from one queue and then send to another queue that those two actions will not result in the loss of messages i.e in case there is a system failure during the message transfer. Note both queues are on the same queue manager, my jms program does:
queue1.Receive()
...........
queue2.Send()
thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu May 12, 2005 12:43 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
A) make sure the messages are persistent
B) make sure the session is created with transaction support
Session sess = conn.createQueueSession(true, Session.ACKNOWLEDGE)
and do a session.commit() whenever necessary.
I would go with explicit commit and rollbacks
Enjoy  |
|
Back to top |
|
 |
dwitherspoon |
Posted: Tue May 24, 2005 12:23 pm Post subject: And... |
|
|
 Acolyte
Joined: 09 Dec 2003 Posts: 59
|
Make sure your queue connections come from that same MQQueueMgr object...then when the commit is done through that queue mgr, he will coordinate clean movement of the message from one queue to the other. _________________ Good...Fast...Cheap. Choose any two. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 24, 2005 12:29 pm Post subject: Re: And... |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
dwitherspoon wrote: |
Make sure your queue connections come from that same MQQueueMgr object...then when the commit is done through that queue mgr, he will coordinate clean movement of the message from one queue to the other. |
Not really necessary. The JMSDestination could have a different qmgr. The only imperative is that there is a default path from the qmgr you are connected to to the destination qmgr.
Otherwise your message will get put to the DLQ.
Anyway to my knowledge there is no transaction spanning mutliple sessions unless managed by an external transaction manager...(WAS).
So if you use JMS outside of WAS you are limitted in your transactional support to the Session.
Enjoy  |
|
Back to top |
|
 |
dwitherspoon |
Posted: Tue May 24, 2005 12:43 pm Post subject: |
|
|
 Acolyte
Joined: 09 Dec 2003 Posts: 59
|
I'm not familiar with the "default path" stuff here.
Most of my recent experience is with MQI...only using JMS for pub/sub. What's the equivalent of "default path" in MQI? _________________ Good...Fast...Cheap. Choose any two. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 24, 2005 12:47 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Read the intercommunication manual  |
|
Back to top |
|
 |
|