ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » message return not same with actual message data

Post new topic  Reply to topic
 message return not same with actual message data « View previous topic :: View next topic » 
Author Message
shamcs
PostPosted: Sun Dec 12, 2010 8:59 pm    Post subject: message return not same with actual message data Reply with quote

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
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Sun Dec 12, 2010 11:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Mr Butcher
PostPosted: Sun Dec 12, 2010 11:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
shamcs
PostPosted: Sun Dec 12, 2010 11:54 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Mon Dec 13, 2010 2:50 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

\0 is a non-printable character.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 13, 2010 5:37 am    Post subject: Reply with quote

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
View user's profile Send private message
shamcs
PostPosted: Mon Dec 13, 2010 6:15 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Mon Dec 13, 2010 6:20 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Dec 13, 2010 6:29 am    Post subject: Reply with quote

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
View user's profile Send private message
shamcs
PostPosted: Mon Dec 13, 2010 6:35 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Dec 13, 2010 6:59 am    Post subject: Reply with quote

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
View user's profile Send private message
shamcs
PostPosted: Mon Dec 13, 2010 7:15 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Dec 13, 2010 7:20 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Mon Dec 13, 2010 8:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Dec 14, 2010 6:58 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » message return not same with actual message data
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.