The client includes the following code snippet:

You are writing a client that sends a message to a JMS queue. The client includes the following
code snippet:

You are writing a client that sends a message to a JMS queue. The client includes the following
code snippet:

A.
The message can be consumed by durable subscriber.

B.
In the first line, the argument to the createProducer method needs to be cast to a Destination.

C.
The message is sent using non-default deliver mode, priority, and expiration time values.

D.
You could add more name-value pairs to the message body of the MapMessage if they were
required by your application.

Explanation:
createMapMessage
MapMessage createMapMessage()
throws JMSException
Creates a MapMessage object. A MapMessage object is used to send a self-defining set of namevalue pairs, where names are String objects and values are primitive values in the Java
programming language.
Reference: javax.jms,Interface Session



Leave a Reply 3

Your email address will not be published. Required fields are marked *


Tamer Saleh

Tamer Saleh

C,D, the default delivery mode is persistence