207k views
4 votes
How can you achieve synchronous and asynchronous communication with a JMS connector?

1) By using the send method for synchronous communication and the receive method for asynchronous communication
2) By using the receive method for synchronous communication and the send method for asynchronous communication
3) By using the publish method for synchronous communication and the subscribe method for asynchronous communication
4) By using the subscribe method for synchronous communication and the publish method for asynchronous communication

1 Answer

2 votes

Final answer:

To achieve synchronous communication with a JMS connector, use the receive method, and for asynchronous communication, employ the send method along with message listeners.

Step-by-step explanation:

How you can achieve synchronous and asynchronous communication with a JMS connector relates to the methods employed for message exchange. In JMS, synchronous communication can be achieved by using the receive method, where the client explicitly waits for a message from the server, halting its operation until the message is received or a timeout occurs. Asynchronous communication, on the other hand, is achieved by using the send method along with message listeners. A client sends a message and continues with its process without waiting for a response. Later, when a message arrives, a listener that's been registered with the session is notified and handles the incoming message. Therefore, the correct answer is 1) By using the send method for synchronous communication and the receive method for asynchronous communication.

User Das Kinder
by
9.7k points