YouTube Icon

Interview Questions.

Top 100+ Jms(java Message Service) Interview Questions And Answers - May 31, 2020

fluid

Top 100+ Jms(java Message Service) Interview Questions And Answers

Question 1. What Is Jms?

Answer :

JMS manner Java Messaging Service.  It is the brand new standard for inter patron communique. It permits the J2EE application element to create, ship, study and get hold of the messages.

Question 2. What Type Of Messaging Is Provided By Jms?

Answer :

JMS gives each sort of messaging,

synchronous
Asynchronous
Simple Mail Transfer Protocol (SMTP) Interview Questions
Question 3. What Do You Mean By Synchronous And Asynchronous Type Of Messaging?

Answer :

Synchronous: In this type of messaging, consumer waits for the server to respond to a message. Ex: Telephone call, two way radio communique.
Asynchronous: In this type of messaging, patron does no longer watch for a message from the server, however automatically an occasion is created to cause a message from a server. Ex: e-mail, text messaging, weblog posting.

Question four. How Many Types Of Messaging Model Do Jms Provide For And What Are They?

Answer :

There are  types of messaging models that JMS offers –

Point to factor queuing
Second one is public and subscribe
JavaMail API Tutorial
Question five. Mention Different Types Of Messages Available In Jms Api?

Answer :

The one of a kind kinds of messages to be had in JMS API are Message, TextMessage, BytesMessage, ObjectMessage and MapMessage.

JavaMail API Interview Questions
Question 6. What Is The Difference Between The P2p (peer To Peer) Model And Subscribe Model?

Answer :

P2P model is especially dependable and it's miles used in a one-to-one situation, whilst subscribe model is used in one-to-many state of affairs. It could be very fast but much less dependable.

Question 7. What Is A Jms Client?

Answer :

JMS customer is a language software that sends or receives messages.

JNDI (Java Naming and Directory Interface) Interview Questions
Question 8. Can We Send E-mail Messages Using Jms?

Answer :

JMS has no inherent aid for e mail operations.

Question nine. Explain How Application Server Handles The Jms Connection?

Answer :

•With the assist of Application server, the server consultation is created and it stores them in a pool
•To positioned messages in JMS consultation, connection consumer, makes use of the Server consultation
•Server session is the only that creates the JMS session
•Application written with the aid of Application programmers creates the message listener.

Java Management Extensions (JMX) Interview Questions
Question 10. What Is The Difference Between Jms And Rpc (far flung Procedure Call)?

Answer :

The primary distinction among JMS and RPC lies within the way they message. JMS makes use of asynchronous messaging type whilst, RPC creates synchronous messaging kind. The technique invoker in RPC, waits for the approach to complete execution and go back back the manage to the invoker. In JMS the message sender just sends the message to the vacation spot and keeps its own processing.

Question 11. Explain How Does The Jms Work With The J2ee?

Answer :

The utility client like enterprise JavaBeans additives and net additives can send or acquire JMS message synchronously. In addition, the application clients can also get hold of message asynchronously.   With the help of message-driven beans, JMS provider can optionally enforce the processing of messages. Message-pushed beans are a sort of organisation bean that enables the asynchronous consumption of messages.
The operation of sending and receiving message is completed in disbursed operation, which allows JMS operations and database accesses within a unmarried transaction.

Mail Server Interview Questions
Question 12. What Are The Types Of Messages That Are Supported By Jms?

Answer :

The kinds of messages which are supported via JMS are
•Stream Messages
•Text Messages
•Map Messages
•Bytes Messages
•Object Messages

Simple Mail Transfer Protocol (SMTP) Interview Questions
Question 13. What Is Mom In Reference To Jms?

Answer :

The MOM ( Message Oriented Middleware) is a software that works as an intermediate among  communicating additives.  It is positioned among the purchaser and server, MOM affords the facility of passing message via the use of the method queuing. Until the patron does now not request to read the message, the messages will be stored in queue.  By the usage of this method, the software program issue can work independently of time.

Question 14. How You Can Deliver A Java Message To A Non-java Client?

Answer :

First of all, after receiving the message from Topic or Queue, the message needs to be transformed into a non-java client consistent with their specification. The message once transformed to non-java patron, it can be delivered.

Question 15. For Sending Messages Through Jms, What Encryption Options Are There?

Answer :

