-
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 public and subscribe
-
5. 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.
-
6. 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.
-
7. What Is A Jms Client?
JMS client is a language program that sends or receives messages.
-
8. Can We Send E-mail Messages Using Jms?
JMS has no inherent support for email operations.
-
9. 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. -
10. 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.
-
11. 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. -
12. 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 -
13. What Is Mom In Reference To Jms?
The MOM ( Message Oriented Middleware) is a software that works as an intermediate between two communicating components. It is placed between the client and server, MOM provides the facility of passing message by using the technique queuing. Until the client does not request to read the message, the messages will be stored in queue. By using this technique, the software component can work independently of time.
-
14. How You Can Deliver A Java Message To A Non-java Client?
First of all, after receiving the message from Topic or Queue, the message has to be converted into a non-java client according to their specification. The message once converted to non-java client, it can be delivered.
-
15. For Sending Messages Through Jms, What Encryption Options Are There?
The encryption and decryption of the messages is handled by JMS provider and not JMS specifications. Sonic MQ by Progress Software is a leading JMS provider and they do encryption through encryption mechanisms called Quality of Protection.
-
16. For Jms-enabled Application, What Are The Core Jms-related Objects Required?
The core JMS-related objects that are required are –
•The connection object
•One or more sessions within a connection that provides a context for message sending and receiving.
•A topic or queue object within a session representing the destination within the message broker.
•Appropriate sender or publisher or receiver within a session. -
17. What Is Jms Administered Object?
JMS administered object is a pre-configured JMS object that is created by an administrator for the use of JMS clients and placed in JNDI namespace.
-
18. What Is The Important Part Of Jms Applications?
•Session
•Connection
•Message
•Message Producer
•Message Consumer
•Connection factory and destination -
19. What Is Jms Session?
A JMS session is a single-threaded context for sending and receiving JMS messages. A JMS session could be a locally transacted, non-transacted or distributed transacted.
-
20. Mention The Difference Between Durable And Non-durable Subscription?
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.
-
21. 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.
-
22. 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 print-out is taken out, again this server will send the message back to you. Point to point model is used, when the information is specific to a single client.
-
23. 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.
-
24. What Are The Components Of Jms?
•JMS provider
•JMS client
•Messages
•Administered objects
•Native clients -
25. What Is The Jms Api?
The Java Message Service is a Java API that allows applications to create, send, receive, and read messages. Designed by Sun and several partner companies, the JMS API defines a common set of interfaces and associated semantics that allow programs written in the Java programming language to communicate with other messaging implementations.
The JMS API minimizes the set of concepts a programmer must learn to use messaging products but provides enough features to support sophisticated messaging applications. It also strives to maximize the portability of JMS applications across JMS providers in the same messaging domain.
The JMS API enables communication that is not only loosely coupled but also
Asynchronous.
A JMS provider can deliver messages to a client as they arrive; a client does not have to request messages in order to receive them.
Reliable
. The JMS API can ensure that a message is delivered once and only once. Lower levels of reliability are available for applications that can afford to miss messages or to receive duplicate messages.
The JMS Specification was first published in August 1998. The latest version of the JMS Specification is Version 1.1, which was released in April 2002. You can download a copy of the Specification from the JMS Web site, http://java.sun.com/products/jms/. -
26. How Jms Is Different From Rpc?
In RPC the method invoker waits for the method to finish execution and return the control back to the invoker. Thus it is completely synchronous in nature. While in JMS the message sender just sends the message to the destination and continues it’s own processing. The sender does not wait for the receiver to respond. This is asynchronous behavior.
-
27. How May Messaging Models Do Jms Provide For And What Are They?
JMS provides for two messaging models, publish-and-subscribe and point-to-point queuing.
-
28. What Is The Point-to-point Model In Jms?
A point-to-point model is based on the concept of a message queue: Senders send messages into the queue, and the receiver reads messages from this queue. In the point-to-point model, several receivers can exist, attached to the same queue. However, (Message Oriented Middleware)MOM will deliver the message only to one of them. To which depends on the MOM implementation.
-
29. What Is The Publish-and-subscribe Model In Jms?
A publish-subscribe model is based on the message topic concept: Publishers send messages in a topic, and all subscribers of the given topic receive these messages.
-
30. What Is Publish/subscribe Messaging?
With publish/subscribe message passing the sending application/client establishes a named topic in the JMS broker/server and publishes messages to this queue. The receiving clients register (specifically, subscribe) via the broker to messages by topic; every subscriber to a topic receives each message published to that topic. There is a one-to-many relationship between the publishing client and the subscribing clients.
-
31. Which Models Are Supported By Jms? Please, Explain Them.
Publish/subscribe (pub/sub). This model allows a client (publisher) to send messages to a JMS topic. These messages are retrieved by other clients (subscribers) (it may happen so that a topic has no subscribers) asynchronously. Pub/sub model requires a broker distributing messages to different consumers.
-
32. What Are The Different Parts Of A Jms Message?
A JMS message contains three parts. a header, an optional properties and an optional body.
-
33. What Is The Main Parts Of Jms Applications?
The main parts of JMS applications are:
- ConnectionFactory and Destination
- Connection
- Session
- MessageProducer
- MessageConsumer
- Message
-
34. What Is 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.
JavaMail provides lowest common denominator, slow, but human-readable messaging using infrastructure already available on virtually every computing platform. -
35. Does Jms Specification Define Transactions? Queue
JMS specification defines a transaction mechanisms allowing clients to send and receive groups of logically bounded messages as a single unit of information. A Session may be marked as transacted. It means that all messages sent in a session are considered as parts of a transaction. A set of messages can be committed (commit() method) or rolled back (rollback() method). If a provider supports distributed transactions, it’s recommended to use XAResource API.
-
36. What Is Messaging?
Messaging is a method of communication between software components or applications. A messaging system is a peer-to-peer facility: A messaging client can send messages to, and receive messages from, any other client. Each client connects to a messaging agent that provides facilities for creating, sending, receiving, and reading messages.
Messaging enables distributed communication that is loosely coupled. A component sends a message to a destination, and the recipient can retrieve the message from the destination. However, the sender and the receiver do not have to be available at the same time in order to communicate. In fact, the sender does not need to know anything about the receiver; nor does the receiver need to know anything about the sender. The sender and the receiver need to know only what message format and what destination to use. In this respect, messaging differs from tightly coupled technologies, such as Remote Method Invocation (RMI), which require an application to know a remote application’s methods.
Messaging also differs from electronic mail (e-mail), which is a method of communication between people or between software applications and people. Messaging is used for communication between software applications or software components.
Messaging is a mechanism by which data can be passed from one application to another application. -
37. What Is Synchronous Messaging? Queue
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.
-
38. What Is Asynchronous Messaging? Queue
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.
-
39. How Does A Typical Client Perform The Communication? Queue
1. Use JNDI to locate administrative objects.
2. Locate a single ConnectionFactory object.
3. Locate one or more Destination objects.
4. Use the ConnectionFactory to create a JMS Connection.
5. Use the Connection to create one or more Session(s).
6. Use a Session and the Destinations to create the MessageProducers and MessageConsumers needed.
7. Perform your communication. -
40. What Is Jms Application?
One or more JMS clients that exchange messages.
Simple Mail Transfer Protocol (SMTP) Interview Questions
JavaMail API Tutorial
JavaMail API
JNDI (Java Naming and Directory Interface)
Java Management Extensions (JMX)
Mail Server
Simple Mail Transfer Protocol (SMTP) Interview Questions
Apache Wicket
JavaMail API
JNDI (Java Naming and Directory Interface)
Java Management Extensions (JMX)
Mail Server
Apache Wicket