What is the difference between BytesMessage and StreamMessage?



What is the difference between BytesMessage and StreamMessage?..

Answer / 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

More JMS Interview Questions

Is jms a message broker?

0 Answers  


Which types of jdbc databases does weblogic jms support?

0 Answers  


What are the various message types supported by JMS?

1 Answers  


Which are the benefits of mdb (message driven beans) over standard jms consumers?

0 Answers  


What is administered objects in jms?

0 Answers  






What is wire level protocol?

0 Answers  


What is jms connection factory in weblogic?

0 Answers  


What are the different types of messaging systems?

0 Answers  


What is a map message?

0 Answers  


What is the publish-and-subscribe model in jms?

0 Answers  


Why does jmssession.createtopic or jmssession.createqueue fail to create a destination in wls jms 6.1 (it worked in 5.1)?

0 Answers  


Why do I get java.security.AccessControlException when using JMS MessageListeners from Java stored procedures inside Oracle8i JServer?

1 Answers  


Categories