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 » General Discussion » Need Urgent Help! ( many thanks)

Post new topic  Reply to topic Goto page 1, 2  Next
 Need Urgent Help! ( many thanks) « View previous topic :: View next topic » 
Author Message
bigmq
PostPosted: Mon Dec 06, 2004 7:51 am    Post subject: Need Urgent Help! ( many thanks) Reply with quote

Novice

Joined: 14 Sep 2004
Posts: 19

I got a message file from the MQ, when i browse it, i found the message inside the quese look like this:
00000000: 3C45 7874 6572 6E61 6C49 6E74 6572 6661 '<ExternalInterfa'
00000010: 6365 4D65 7373 6167 653E 0A3C 4D65 7373 'ceMessage>.<Mess'
00000020: 6167 6542 6F64 793E 0A3C 4865 6164 6572 'ageBody>.<Header'
00000030: 3E0A 3C44 6973 636C 6169 6D65 723E 5349 '>.<Disclaimer>SI'
00000040: 5043 3C2F 4469 7363 6C61 696D 6572 3E0A 'PC</Disclaimer>.'
00000050: 3C42 6163 6B65 7250 6C61 7465 4E75 6D62 '<BackerPlateNumb'
00000060: 6572 3E30 313C 2F42 6163 6B65 7250 6C61 'er>01</BackerPla'
00000070: 7465 4E75 6D62 6572 3E0A 3C41 6363 7443 'teNumber>.<AcctC'
00000080: 6172 7269 6572 3E0A 3C43 6F6D 7061 6E79 'arrier>.<Company'
00000090: 3E44 4555 5453 4348 4520 4241 4E4B 2053 '>DEUTSCHE BANK S'
000000A0: 4543 5552 4954 4945 532C 2049 4E43 3C2F 'ECURITIES, INC</'
000000B0: 436F 6D70 616E 793E 0A3C 4164 6472 6573 'Company>.<Addres'
000000C0: 733E 0A3C 4C69 6E65 3E36 3020 5741 4C4C 's>.<Line>60 WALL'
000000D0: 2053 5452 4545 543C 2F4C 696E 653E 0A3C ' STREET</Line>.<'
000000E0: 4C69 6E65 3E4E 4557 2059 4F52 4B20 4E59 'Line>NEW YORK NY'
000000F0: 2020 3130 3030 353C 2F4C 696E 653E 0A3C ' 10005</Line>.<'
00000100: 2F41 6464 7265 7373 3E0A 3C2F 4163 6374 '/Address>.</Acct'
00000110: 4361 7272 6965 723E 0A3C 4E6F 7469 6365 'Carrier>.<Notice'
00000120: 4261 6E6E 6572 3E43 6F6E 6669 726D 6174 'Banner>Confirmat'
00000130: 696F 6E20 4E6F 7469 6365 3C2F 4E6F 7469 'ion Notice</Noti'
00000140: 6365 4261 6E6E 6572 3E0A 3C2F 4865 6164 'ceBanner>.</Head'
00000150: 6572 3E0A 3C41 6363 7454 7261 6E73 4465 'er>.<AcctTransDe'
00000160: 7461 696C 733E 0A3C 4163 636F 756E 744E 'tails>.<AccountN'
00000170: 756D 6265 723E 3134 3531 3131 3934 3930 'umber>1451119490'
00000180: 3C2F 4163 636F 756E 744E 756D 6265 723E '</AccountNumber>'
00000190: 0A3C 5061 7265 6E74 4163 6374 4E61 6D65 '.<ParentAcctName'
000001A0: 3E4A 4150 414E 2054 5255 5354 4545 2053 '>JAPAN TRUSTEE S'
000001B0: 4552 5649 4345 5320 4241 4E4B 204C 543C 'ERVICES BANK LT<'
000001C0: 2F50 6172 656E 7441 6363 744E 616D 653E '/ParentAcctName>'
000001D0: 0A3C 5375 6241 6363 744E 616D 653E 412F '.<SubAcctName>A/'
000001E0: 4320 5542 5320 4153 5345 5420 3331 3731 'C UBS ASSET 3171'

and so on, i didn't paste all of them. It has ascii and binary mode and maybe hexadecimal mode too, how do i just get the ascii text out of the Queue.
In my java code, i used readUTF() to get message.

Thanks
Back to top
View user's profile Send private message
bigmq
PostPosted: Mon Dec 06, 2004 7:57 am    Post subject: Reply with quote

Novice

Joined: 14 Sep 2004
Posts: 19

I used "amqsbcq" command to browse the queue, by the way.
Back to top
View user's profile Send private message
bower5932
PostPosted: Mon Dec 06, 2004 8:37 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

What is the message format of the message? I'm guessing that it is not 'MQSTR '. My guess is that you should be using readString(int length) to read the strings out of the message. You could then use the readInt, readShort, readLong, etc. to get the rest of the data.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
bigmq
PostPosted: Mon Dec 06, 2004 9:33 am    Post subject: Reply with quote

Novice

Joined: 14 Sep 2004
Posts: 19

Thanks, bower5932
I used readString, and i got the only string message out, thanks. But now, i always get the first message, how do i get all the message out.
Back to top
View user's profile Send private message
bower5932
PostPosted: Mon Dec 06, 2004 9:52 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

I'm not sure I understand your question. If you are asking how to get more data out of the message, then use some of the other read calls to get it.

If you are asking how to get another message, re-issue the get call to get the next message.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
fjb_saper
PostPosted: Mon Dec 06, 2004 9:53 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Retrieve the full message as a byte array.
Create a helper class to analyse the byte array and return the correct values for each field of your structure.

It might be easier to have an XML message....

Enjoy
Back to top
View user's profile Send private message Send e-mail
bigmq
PostPosted: Mon Dec 06, 2004 10:00 am    Post subject: Reply with quote

