Docsity

Top 25 JMS Interview Questions and Answers (2022) for Java Messaging Service - Prof. Toosa, Quizzes of Computer Science

Toggle sidebar
bg1
Top 25 JMS (Java Message Service)
Interview Questions (2022)
Here are JMS interview questions and answers for fresher as well
experienced candidates to get their dream job.
1) What is JMS?
JMS means Java Messaging Service. It is the new standard for inter client
communication. It allows the J2EE application component to create, send,
read and receive the messages.
2) What type of messaging is provided by JMS?
JMS provides both type of messaging,
synchronous
Asynchronous
3) What do you mean by Synchronous and Asynchronous
type of messaging?
Synchronous:$In this type of messaging, client waits for the server to
respond to a message. Ex: Telephone call, two way radio communication.
Asynchronous:$In this type of messaging, client does not wait for a message
from the server, but automatically an event is created to trigger a message
from a server. Ex: email, text messaging, blog posting.
4) How many types of messaging model do JMS provide for
and what are they?
There are two types of messaging models that JMS provides –
Point to point queuing
Second one is publish and subscribe
5) Explain the difference between topic and queue?
pf3
pf4
pf5

Partial preview of the text

Download Top 25 JMS Interview Questions and Answers (2022) for Java Messaging Service - Prof. Toosa and more Quizzes Computer Science in PDF only on Docsity!

Top 25 JMS (Java Message Service)

Interview Questions (2022)

Here are JMS interview questions and answers for fresher as well experienced candidates to get their dream job.

1) What is JMS?

JMS means Java Messaging Service. It is the new standard for inter client communication. It allows the J2EE application component to create, send, read and receive the messages.

2) What type of messaging is provided by JMS?

JMS provides both type of messaging,  synchronous  Asynchronous

3) What do you mean by Synchronous and Asynchronous

type of messaging?

Synchronous: In this type of messaging, client waits for the server to respond to a message. Ex: Telephone call, two way radio communication. Asynchronous: In this type of messaging, client does not wait for a message from the server, but automatically an event is created to trigger a message from a server. Ex: email, text messaging, blog posting.

4) How many types of messaging model do JMS provide for

and what are they?

There are two types of messaging models that JMS provides –  Point to point queuing  Second one is publish and subscribe

5) Explain the difference between topic and queue?

Queue technique is used for one to one messaging, and it supports point to point messaging. While topic is typically used for one to many messaging and it supports public subscribe model of messaging. JMS (Java Message Service) Interview Questions

6) What is the role of the JMS provider?

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

7) What are the components of JMS?

 JMS provider  JMS client  Messages  Administered objects  Native clients

8) Give an example of using point to point model in JMS?

Example for point to point model, would be a print out. When you select a print-out option, your system sends the message to the server, and once the

Durable subscription gives a subscriber the freedom of receiving all messages from a topic, while a non-durable subscription does not make any guarantees about messages sent by others when a client get disconnected by others.

14) What is Byte Message?

Byte message is a stream of uninterrupted bytes. It contains an array of primitive bytes in its payload. For the transfer of data between two applications in their native format, byte message is used, which may be not possible with other message types.

15) Mention different types of messages available in JMS

API?

The different types of messages available in JMS API are Message, TextMessage, BytesMessage, ObjectMessage and MapMessage.

16) What is the difference between the P2P (Peer to Peer)

model and subscribe model?

P2P model is highly reliable and it is used in a one-to-one situation, while subscribe model is used in one-to-many situation. It is very fast but less reliable.

17) What is a JMS client?

JMS client is a language program that sends or receives messages.

18) Can we send e-mail messages using JMS?

JMS has no inherent support for email operations.

19) Explain how Application server handles the JMS

Connection?

 With the help of Application server, the server session is created and it stores them in a pool

 To put messages in JMS session, connection consumer, uses the Server session  Server session is the one that creates the JMS session  Application written by Application programmers creates the message listener.

20) What is the difference between JMS and RPC (Remote

Procedure Call)?

The basic difference between JMS and RPC lies in the way they message. JMS uses asynchronous messaging type while, RPC creates synchronous messaging type. The method invoker in RPC, waits for the method to finish execution and return back the control to the invoker. In JMS the message sender just sends the message to the destination and continues its own processing.

21) Explain how does the JMS work with the J2EE?

The application client like enterprise JavaBeans components and web components can send or receive JMS message synchronously. In addition, the application clients can also receive message asynchronously. With the help of message-driven beans, JMS provider can optionally implement the processing of messages. Message-driven beans are a type of enterprise bean that enables the asynchronous consumption of messages. The operation of sending and receiving message is carried out in distributed operation, which allows JMS operations and database accesses within a single transaction.

22) What are the types of messages that are supported by

JMS?

The types of messages that are supported by JMS are  Stream Messages  Text Messages  Map Messages  Bytes Messages  Object Messages