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 Java / JMS » Best way of reading a JMSBytesMessage message

Post new topic  Reply to topic
 Best way of reading a JMSBytesMessage message « View previous topic :: View next topic » 
Author Message
javierDiaz
PostPosted: Thu May 23, 2002 12:41 am    Post subject: Best way of reading a JMSBytesMessage message Reply with quote

Novice

Joined: 04 Mar 2002
Posts: 13
Location: Ireland

Hi there,

I have read here that one way of retrieving a JMSBytesMessage message from MQ-Series is by using the readBytes() method. This means that you have to either guess the size of the message being read to define an array of bytes or get into a loop where you keep retrieving fixed-length segments of the message until the entire message has been read.

Is there any other way of doing this? Is this the "standard" way of retrieving this kind of messages? I'd really appreciate your comments on this.

Many thanks in advance,

Javi
Back to top
View user's profile Send private message Visit poster's website
amurugan
PostPosted: Thu May 23, 2002 4:16 pm    Post subject: Reply with quote

Voyager

Joined: 10 Sep 2001
Posts: 75
Location: india

hi javi ,
what you said was right . Unlike the mqseries base java apis where you can get the message length theres no instance variable or method from where we can get the messages length . but then theres a round abt way to do that , the sending application might add a custome header field specifying the message data length and he receiving application can get the value from it and create a byte buffer and then populate the data with it or as u said you gotto either get it thru buffers or you can browse the message get the length and populate the byte buffer(not recommended) .If your sending application is also a jms applicationn then you can send the message in text message format itsefl(even though bytes are preferable!!!) . i think i am getting across javi . let me know.

cheers,
murugan
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
javierDiaz
PostPosted: Fri May 24, 2002 1:11 am    Post subject: BytesMessage discussion Reply with quote

Novice

Joined: 04 Mar 2002
Posts: 13
Location: Ireland

Hi murugan,

first of all, thanks a lot for your reply. What you propose here is really interesting and definitely a very good alternative for the future but unfortunately the sending application is a non jms application for which a change is not possible at this stage. Browsing? Out of curiosity, why is it a not recommended option? Is there any "hidden" danger in browsing the queue, allocate the proper buffer and get the message off the queue?

Cheers,

Javi
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Best way of reading a JMSBytesMessage message
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.