Professional Documents
Culture Documents
JMS defines an enterprise messaging Java API that makes it easy to write
business applications that can exchange business data and events
asynchronously and reliably in a vendor-agnostic manner.
2. How JMS (Java messaging service) is different from RPC (Remote Procedure
call)?
In RPC the client who invokes the method need to wait for the method to
complete the execution and return the control back to the invoker due to its
synchronous nature. In JMS the message sender just sends the message to the
destination and continues its own processing. The sender does not need to wait
for the receiver to respond as JMS is asynchronous.
Synchronous
Asynchronous
Point to Point,
and Publish and Subscribe method.
In publish and subscribe method (one producer and one or more consumer),
the producers publish the message and the subscribers who have subscribed to
that topic receive them. In this way, a message may be received, or processed,
by multiple consumers. It is unreliable however very fast.
10. Name some of the other major JMS products available in the market.
IBM's MQ Series is one of the most popular product used as Message Oriented
Middleware. Some of the other products include SonicMQ, iBus etc.
All the J2EE compliant application servers come with its own implementation of
JMS.
JMS provider.
JMS client.
Messages.
Administered objects.
and Native clients.
Session.
Connection.
Message.
Message Producer and Consumer .
Connection factory and destination.
StreamMessage,
TextMessage,
BytesMessage,
ObjectMessage,
and MapMessage.
31. Explain the difference between Java Mail and JMS Queue.
JMS is the ideal high-performance messaging platform for intrabusiness
messaging, with full programmatic control over quality of service and delivery
options.
32. How does a typical JMS client perform the communication using JMS.
34. 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.
35. How does the Application server handle the JMS Connection?
App server creates the server session and stores them in a pool.
Connection consumer uses the server session to put messages in the
session of the JMS.
Server session is the one that spawns the JMS session.
Applications written by Application programmers creates the message
listener.