Author |
Message
|
shamcs |
Posted: Sun Dec 12, 2010 8:59 pm Post subject: message return not same with actual message data |
|
|
Novice
Joined: 09 Dec 2010 Posts: 10
|
hye there..
i have problem in my development to browse message from queue..
the message return is not same with actual message data..
any idea why this happen..
this queue message options.
"queueGetMessageOptions.Options = MQC.MQGMO_NO_SYNCPOINT + MQC.MQGMO_CONVERT + MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_BROWSE_NEXT;"
Thanks for help.. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Dec 12, 2010 11:20 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You have browse next but do you have the browse option? _________________ MQ & Broker admin |
|
Back to top |
|
 |
Mr Butcher |
Posted: Sun Dec 12, 2010 11:22 pm Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
Quote: |
the message return is not same with actual message data.. |
i dont understand
what did you receive? what did you expect? how do you know, that the message you got is not the message you should have got?
show all your code relevant to the mqget.
do you wipe out msgid and correlid before mqget? _________________ Regards, Butcher |
|
Back to top |
|
 |
shamcs |
Posted: Sun Dec 12, 2010 11:54 pm Post subject: |
|
|
Novice
Joined: 09 Dec 2010 Posts: 10
|
Mr Butcher wrote: |
Quote: |
the message return is not same with actual message data.. |
i dont understand
what did you receive? what did you expect? how do you know, that the message you got is not the message you should have got?
show all your code relevant to the mqget.
do you wipe out msgid and correlid before mqget? |
here are the complete code i used to browse message in que..
queueManager = new MQQueueManager(queueManagerName, channelName, connectionName);
queue = queueManager.AccessQueue(queueName, MQC.MQOO_BROWSE + MQC.MQOO_FAIL_IF_QUIESCING);
MQMessage queueMessage = new MQMessage();
queueMessage.Format = MQC.MQFMT_STRING;
queueGetMessageOptions = new MQGetMessageOptions();
queueGetMessageOptions.Options = MQC.MQGMO_NO_SYNCPOINT + MQC.MQGMO_CONVERT + MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_BROWSE_NEXT;
queue.Get(queueMessage, queueGetMessageOptions);
str_rtn = queueMessage.ReadString(queueMessage.MessageLength);
message1 = str_rtn ;
MsgBox.Info(message1);
i get the message but when i view it with message box it will give me only view this data "20101209110432" and symbol.. like this image
Uploaded with ImageShack.us
it return some data and symbol like this when i debug the program..
""20101209110432\0\0\0\0\0\0\0\0QOL0QUEEC1\0\0\0\0\0\0\0\0\0\0dyynx2553e1l2gmeujjwga45\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\01\0\0\0INQ_HOST\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0A........"
[/img] |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Dec 13, 2010 2:50 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
\0 is a non-printable character. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Dec 13, 2010 5:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
shamcs wrote: |
i get the message but when i view it with message box it will give me only view this data "20101209110432" and symbol.. |
So your problem is not that the data isn't being returned, it's that the method you're using to display it (a message box) can't handle unprintable characters.
This is a problem with your application code, not with WMQ.
This wheel you're trying to reinvent simply doesn't roll.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shamcs |
Posted: Mon Dec 13, 2010 6:15 am Post subject: |
|
|
Novice
Joined: 09 Dec 2010 Posts: 10
|
Vitor wrote: |
shamcs wrote: |
i get the message but when i view it with message box it will give me only view this data "20101209110432" and symbol.. |
So your problem is not that the data isn't being returned, it's that the method you're using to display it (a message box) can't handle unprintable characters.
This is a problem with your application code, not with WMQ.
This wheel you're trying to reinvent simply doesn't roll.  |
yeah i get the message..but if declare it as a string it will produce symbol like that which is will bring to logic error..
how can i solve this thing..??what are the exactly format return when i use this code..??
string str_rtn = queueMessage.ReadString(queueMessage.MessageLength);
in WMQ, this symbol represent character or just a langguage which my computer cannot read and replace with this symbol..??
"\0\0\0\0\0\0"
i did use in c#
str_rtn = strrtn.Replace("\\0","");
to remove that symbol,but still cannot view the message data..
any ideas..?
thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Dec 13, 2010 6:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
First of all you are browsing a queue and assuming that all messages thereon are text messages...
Like in the Steven Segall movies, assumption is the .... (Dark territories)..
You have noticed that you need to be able to handle text messages (MQFMT_STRING) and messages that are not text messages (MQFMT_NONE).
Those non text messages typically do not carry text so you will need to handle them differently.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Mon Dec 13, 2010 6:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
shamcs wrote: |
in WMQ, this symbol represent character or just a langguage which my computer cannot read and replace with this symbol..?? |
No, your computer is doing that. WMQ doesn't care about the contents of the data. If the format is string, and you ask it to, WMQ will do certain tricks with it but the bottom line here is that the message you're trying to display contains data which can't be displayed by your computer in a message box.
shamcs wrote: |
any ideas..? |
Fix your code. Or give up and use one of the existing tools that browses message data instead. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shamcs |
Posted: Mon Dec 13, 2010 6:35 am Post subject: |
|
|
Novice
Joined: 09 Dec 2010 Posts: 10
|
..hehe.. thanks fjb and vitor ..i like this word..
fjb_saper wrote: |
First of all you are browsing a queue and assuming that all messages thereon are text messages...
Like in the Steven Segall movies, assumption is the .... (Dark territories)..
You have noticed that you need to be able to handle text messages (MQFMT_STRING) and messages that are not text messages (MQFMT_NONE). |
Vitor wrote: |
No, your computer is doing that. WMQ doesn't care about the contents of the data. If the format is string, and you ask it to, WMQ will do certain tricks with it but the bottom line here is that the message you're trying to display contains data which can't be displayed by your computer in a message box.
Fix your code. Or give up and use one of the existing tools that browses message data instead.
|
and also give me idea using "MQFMT_NONE" .. ..
thanks guys..so next morning will try it coz i dont bring job to home..lol..
just have 1 weeks to study about WMQ and need to developed this application..make me feel like student study in college..
thanks also
thanks to this forum..hopefully next day will finish developed this application..  |
|
Back to top |
|
 |
