Saturday, January 3, 2009

JMS Questions & Answers

1.What are the advantages of JMS?

JMS is asynchronous in nature. Thus not all the pieces need to be up all the time for the application to function as a whole. Even if the receiver is down the MOM will store the messages on it's behalf and will send them once it comes back up.



2.What is the difference between topic and queue?

A topic is typically used for one to many messaging i.e. it supports publish subscribe model of messaging. While queue is used for one-to-one messaging i.e. it supports Point-to-Point Messaging.



3.What is the use of Message object?

Message is a lightweight message having only header and properties and no payload.



4.What are the two different types of messaging models that are supported by JMS?

1. Point-to-Point
2. Publish and Subscribe.


5.What information is stored in the Header of a ‘Message’?

Message identification and routing information.



6.What are the types of acknowledgments?

1) Acknowledgment by commits. – Acknowledgement happens automatically when a transaction is committed.

2) Session.AUTO_ACKNOWLEDGE

3) Session.CLIENT_ACKNOWLEDGE – client must call the acknowledge( ) method

4) Session.DUPS_OK_ACKNOWLEDGE –Session acknowledges the message after it has been delivered. This may result in the delivery of some duplicate messages if the JMS provider fails.



7.What happens to messages if a transaction is rolled back?


All consumed messages are re-delivered.



8.What is text message?

Text messages contain String messages. It is useful for exchanging textual data and complex character data like XML.



9.What is the Role of the JMS Provider?


The JMS provider handles security of the messages, data conversion and the client triggering. The JMS provider specifies the level of encryption and the security level of the message, the best data type for the non-JMS client.



10.What are the advantages of JMS?


One of the principal advantages of JMS messaging is that it's asynchronous. Thus not all the pieces need to be up all the time for the application to function as a whole.

No comments: