Author |
Message
|
fjb_saper |
Posted: Wed Feb 01, 2017 12:33 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Vitor wrote: |
fjb_saper wrote: |
the put did happen and before the qmgr could respond positively the connection got broken and you still get a 2009... (client side).
|
Really? If the queue manager has failed to handshake with the client, wouldn't it roll back the message? Or at least leave it uncommitted? |
The assumption you are making here is that you are running inside of a Unit of Work. What happens if your put is outside of a Unit of Work? Clearly from the OP's post, he is not working inside a UOW
Code: |
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); |
Also the automated reconnection to the MI manager should allow you to finally commit or roll back the pending UOW after reconnection...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Wed Feb 01, 2017 12:47 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
fjb_saper wrote: |
Clearly from the OP's post, he is not working inside a UOW
Code: |
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); |
|
It's Java - there's nothing clear about it.
It's like the A-level Calculus textbooks I used to hate as a child; they fill an A4 page with formulae and then smugly write:
Quote: |
from which it can be seen |
I spent many lessons muttering, "not by me it can't be" under my breath.
Java. Humbug. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Feb 01, 2017 4:38 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
You can use syncpoint to do the put, you issue the commit and get a 2009 reason code. Did the commit work (connection broker after the commit worked but before the the result was sent back), or not (connection broker prior to Qmgr executing the commit)? Flip a coin, you can't tell and you shouldn't guess. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
tczielke |
Posted: Wed Feb 01, 2017 8:29 pm Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
If you really need to know, you PUT your application message to your application queue and PUT another message with a unique identifier (also probably with an expiry) to another sync queue under the same unit of work, and then you commit. If you get a 2009, you check if your identifier message is on the sync queue. If so, your commit to your application queue was good. If not, you have relative assurance your commit to your application queue failed. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
kalam475 |
Posted: Wed Feb 01, 2017 10:24 pm Post subject: |
|
|
Acolyte
Joined: 16 Jan 2015 Posts: 63
|
Quote: |
The assumption you are making here is that you are running inside of a Unit of Work. What happens if your put is outside of a Unit of Work? Clearly from the OP's post, he is not working inside a UOW
|
We have tried making it under UOW by giving the
Quote: |
session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE); |
and tried to make commit and rollback in the code. When I use reconnection logic it is trowing an exception JMSCC0020: This session is closed.
still same issue. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Feb 02, 2017 6:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
kalam475 wrote: |
Quote: |
The assumption you are making here is that you are running inside of a Unit of Work. What happens if your put is outside of a Unit of Work? Clearly from the OP's post, he is not working inside a UOW
|
We have tried making it under UOW by giving the
Quote: |
session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE); |
and tried to make commit and rollback in the code. When I use reconnection logic it is trowing an exception JMSCC0020: This session is closed.
still same issue. |
See tzielke's post above on the subject... _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Feb 02, 2017 6:36 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
Have you looked at the error logs on both client and server? Any errors noted? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Feb 02, 2017 8:06 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Vitor wrote: |
I spent many lessons muttering, "not by me it can't be" under my breath.
Java. Humbug. |
Te-He. I was in the same boat until I discovered Laplace Transforms. The Maths Dept hit back by adding to the exam questions. "Not to be solved using Laplace Transforms".
Grrrrrrrrr _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
kalam475 |
Posted: Thu Feb 02, 2017 8:13 am Post subject: |
|
|
Acolyte
Joined: 16 Jan 2015 Posts: 63
|
Quote: |
Have you looked at the error logs on both client and server? Any errors noted? |
In WAS Systemout.log file we are getting the same error i.e 2009 in MQ server error logs there is only mentioning of switching the queue manager apart from that no other no other mention of missing messages.
can anyone please elaborate what @tczielke is suggesting. how the putting a message in another sync queue will help me in this scenario. If i am not wrong what he is suggesting is put the message in actual queue first and put the another message in sync queue and then commit. but what if my queue manager switches to standby after first put in actual queue.
Thanks to all for your help. |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Feb 02, 2017 8:48 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
Please look at the MQ error logs - on BOTH client platform AND qmgr server platform? Any errors logged? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Feb 02, 2017 2:38 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
kalam475 wrote: |
Quote: |
Have you looked at the error logs on both client and server? Any errors noted? |
In WAS Systemout.log file we are getting the same error i.e 2009 in MQ server error logs there is only mentioning of switching the queue manager apart from that no other no other mention of missing messages.
can anyone please elaborate what @tczielke is suggesting. how the putting a message in another sync queue will help me in this scenario. If i am not wrong what he is suggesting is put the message in actual queue first and put the another message in sync queue and then commit. but what if my queue manager switches to standby after first put in actual queue.
Thanks to all for your help. |
So when you read the message from the sync queue (after the MI qmgr switched ) you will either find the message (give it enough TTL) or you won't.
If you won't there is a good chance the 2009 was returned before the commit. If you do the 2009 was returned after the commit...
Now if you can recover automatically the pending transactions from WAS after the switch...
Hope it helps...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Feb 02, 2017 4:37 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
tczielke wrote: |
If you really need to know, you PUT your application message to your application queue and PUT another message with a unique identifier (also probably with an expiry) to another sync queue under the same unit of work, and then you commit. If you get a 2009, you check if your identifier message is on the sync queue. If so, your commit to your application queue was good. If not, you have relative assurance your commit to your application queue failed. |
Clever!  _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Feb 02, 2017 6:25 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
Clever indeed. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Feb 03, 2017 3:46 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
And then you remember to schedule something to drain the sync queue.... _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Feb 03, 2017 5:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mqjeff wrote: |
And then you remember to schedule something to drain the sync queue.... |
Wouldn't checking with a destructive get do that for you?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|