YouTube Icon

Interview Questions.

JMS Interview Questions And Answers - Jul 16, 2022

fluid

JMS Interview Questions And Answers

Q1. What is JMS (Java Messaging Service)?

Ans: JMS (Java Messaging Service) is a messaging popular that lets in J2EE application additives to create, ship, acquire, and read messages. JMS defines an agency messaging Java API that makes it smooth to put in writing commercial enterprise applications which can trade business information and events asynchronously and reliably in a vendor-agnostic way.

Q2. What kind messaging is furnished by means of JMS?

Ans: synchronous and asynchronous.

Q3. What are the blessings of JMS?

Ans: JMS is asynchronous in nature. Thus now not all of the portions need to be up all the time for the application to function as a whole. Even if the receiver is down the MOM will save the messages on it is behalf and will send them as soon as it comes again up. Thus at least a part of utility can nonetheless feature as there may be no blocking off.

Q4. What are the components of JMS?

Ans:

JMS issuer.

JMS patron.

Messages.

Administered gadgets.

And Native clients.

Q5. What are the important components of a JMS software?

Ans:

Session.

Connection.

Message.

Message Producer and Consumer .

Connection factory and destination.

Q6. How JMS isn't like RPC?

Ans: In RPC the technique invoker waits for the approach to complete execution and go back the control lower back to the invoker. Thus it's far absolutely synchronous in nature. While in JMS the message sender just sends the message to the vacation spot and maintains it's own processing. The sender does no longer await the receiver to respond. This is asynchronous conduct.

Q7.What is the Role of the JMS Provider?

Ans: The JMS issuer handles security of the messages, records conversion and the purchaser triggering. The JMS company specifies the extent of encryption and the security level of the message, the nice facts type for the non-JMS customer.

Q8. What are the core JMS-associated gadgets required for every JMS-enabled utility?

Ans: Each JMS-enabled patron must set up the subsequent:

A connection object supplied by the JMS server (the message broking)

Within a connection, one or more sessions, which offer a context for message sending and receiving

Within a consultation, both a queue or topic object representing the destination (the message staging place) within the message dealer

Within a consultation, the suitable sender or writer or receiver or subscriber item (depending on whether or not the customer is a message manufacturer or purchaser and uses a factor-to-point or publish/subscribe strategy, respectively). Within a consultation, a message item (to send or to acquire)

Q9. Different forms of Messaging fashions in JMS.

Ans: There are 2 kinds of messaging models that JMS presents:

Point to Point,

and Publish and Subscribe method.

Q10. Name a number of the other essential JMS products available within the marketplace.

Ans: IBM's MQ Series is one of the most famous product used as Message Oriented Middleware. Some of the other products encompass SonicMQ, iBus and many others.

All the J2EE compliant application servers include its personal implementation of JMS.

Q11. What is JMS consultation?

Ans: A JMS consultation is a single-threaded context for sending and receiving JMS messages, may be regionally transacted, non-transacted or disbursed transacted.

Q12. What is submit/subscribe messaging?

Ans: With post/subscribe message passing the sending utility/customer establishes a named subject matter inside the JMS broker/server and publishes messages to this queue. The receiving clients sign up (particularly, subscribe) through the broker to messages by means of topic; each subscriber to a subject gets each message published to that subject matter. There is a one-to-many dating between the publishing customer and the subscribing clients.

Q13. Why doesn’t the JMS API provide stop-to-end synchronous message shipping and notification of shipping?

Ans: Some messaging structures offer synchronous delivery to destinations as a mechanism for enforcing reliable programs. Some structures provide customers with numerous sorts of delivery notification in order that the clients can stumble on dropped or not noted messages. This isn't the model described by the JMS API. JMS API messaging gives guaranteed shipping via the once-and-most effective-as soon as transport semantics of PERSISTENT messages. In addition, message customers can insure dependable processing of messages via the use of either CLIENT_ACKNOWLEDGE mode or transacted classes. This achieves dependable transport with minimal synchronization and is the organisation messaging model maximum vendors and builders select. The JMS API does not define a schema of systems messages (together with delivery notifications). If an application calls for acknowledgment of message receipt, it can outline an software-stage acknowledgment message.

Q14. What is the position of JMS in corporation answer improvement?

Ans: JMS is commonly used in the following eventualities

Enterprise Application Integration: - Where a legacy software is incorporated with a new application thru messaging.

B2B or Business to Business: - Businesses can engage with each different via messaging due to the fact JMS allows companies to cooperate without tightly coupling their business structures.

Geographically dispersed units: - JMS can make certain secure exchange of facts among the geographically dispersed gadgets of an organisation.

One to many packages: - The programs that want to push statistics in packet to massive quantity of clients in a one-to-many fashion are exact applicants for the use JMS. Typical such packages are Auction Sites, Stock Quote Services and many others.

Q15. What is the use of Message item?

Ans: Message is a light weight message having only header and residences and no payload. Thus if theIf the receivers are to be notified abt an occasion, and no statistics wishes to be exchanged then the use of Message can be very green.

Q16. Different types of messages available in JMS API.

Ans: The distinct sorts of messages to be had in JMS API are:

StreamMessage,

TextMessage,

BytesMessage,

ObjectMessage,

and MapMessage.

Q17. Can JMS be used to send an electronic mail?

Ans: JMS has no assist for email operations.

Q18. What is using BytesMessage in JMS?

Ans: Byte message is a flow of uninterrupted bytes. It carries an array of primitive bytes in its payload. For the transfer of information between two packages in their local format, byte message is used, which may be now not viable with different message kinds.

Q19. How does the Application server handle the JMS Connection?

Ans:

App server creates the server consultation and shops them in a pool.

Connection client uses the server consultation to place messages inside the consultation of the JMS.

Server session is the one that spawns the JMS consultation.

Applications written by using Application programmers creates the message listener.

Q20. Explain how JMS works with the J2EE?

Ans:

The enterprise JavaBeans components and net components can send or get hold of JMS message asynchronously. In addition, the application clients can also obtain message asynchronously. Using message-driven beans, JMS company can optionally put into effect the processing of messages. Message-driven beans are a form of agency bean that allows the asynchronous consumption of messages.

The operation of sending and receiving message is done as dispensed operation, which allows JMS operations and database accesses inside a unmarried transaction.




CFG