Novice

Joined: 14 Sep 2004
Posts: 19

The data inside the queue is xml file. When i retrieve the message, everytime i run my java code, i always get the first message and it stops getting the rest of the file. MY code is like this:

openOptions = MQC.MQOO_BROWSE;

MQQueue system_default_local_queue1 = qMgr.accessQueue("TQ.DB.GDS", openOptions);


MQMessage retrievedMessage =new MQMessage();

//retrievedMessage.messageId =hello_world.messageId;
// Set the get message options..
MQGetMessageOptions gmo =new MQGetMessageOptions(); // accept the defaults
// same as MQGMO_DEFAULT

// Note: This is important. Set Get message option for browsing only.
gmo.options = MQC.MQGMO_BROWSE_FIRST;

// get the message off the queue..

system_default_local_queue1.get(retrievedMessage,gmo);
System.out.println("Message retrieved from the DB queue is:");

// And prove we have the message by displaying the UTF message text
//String msgText =retrievedMessage.readUTF();
String msgText = retrievedMessage.readString(retrievedMessage.getMessageLength());

System.out.println("The message is:"+msgText);
out.write(msgText);
// Close the queue.
system_default_local_queue1.close();

// Disconnect from the queue manager.
qMgr.disconnect();
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Dec 06, 2004 10:07 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

If you are browsing you have to iterate over the queue before closing the queue connection or the qmgr connection.

Otherwise you will always get the first message in the queue.
Getting the first message is O.K. if you are doing a destructive get. Browse is not doing this.

Enjoy
Back to top
View user's profile Send private message Send e-mail
bigmq
PostPosted: Mon Dec 06, 2004 11:13 am    Post subject: question again? Reply with quote

Novice

Joined: 14 Sep 2004
Posts: 19

i used the mqbrowse sample from this forum, and i changed a little bit of code, try to write all messages into one file. When i run the program, it gives me this exception:
Java exception: java.io.EOFException

why?
Back to top
View user's profile Send private message
bigmq
PostPosted: Mon Dec 06, 2004 11:23 am    Post subject: Reply with quote

Novice

Joined: 14 Sep 2004
Posts: 19

how do i iterate over the queue , in other words, how do i know it is the end of the queue? Sorry for the dump questions, i am a really newbie
Back to top
View user's profile Send private message
bower5932
PostPosted: Mon Dec 06, 2004 12:50 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Just keep getting messages until you get a 2033 error. If you look at something like the getGroup.java at:

http://www.developer.ibm.com/tech/sampmq.html

You'll see that it keeps getting messages until no more are available.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
bigmq
PostPosted: Mon Dec 06, 2004 1:37 pm    Post subject: Reply with quote

Novice

Joined: 14 Sep 2004
Posts: 19

Thank you very much!, one more question, when i run my putmessage java code, i got 2045 error code. I setup two different queue names under one queue manager, is it ok? why i have these error message.
Back to top
View user's profile Send private message
csmith28
PostPosted: Mon Dec 06, 2004 1:54 pm    Post subject: Reply with quote

Grand Master

Joined: 15 Jul 2003
Posts: 1196
Location: Arizona

# mqrc 2045

2045 0x000007fd MQRC_OPTION_NOT_VALID_FOR_TYPE
Quote:

2045 X’07FD’ MQRC_OPTION_NOT_VALID_FOR_TYPE
On an MQOPEN or MQCLOSE call, an option is specified that is not valid for the type of
object or queue being opened or closed.
For the MQOPEN call, this includes the following cases:
v An option that is inappropriate for the object type (for example, MQOO_OUTPUT for an
MQOT_PROCESS object).
v An option that is unsupported for the queue type (for example, MQOO_INQUIRE for a
remote queue that has no local definition).
v One or more of the following options:
MQOO_INPUT_AS_Q_DEF
MQOO_INPUT_SHARED
MQOO_INPUT_EXCLUSIVE
MQOO_BROWSE
MQOO_INQUIRE
MQOO_SET
when either:
– the queue name is resolved through a cell directory, or
– ObjectQMgrName in the object descriptor specifies the name of a local definition of a
remote queue (in order to specify a queue-manager alias), and the queue named in the
RemoteQMgrName attribute of the definition is the name of the local queue manager.
For the MQCLOSE call, this includes the following case: The MQCO_DELETE or
MQCO_DELETE_PURGE option when the queue is not a dynamic queue.
This reason code can also occur on the MQOPEN call when the object being opened is of type
MQOT_NAMELIST, MQOT_PROCESS, or MQOT_Q_MGR, but the ObjectQMgrName field in
MQOD is neither blank nor the name of the local queue manager.
Corrective action: Specify the correct option; see the WebSphere MQ Application Programming
Reference for more information. For the MQOPEN call, ensure that the ObjectQMgrName field is
set correctly. For the MQCLOSE call, either correct the option or change the definition type of
the model queue that is used to create the new queue.


I usually see this when a programmer/developer is trying to do something like GET a message from a QREMOTE.
_________________
Yes, I am an agent of Satan but my duties are largely ceremonial.
Back to top
View user's profile Send private message
bigmq
PostPosted: Mon Dec 06, 2004 2:45 pm    Post subject: 2042 Reply with quote

Novice

Joined: 14 Sep 2004
Posts: 19

I tried to send a file as messages into a queue, but i always get this error message 2042, what does this mean, how do i fix it?
Many thanks!
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Dec 06, 2004 2:49 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

To find out what the error is:
a) at OS prompt >
Code:
mqrc  <reason code>    //exemple
mqrc 2042

b) check appendixes in messaging and programming manuals.

Enjoy
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » General Discussion » Need Urgent Help! ( many thanks)
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.