What is the difference between BytesMessage and StreamMessage?
Answer Posted / munnu
BytesMessage stores the primitive data types by converting them to their byte representation. Thus the message is one contiguous stream of bytes. While the StreamMessage maintains a boundary between the different data types stored because it also stores the type information along with the value of the primitive being stored. BytesMessage allows data to be read using any type. Thus even if your payload contains a long value, you can invoke a method to read a short and it will return you something. It will not give you a semantically correct data but the call will succeed in reading the first two bytes of data. This is strictly prohibited in the StreamMessage. It maintains the type information of the data being stored and enforces strict conversion rules on the data being read.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is wire level protocol?
How to Set message priority levels?
What are the steps involved in configuring the jms?
How do the wls jms 6.1 server/destination message maximum and threshold values work?
What is a stream message?
Is ibm mq jms compliant?
What is administered objects in jms?
Is kafka a jms?
How does jms listener work?
What are the basic advantages of jms?
How kafka is different from jms?
Which are the benefits of mdb (message driven beans) over standard jms consumers?
Give an example of using point to point model in JMS?
Explain about publish model?
Explain about JMS queue?