|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Best way of reading a JMSBytesMessage message |
« View previous topic :: View next topic » |
Author |
Message
|
javierDiaz |
Posted: Thu May 23, 2002 12:41 am Post subject: Best way of reading a JMSBytesMessage message |
|
|
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 |
|
 |
amurugan |
Posted: Thu May 23, 2002 4:16 pm Post subject: |
|
|
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 |
|
 |
javierDiaz |
Posted: Fri May 24, 2002 1:11 am Post subject: BytesMessage discussion |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|