JMS interview questions
Here you can find out a list of interview questions for JMS. These questions are often asked by the interviewer for JMS (Java Message service) interview. We put our maximum effort to make this answers error free. But still there might be some errors. If you feel out any answer given for any question is wrong, please, please inform us by clicking on report bug button provided below.
In this section we are offering interview questions for JMS only. if you need interview questions for any other java related technologies , please check the relevant sections.
1. What is JMS?
The Java Message Service (JMS) API is a messaging standard that allows application components based on the Java 2 Platform, Enterprise Edition (J2EE) to create, send, receive, and read messages. It enables distributed communication that is loosely coupled, reliable, and asynchronous
2. What type messaging is provided by JMS
Both synchronous and asynchronous are provided by JMS.
3. What is messaging?
Messaging is a mechanism by which data can be passed from one application to another application.
4. 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.
5. What is synchronous messaging?
Synchronous messaging involves a client that waits for the server to respond to a message. So if one end is down the entire communication will fail.
6. What is asynchronous messaging?
Asynchronous messaging involves a client that does not wait for a message from the server. An event is used to trigger a message from a server. So even if the client is down , the messaging will complete successfully.
7. What is the difference between queue and topic ?
A topic is typically used for one to many messaging , while queue is used for one-to-one messaging. Topic .e. it supports publish subscribe model of messaging where queue supports Point to Point Messaging.
8. What is Stream Message ?
Stream messages are a group of java primitives. It contains some convenient methods for reading the data. However Stream Message prevents reading a long value as short. This is so because the Stream Message also writes the type information along with the value of the primitive type and enforces a set of strict conversion rules which actually prevents reading of one primitive type as another.
9. What is Map message?
Map message contains name value Pairs. The values can be of type primitives and its wrappers. The name is a string.
10. What is text message?
Text messages contains String messages (since being widely used, a separate messaging Type has been supported) . It is useful for exchanging textual data and complex character data like XML.
11. What is object message ?
Object message contains a group of serializeable java object. So it allows exchange of Java objects between applications. sot both the applications must be Java applications.
12. What is Byte Message ?
Byte Messages contains a Stream of uninterrupted bytes. Byte Message contains an array of primitive bytes in it’s payload. Thus it can be used for transfer of data between two applications in their native format which may not be compatible with other Message types. It is also useful where JMS is used purely as a transport between two systems and the message payload is opaque to the JMS client.
13. What is the difference between Byte Message and Stream Message?
Bytes Message stores data in bytes. Thus the message is one contiguous stream of bytes. While the Stream Message 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. Bytes Message 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 Stream Message. It maintains the type information of the data being stored and enforces strict conversion rules on the data being read.
14. 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.
15. What are the different parts of a JMS message ?
A JMS message contains three parts. a header, an optional properties and an optional body.