The encryption and decryption of the messages is dealt with by using JMS provider and now not JMS specifications. Sonic MQ via Progress Software is a main JMS issuer and they do encryption thru encryption mechanisms called Quality of Protection.

 

Apache Wicket Interview Questions
Question sixteen. For Jms-enabled Application, What Are The Core Jms-related Objects Required?

Answer :

The middle JMS-related items which can be required are –
•The connection item
•One or more periods within a connection that provides a context for message sending and receiving.
•A topic or queue object within a consultation representing the destination inside the message broking.
•Appropriate sender or publisher or receiver within a consultation.

Question 17. What Is Jms Administered Object?

Answer :

JMS administered item is a pre-configured JMS object that is created via an administrator for using JMS clients and placed in JNDI namespace.

Question 18. What Is The Important Part Of Jms Applications?

Answer :

•Session
•Connection
•Message
•Message Producer
•Message Consumer
•Connection manufacturing unit and vacation spot

JavaMail API Interview Questions
Question 19. What Is Jms Session?

Answer :

A JMS consultation is a single-threaded context for sending and receiving JMS messages.  A JMS session might be a regionally transacted, non-transacted or dispensed transacted.

Question 20. Mention The Difference Between Durable And Non-durable Subscription?

Answer :

Durable subscription gives a subscriber the freedom of receiving all messages from a topic, at the same time as a non-durable subscription does now not make any ensures approximately messages despatched by way of others when a client get disconnected by using others.

Question 21. What Is Byte Message?

Answer :

Byte message is a movement of uninterrupted bytes. It carries an array of primitive bytes in its payload.  For the transfer of data among two programs in their native layout, byte message is used, which may be not viable with different message types.

Question 22. Give An Example Of Using Point To Point Model In Jms?

Answer :

Example for point to point model, could be a print out. When you select a print-out alternative, your system sends the message to the server, and once the print-out is taken out, again this server will ship the message lower back to you. Point to factor version is used, while the facts is particular to a unmarried consumer.

Question 23. What Is The Role Of The Jms Provider?

Answer :

The JMS company handles information conversion, safety of the messages and the purchaser triggering.  It specifies the extent of encryption, security level of the message and the excellent-facts kind for the non-JMS patron.

Question 24. What Are The Components Of Jms?

Answer :

•JMS company
•JMS consumer
•Messages
•Administered gadgets
•Native customers

JNDI (Java Naming and Directory Interface) Interview Questions
Question 25. What Is The Jms Api?

Answer :

The Java Message Service is a Java API that allows packages to create, send, acquire, and read messages. Designed via Sun and numerous companion corporations, the JMS API defines a common set of interfaces and associated semantics that permit packages written in the Java programming language to communicate with different messaging implementations.
The JMS API minimizes the set of concepts a programmer must discover ways to use messaging products but offers enough functions to help state-of-the-art messaging applications. It additionally strives to maximise the portability of JMS applications throughout JMS carriers within the equal messaging area.
The JMS API permits conversation that isn't always handiest loosely coupled but additionally
Asynchronous. A JMS provider can supply messages to a patron as they arrive; a purchaser does not must request messages to be able to acquire them.
Reliable. The JMS API can make certain that a message is delivered once and best once. Lower stages of reliability are available for applications which can have the funds for to miss messages or to get hold of duplicate messages.
The JMS Specification become first posted in August 1998. The present day version of the JMS Specification is Version 1.1, which was released in April 2002. You can down load a copy of the Specification from the JMS Web website online, http://java.Sun.Com/merchandise/jms/.

Question 26. How Jms Is Different From Rpc?

Answer :

In RPC the technique invoker waits for the approach to finish execution and return the manage back to the invoker. Thus it's miles absolutely synchronous in nature. While in JMS the message sender simply sends the message to the vacation spot and maintains it is own processing. The sender does not wait for the receiver to reply. This is asynchronous conduct. 

Question 27. How May Messaging Models Do Jms Provide For And What Are They?

Answer :

JMS gives for 2 messaging models, publish-and-subscribe and point-to-factor queuing. 

Java Management Extensions (JMX) Interview Questions
Question 28. What Is The Point-to-factor Model In Jms?

Answer :

A point-to-point version is based on the idea of a message queue: Senders send messages into the queue, and the receiver reads messages from this queue. In the point-to-point version, several receivers can exist, connected to the equal queue. However, (Message Oriented Middleware)MOM will supply the message only to one of them. To which relies upon at the MOM implementation. 

