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 » JMSBytesMessage

Post new topic  Reply to topic
 JMSBytesMessage « View previous topic :: View next topic » 
Author Message
joecherian
PostPosted: Sun Dec 15, 2002 7:41 pm    Post subject: JMSBytesMessage Reply with quote

Novice

Joined: 15 Dec 2002
Posts: 23
Location: India

Hello..

I got a small doubt..

I created a JMSBytesMessage object using the call

JMSBytesMessage ByteMsg = (JMSBytesMessage)session.createBytesMessage()

then i read one message object from the queue using the call

ByteMsg = Queuereceiver.recieve()

now is it possible for me to know how many bytes are present in this
BytesMessage object so that i can allocate a byte array for reading all
the
data in to this byte array ?

Please help

Thanks

Joe Cherian
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
kingdon
PostPosted: Mon Dec 16, 2002 12:54 am    Post subject: Reply with quote

Acolyte

Joined: 14 Jan 2002
Posts: 63
Location: UK

The bad news:
no - it was something of an oversight from the JMS 1.0.2 spec.
The good news:
a call has been added to the JMS 1.1 spec for this purpose.

Until then, I'm afraid you have to choose between a few different work arounds:
a) Use fixed length messages
b) Use a different message type
c) Use a user property to carry the size of the message body
d) guess the buffer size, loop until the number of bytes read is less than the size of the buffer provided (implying an extra level of array copy operations to build the output array you really want)

(Yes, I know a, b and even c are likely to be inapplicable in some situations.)

Regards,
James.
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 Java / JMS » JMSBytesMessage
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.