Vitor |
Posted: Mon Dec 13, 2010 6:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
shamcs wrote: |
and also give me idea using "MQFMT_NONE" .. .. |
Be sure you understand all the implications of doing this. Especially for any other applications that are using the message.
(I'm saying that because you're browsing the message and hence must be writing an administrative application with the actual application further downstream. No application which is the end consumer of the message has any reason to browse in normal use)
shamcs wrote: |
just have 1 weeks to study about WMQ and need to developed this application..make me feel like student study in college..
|
This will get worse before it gets better. WMQ is not a simple piece of software. I urge you to get some formal training. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shamcs |
Posted: Mon Dec 13, 2010 7:15 am Post subject: |
|
|
Novice
Joined: 09 Dec 2010 Posts: 10
|
Vitor wrote: |
This will get worse before it gets better. WMQ is not a simple piece of software. I urge you to get some formal training. |
task has been assigned to me..so i just accepted it..
so far the requirement is not so hard..i get manage to complete 80% of the requirement with help from this forum and redbooks..
tomorrow will try again..and i will keep post in this forum if have a troubled..
Thanks anyway vitor  |
|
Back to top |
|
 |
Vitor |
Posted: Mon Dec 13, 2010 7:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
shamcs wrote: |
task has been assigned to me..so i just accepted it.. |
We hear this a lot here.
shamcs wrote: |
so far the requirement is not so hard..i get manage to complete 80% of the requirement with help from this forum and redbooks.. |
Though it does sound like you're going in an odd direction that may cause trouble later.
shamcs wrote: |
tomorrow will try again..and i will keep post in this forum if have a troubled.. |
I suppose anything you can implement as working will do. Remember what I said about changing message format.
And the training. I could probably write a Java app (or at least 80% of one) with access to the redbooks & the Internet. Doesn't mean it would be a good app, or a production strength one, but it might produce the results I was looking for...  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Dec 13, 2010 8:07 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Vitor wrote: |
I could probably write a Java app (or at least 80% of one) with access to the redbooks & the Internet. Doesn't mean it would be a good app, or a production strength one, but it might produce the results I was looking for...  |
Then I would suggest you start with JMS. There are good JMS tutorials out there.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 14, 2010 6:58 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
fjb_saper wrote: |
Then I would suggest you start with JMS. There are good JMS tutorials out there.  |
Yeah. Tried that. Had a rash for days......  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|