Question 29. What Is The Publish-and-subscribe Model In Jms?

Answer :

A post-subscribe model is based totally on the message subject matter idea: Publishers send messages in a topic, and all subscribers of the given topic obtain these messages. 

Question 30. What Is Publish/subscribe Messaging?

Answer :

With post/subscribe message passing the sending application/consumer establishes a named subject matter in the JMS broking/server and publishes messages to this queue. The receiving customers sign in (especially, subscribe) via the broker to messages via subject matter; each subscriber to a topic gets every message published to that topic. There is a one-to-many relationship between the publishing client and the subscribing customers. 

Question 31. Which Models Are Supported By Jms? Please, Explain Them.

Answer :

Publish/subscribe (pub/sub). This model lets in a purchaser (publisher) to send messages to a JMS subject matter. These messages are retrieved by other clients (subscribers) (it can occur so that a topic has no subscribers) asynchronously. Pub/sub version calls for a broking dispensing messages to distinct purchasers. 

Question 32. What Are The Different Parts Of A Jms Message?

Answer :

A JMS message carries three elements. A header, an optional homes and an optionally available frame. 

Question 33. What Is The Main Parts Of Jms Applications?

Answer :

The main parts of JMS packages are:

ConnectionFactory and Destination
Connection
Session
MessageProducer
MessageConsumer
Message 
Mail Server Interview Questions
Question 34. What Is The Difference Between Java Mail And Jms Queue?

Answer :

JMS is the proper excessive-performance messaging platform for intrabusiness messaging, with full programmatic manage over exceptional of carrier and shipping options.
JavaMail presents lowest not unusual denominator, slow, but human-readable messaging the usage of infrastructure already available on virtually each computing platform.

Question 35. Does Jms Specification Define Transactions? Queue

Answer :

JMS specification defines a transaction mechanisms permitting clients to ship and get hold of companies of logically bounded messages as a unmarried unit of facts. A Session may be marked as transacted. It way that each one messages despatched in a consultation are considered as elements of a transaction. A set of messages can be dedicated (commit() approach) or rolled back (rollback() method). If a company supports allotted transactions, it's encouraged to apply XAResource API. 

 

Question 36. What Is Messaging?

Answer :

Messaging is a method of conversation among software additives or packages. A messaging system is a peer-to-peer facility: A messaging client can send messages to, and receive messages from, any other patron. Each consumer connects to a messaging agent that offers facilities for growing, sending, receiving, and studying messages.
Messaging allows dispensed verbal exchange that is loosely coupled. A aspect sends a message to a vacation spot, and the recipient can retrieve the message from the destination. However, the sender and the receiver do not have to be available on the same time a good way to talk. In reality, the sender does no longer want to understand whatever about the receiver; nor does the receiver want to realize anything about the sender. The sender and the receiver want to realize simplest what message layout and what destination to use. In this appreciate, messaging differs from tightly coupled technologies, together with Remote Method Invocation (RMI), which require an application to realize a far off application's techniques.
Messaging additionally differs from electronic mail (e-mail), that's a technique of verbal exchange between people or among software program applications and those. Messaging is used for communique among software program applications or software program additives.
Messaging is a mechanism through which records can be exceeded from one software to any other software. 

Apache Wicket Interview Questions
Question 37. What Is Synchronous Messaging? Queue

Answer :

Synchronous messaging entails a customer that waits for the server to respond to a message. So if one give up is down the entire verbal exchange will fail. 

Question 38. What Is Asynchronous Messaging? Queue

Answer :

Asynchronous messaging involves a purchaser that does not watch for a message from the server. An occasion is used to trigger a message from a server. So despite the fact that the purchaser is down , the messaging will entire efficiently. 

 

Question 39. How Does A Typical Client Perform The Communication? Queue

Answer :

1. Use JNDI to find administrative gadgets.
2. Locate a unmarried ConnectionFactory object.
Three. Locate one or extra Destination gadgets.
4. Use the ConnectionFactory to create a JMS Connection.
Five. Use the Connection to create one or greater Session(s).
6. Use a Session and the Destinations to create the MessageProducers and MessageConsumers wanted.
7. Perform your conversation. 

Question forty. What Is Jms Application?

Answer :

One or more JMS customers that exchange messages.




CFG