|
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 |
Q |
What is JMS? |
|
|
A |
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 |
Q |
What type messaging is provided by JMS |
|
|
A |
Both synchronous and asynchronous are provided by JMS. |
|
|
|
|
|
3 |
Q |
What is messaging? |
|
|
A |
Messaging is a mechanism by which data can be passed from
one application to another application. |
|
|
|
|
|
4 |
Q |
What are the advantages of JMS? |
|
|
A |
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 |
Q |
What is synchronous messaging? |
|
|
A |
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 |
Q |
What is asynchronous messaging? |
|
|
A |
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 |
Q |
What is the difference between queue and topic ? |
|
|
A |
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 |
Q |
What is Stream Message ? |
|
|
A |
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 |
Q |
What is Map message? |
|
|
A |
map message contains name value Pairs.
The values can be of type primitives and its wrappers. The name is a string. |
|
|
|
|
|
10 |
Q |
What is text message? |
|
|
A |
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 |
Q |
What is object message ? |
|
|
A |
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 |
Q |
What is Byte Message ? |
|
|
A |
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 |
Q |
What is the difference between Byte Message and Stream
Message? |
|
|
A |
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 |
Q |
What is the Role of the JMS Provider? |
|
|
A |
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 |
Q |
What are the different parts of a JMS message ? |
|
|
A |
A JMS message contains three parts. a header, an optional
properties and an optional body. |
|
|
|
|
|
|
|
|
|
|
|
|
|