new MessageProducer()
This method is not meant to be used directly.
Creates a MessageProducer object that sends messages to a
specific Destination.
Method Summary
- close
- Closes the producer.
- getDeliveryMode
- Gets the producer's default delivery mode.
- getDestination
- Gets the destination associated with this {MessageProducer}.
- getPriority
- Gets the producer's default priority.
- getTimeToLive
- Gets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
- send
- Sends a message.
- setDeliveryMode
- Sets the producer's default delivery mode.
- setPriority
- Sets the producer's default priority.
- setTimeToLive
- Sets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
Method Detail
-
close()
-
Closes the producer. Once closed, sending a message will not be possible any more.
-
getDeliveryMode() → {String}
-
Gets the producer's default delivery mode.
Returns:
- Type
- String
-
getDestination() → {Destination}
-
Gets the destination associated with this {MessageProducer}.
Returns:
- Type
- Destination
-
getPriority() → {Number}
-
Gets the producer's default priority.
Returns:
- Type
- Number
-
getTimeToLive() → {Number}
-
Gets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
Returns:
- Type
- Number
-
send(message)
-
Sends a message. Will use MessageProducer's default delivery mode, priority and time to live if message parameters are not set.
Parameters:
Name Type Description message
Message the message to be sent. -
setDeliveryMode(deliveryMode)
-
Sets the producer's default delivery mode.
Parameters:
Name Type Description deliveryMode
String specifies if by default messages must be delivered persistently or not persistently. It can either be "PERSISTENT"
or"NON_PERSISTENT"
. See JMS specifications for more informations. -
setPriority(priority)
-
Sets the producer's default priority.
Parameters:
Name Type Description priority
Number specifies the default level of priority for messages sent with this producer. See JMS specifications for more informations. -
setTimeToLive(timeToLive)
-
Sets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
Parameters:
Name Type Description timeToLive
Number specifies the default time to live for messages sent with this producer. Time to live directly influences message expiration. See JMS specifications for more informations.