Author |
Message
|
AnandZadbuke |
Posted: Wed Feb 16, 2011 11:02 pm Post subject: .NET Code eating two message for single GET call. |
|
|
Newbie
Joined: 16 Feb 2011 Posts: 3
|
ddd
Last edited by AnandZadbuke on Thu Feb 17, 2011 4:54 am; edited 1 time in total |
|
Back to top |
|
 |
exerk |
Posted: Thu Feb 17, 2011 12:35 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
I don't know enough to answer your question, but if you are using WMQ V7.0 and an unmanaged client don't do this:
Code: |
Hashtable props = new Hashtable();
props.Add(MQC.HOST_NAME_PROPERTY, "U4VMMQNP109(1414)");
props.Add(MQC.CHANNEL_PROPERTY, "CSM.SVRCONN.01"); |
Use the mqclient.ini file in conjunction with a CCDT, or at least externalise the details into an editable file, even for a test application because then it's transportable. _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
zpat |
Posted: Thu Feb 17, 2011 1:15 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
same for any MQ object name such as queue name, put in somewhere external to the code.
Setting format before a get does nothing. The format is in the message MQMD.
You shoud use MQGMO_CONVERT on all string messages.
Don't open the queue for each GET (put the open before the GET loop).
Close the queue after you have finished doing the GET loop.
Disconnect from the queue manager after the close.
Check the buffer size you provide for the get. It's likely that you have only part of the message if it's too small.
Try not using SYNCPOINT to see if that fixes it - if it does your commit logic is wrong.
Lots of things to fix before trying again. MQ does not get two messages for one get - you can be sure of that. |
|
Back to top |
|
 |
AnandZadbuke |
Posted: Thu Feb 17, 2011 1:29 am Post subject: Worst part is - t works on my WINDOWS 7 and not on 2008 SVR |
|
|
Newbie
Joined: 16 Feb 2011 Posts: 3
|
Same code works very fine on my WIN7 machine and not on WIN2008 server |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Feb 17, 2011 2:27 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
zpat wrote: |
Don't open the queue for each GET (put the open before the GET loop). |
Otherwise if you see different behavior on one machine than on another for "the same" code, then either it's not the "same" code somehow, or there's something wrong with one of the machines.
Are you using a full MQ Client install in each case, or are you copying DLLs?
Are you rebuilding your app for 64bit ?
Do you see the same behavior with the nmqsget sample? |
|
Back to top |
|
 |
AnandZadbuke |
Posted: Thu Feb 17, 2011 2:56 am Post subject: If I put small msg it work everywhere msg size 430KB fails |
|
|
Newbie
Joined: 16 Feb 2011 Posts: 3
|
If I put small msg it work everywhere - msg size 430KB it fails despite the max lenth is 4 MB for the messge for the queue. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Feb 17, 2011 7:22 am Post subject: Re: If I put small msg it work everywhere msg size 430KB fai |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
AnandZadbuke wrote: |
If I put small msg it work everywhere - msg size 430KB it fails despite the max lenth is 4 MB for the messge for the queue. |
Are you using the latest version (V7.0.1.4)?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
zpat |
Posted: Thu Feb 17, 2011 9:48 am Post subject: Re: Worst part is - t works on my WINDOWS 7 and not on 2008 |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
AnandZadbuke wrote: |
Same code works very fine on my WIN7 machine and not on WIN2008 server |
The errors I have pointed out need fixing. Whether or not it appears to work there are some very bad coding practices in your code. Not to correct these would be unwise. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 17, 2011 9:53 am Post subject: Re: If I put small msg it work everywhere msg size 430KB fai |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
AnandZadbuke wrote: |
If I put small msg it work everywhere - msg size 430KB it fails despite the max lenth is 4 MB for the messge for the queue. |
Then you have a problem with your buffer and a problem with your error handling.
The other problem is that you've edited your first post to remove all the details so newcomers like me are just guessing what you're saying. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|