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.
- getDeliveryDelay
- Gets the minimum length of time in milliseconds that must elapse after a message is sent before the JMS provider may deliver the message to a consumer.
- 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.
- setDeliveryDelay
- Sets the minimum length of time in milliseconds that must elapse after a message is sent before the JMS provider may deliver the message to a consumer.
- 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.
-
getDeliveryDelay() → {Number}
-
Gets the minimum length of time in milliseconds that must elapse after a message is sent before the JMS provider may deliver the message to a consumer.
Returns:
- Type
- Number
-
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, destination, completionListener)
-
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. destination
Destination the destination the message is to be sent to. completionListener
CompletionListener an optional CompletionListener to be notified when the send has completed. -
setDeliveryDelay(deliveryDelay)
-
Sets the minimum length of time in milliseconds that must elapse after a message is sent before the JMS provider may deliver the message to a consumer.
Parameters:
Name Type Description deliveryDelay
Number the delivery delay in milliseconds. -
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 information. -
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 information. -
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 information.