1. What is synchronous messaging?
2. What is asynchronous messaging?
3. What is the difference between queue and topic ?
4. What are the core JMS-related objects required for each JMS-enabled application?
Each JMS-enabled client must establish the following:
- A connection object provided by the JMS server (the message broker)
- Within a connection, one or more sessions, which provide a context for message sending and receiving
- Within a session, either a queue or topic object representing the destination (the message staging area) within the message broker
- Within a session, the appropriate sender or publisher or receiver or subscriber object (depending on whether the client is a message producer or consumer and uses a point-to-point or publish/subscribe strategy, respectively). Within a session, a message object (to send or to receive)
The messages' fate depends not upon the transaction options outlined earlier, but rather upon the delivery mode. There are two delivery modes: nonpersistent and persistent. Messages with nonpersistent delivery modes are potentially lost if the JMS provider fails. Messages with persistent delivery modes are logged and stored to a stable storage. The JMS provider saves these messages to a stable storage, such as a database or a file system, and eventually delivers them to the application for processing.
8. What is Client acknowledgement in JMS?
9. How to create Transacted session?
The application indicates successful message processing by invoking the Session class's commit() method. The application can reject a message or a message group by invoking Session class's rollback() method. Calling the commit() method commits all the messages the session receives. Similarly, calling the rollback() method rejects all the messages the session receives. Session's commit() and rollback() methods make sense only with the transacted session option. The transacted session uses a chained-transaction model. In a chained-transaction model, an application does not explicitly start a transaction. Upon calling either the commit() or the rollback() methods, the application automatically starts a new transaction. Because a transaction is not explicitly started, it is always present and available.
10. What is Durable subscription?
A "durable" JMS message is applicable only to publish/subscribe paradigm and the "persistent" JMS message is applicable to both "Point-to-Point" & "publish/subcribe" paradigms.
Let's look at both:
A " durable message " is a message where the JMS server will hold on to a message if the subscriber is temporarily unavaliable. So the durability is defined by the relationship between a "Topc Subscriber" and the "JMS Server". Durability is applicable only to publish/Subscribe paradigm. For this to happen subscribers need to register themselves with a unique " client id ".
A " persistent message " is a message that defines the relationship between a "Message Producer" and the "JMS Server". This can be established for both
point-to-point and publish/subscribe. This has to do with the guaranteed once only delivery of the message by persisting the message after it has been recieved from the message producer.
We are covering here -'Java garbage collection interview questions' or 'Java memory interview questions' in d...
Java util.collections is one of the most important package in java and the important of this package can be understand by...
Java Concurrency interview question - In year 2004 when technology gurus said innovation in Java is gone down and Sun Microsystems [Now Or...
'Java investment bank interview' generally contains 'Java Design Pattern' questions. If you want to be a professional Java ...