Author |
Message
|
Vitor |
Posted: Thu Jan 01, 2009 10:58 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jolonm wrote: |
so when we call 1st time Get, below message will return (last few characters are missing - not sure but might be because of buffer size (please confirm if it might be because of buffer size) |
Yes, it's a buffer size problem. This is the buffer managed by your code; the code you're 110% certain works.
jolonm wrote: |
and when call Get for 2nd message, below message will return (the missing character of 1st message attached to 2nd message and received):
<Check>This is me again</Check>k> |
So the buffer's not being cleared & the pointer reset by your code; the code you're 110% certain works. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 01, 2009 11:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jolonm wrote: |
we noticed that, MQ alter messages only when MQ rolled back the transaction. (i am not sure but might have some relation) |
So your code works fine when all is well, but doesn't handle errors properly. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 01, 2009 11:06 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jolonm wrote: |
MQ alter messages only when MQ rolled back the transaction. |
For the record, WMQ doesn't alter messages. You need to distinguish between the message on the queue and what you're getting in the buffer of your code. Which I think is much less than 110% correct.
If you want to refute this, post a print of a corrupted message produced with amqsbcg or other IBM utility rather than your code. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Jan 01, 2009 11:51 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7723
|
jolonm wrote: |
Quote: |
Check your gmo options. |
Below is from code: please assist what else should be added:
if(m_QueueConfiguration.IsTransactional)
gmo.Options |= MQC.MQPMO_SYNCPOINT; |
You can't use PMO* variables when building GMO. 110%, eh?  _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
pshan81 |
Posted: Mon Jan 05, 2009 4:35 am Post subject: |
|
|
Acolyte
Joined: 24 May 2005 Posts: 72
|
Quote: |
You can't use PMO* variables when building GMO. 110%, eh? |
Logically speaking its true. However, the open options,PUT/GET message options are "int" and when I print the value for the below statements, both returns the same value (Value is 2).
gmo.options = MQC.MQGMO_SYNCPOINT ;
gmo.options = MQC.MQPMO_SYNCPOINT ;
System.out.println(" GMO " + gmo.options);
To my surprise, I was able to GET a message from a queue by setting the gmo options as MQC.MQPMO_SYNCPOINT (without any exceptions/error) |
|
Back to top |
|
 |
kevinf2349 |
Posted: Mon Jan 05, 2009 1:15 pm Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
PMO + GMO for synchpointing certainly does return the same int values but it is good programming practice to code the appropriate name for the appropriate call.
However in this case the issue isn't exactly syncpointing that is causing the issue, rather it is the incorrect handling of truncated messages, probably caused by an incorrect buffer size calculation.
Can someone post the code being used for the Get...including all the defines for the buffer etc.? |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Jan 05, 2009 4:17 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9482 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
To my surprise, I was able to GET a message from a queue by setting the gmo options as MQC.MQPMO_SYNCPOINT (without any exceptions/error) |
Not really a surprise, as these are logical names for binary values.
I suppose you could have used the actual binary values and achieved the same results. This, too, would not be a best practice thingie to do. _________________ 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 |
|
 |
|