activemq-cpp-3.6.0
|
A client uses a MessageProducer
object to send messages to a Destination.
More...
#include <src/main/cms/MessageProducer.h>
Public Member Functions | |
virtual | ~MessageProducer () |
virtual void | send (Message *message)=0 |
Sends the message to the default producer destination, but does not take ownership of the message, caller must still destroy it. | |
virtual void | send (Message *message, AsyncCallback *onComplete)=0 |
Sends the message to the default producer destination, but does not take ownership of the message, caller must still destroy it. | |
virtual void | send (Message *message, int deliveryMode, int priority, long long timeToLive)=0 |
Sends the message to the default producer destination, but does not take ownership of the message, caller must still destroy it. | |
virtual void | send (Message *message, int deliveryMode, int priority, long long timeToLive, AsyncCallback *onComplete)=0 |
Sends the message to the default producer destination, but does not take ownership of the message, caller must still destroy it. | |
virtual void | send (const Destination *destination, Message *message)=0 |
Sends the message to the designated destination, but does not take ownership of the message, caller must still destroy it. | |
virtual void | send (const Destination *destination, Message *message, AsyncCallback *onComplete)=0 |
Sends the message to the designated destination, but does not take ownership of the message, caller must still destroy it. | |
virtual void | send (const Destination *destination, Message *message, int deliveryMode, int priority, long long timeToLive)=0 |
Sends the message to the designated destination, but does not take ownership of the message, caller must still destroy it. | |
virtual void | send (const Destination *destination, Message *message, int deliveryMode, int priority, long long timeToLive, AsyncCallback *onComplete)=0 |
Sends the message to the designated destination, but does not take ownership of the message, caller must still destroy it. | |
virtual void | setDeliveryMode (int mode)=0 |
Sets the delivery mode for this Producer. | |
virtual int | getDeliveryMode () const =0 |
Gets the delivery mode for this Producer. | |
virtual void | setDisableMessageID (bool value)=0 |
Sets if Message Ids are disabled for this Producer. | |
virtual bool | getDisableMessageID () const =0 |
Gets if Message Ids are disabled for this Producer. | |
virtual void | setDisableMessageTimeStamp (bool value)=0 |
Sets if Message Time Stamps are disabled for this Producer. | |
virtual bool | getDisableMessageTimeStamp () const =0 |
Gets if Message Time Stamps are disabled for this Producer. | |
virtual void | setPriority (int priority)=0 |
Sets the Priority that this Producers sends messages at. | |
virtual int | getPriority () const =0 |
Gets the Priority level that this producer sends messages at. | |
virtual void | setTimeToLive (long long time)=0 |
Sets the Time to Live that this Producers sends messages with. | |
virtual long long | getTimeToLive () const =0 |
Gets the Time to Live that this producer sends messages with. | |
virtual void | setMessageTransformer (cms::MessageTransformer *transformer)=0 |
Set an MessageTransformer instance that is applied to all cms::Message objects before they are sent on to the CMS bus. | |
virtual cms::MessageTransformer * | getMessageTransformer () const =0 |
Gets the currently configured MessageTransformer for this MessageProducer. | |
![]() | |
virtual | ~Closeable () |
virtual void | close ()=0 |
Closes this object and deallocates the appropriate resources. |
A client uses a MessageProducer
object to send messages to a Destination.
A MessageProducer
object is created by passing a Destination
object to a message-producer creation method supplied by a session.
A client also has the option of creating a message producer without supplying a destination. In this case, a Destination must be provided with every send operation. A typical use for this kind of message producer is to send replies to requests using the request's CMSReplyTo destination.
A client can specify a default delivery mode, priority, and time to live for messages sent by a message producer. It can also specify the delivery mode, priority, and time to live for an individual message.
A client can specify a time-to-live value in milliseconds for each message it sends. This value defines a message expiration time that is the sum of the message's time-to-live and the GMT when it is sent (for transacted sends, this is the time the client sends the message, not the time the transaction is committed).
|
virtual |
|
pure virtual |
Gets the delivery mode for this Producer.
CMSException | - if an internal error occurs. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
Referenced by activemq::cmsutil::CachedProducer::getDeliveryMode().
|
pure virtual |
Gets if Message Ids are disabled for this Producer.
CMSException | - if an internal error occurs. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
Referenced by activemq::cmsutil::CachedProducer::getDisableMessageID().
|
pure virtual |
Gets if Message Time Stamps are disabled for this Producer.
CMSException | - if an internal error occurs. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
Referenced by activemq::cmsutil::CachedProducer::getDisableMessageTimeStamp().
|
pure virtual |
Gets the currently configured MessageTransformer for this MessageProducer.
Implemented in activemq::core::ActiveMQProducer, activemq::core::kernels::ActiveMQProducerKernel, and activemq::cmsutil::CachedProducer.
Referenced by activemq::cmsutil::CachedProducer::getMessageTransformer().
|
pure virtual |
Gets the Priority level that this producer sends messages at.
CMSException | - if an internal error occurs. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
Referenced by activemq::cmsutil::CachedProducer::getPriority().
|
pure virtual |
Gets the Time to Live that this producer sends messages with.
CMSException | - if an internal error occurs. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
Referenced by activemq::cmsutil::CachedProducer::getTimeToLive().
|
pure virtual |
Sends the message to the default producer destination, but does not take ownership of the message, caller must still destroy it.
Uses default values for deliveryMode, priority, and time to live.
message | The message to be sent. |
CMSException | - if an internal error occurs while sending the message. |
MessageFormatException | - if an Invalid Message is given. |
InvalidDestinationException | - if a client uses this method with a MessageProducer with an invalid destination. |
UnsupportedOperationException | - if a client uses this method with a MessageProducer that did not specify a destination at creation time. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
Referenced by activemq::cmsutil::CachedProducer::send().
|
pure virtual |
Sends the message to the default producer destination, but does not take ownership of the message, caller must still destroy it.
Uses default values for deliveryMode, priority, and time to live. If the AsyncCallback parameter is set this method will return immediately and the call-back will be notified once the CMS Provider as acknowledge receipt of the Message or an Error occurs.
message | The message to be sent. |
onComplete | The AsyncCallback instance to notify on send complete or error, caller retains ownership of this pointer and must destroy it only after the send completes or the connection is closed. |
CMSException | - if an internal error occurs while sending the message. |
MessageFormatException | - if an Invalid Message is given. |
InvalidDestinationException | - if a client uses this method with a MessageProducer with an invalid destination. |
UnsupportedOperationException | - if a client uses this method with a MessageProducer that did not specify a destination at creation time. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
|
pure virtual |
Sends the message to the default producer destination, but does not take ownership of the message, caller must still destroy it.
message | The message to be sent. |
deliveryMode | The delivery mode to be used. |
priority | The priority for this message. |
timeToLive | The time to live value for this message in milliseconds. |
CMSException | - if an internal error occurs while sending the message. |
MessageFormatException | - if an Invalid Message is given. |
InvalidDestinationException | - if a client uses this method with a MessageProducer with an invalid destination. |
UnsupportedOperationException | - if a client uses this method with a MessageProducer that did not specify a destination at creation time. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
|
pure virtual |
Sends the message to the default producer destination, but does not take ownership of the message, caller must still destroy it.
If the AsyncCallback parameter is set this method will return immediately and the call-back will be notified once the CMS Provider as acknowledge receipt of the Message or an Error occurs.
message | The message to be sent. |
deliveryMode | The delivery mode to be used. |
priority | The priority for this message. |
timeToLive | The time to live value for this message in milliseconds. |
onComplete | The AsyncCallback instance to notify on send complete or error, caller retains ownership of this pointer and must destroy it only after the send completes or the connection is closed. |
CMSException | - if an internal error occurs while sending the message. |
MessageFormatException | - if an Invalid Message is given. |
InvalidDestinationException | - if a client uses this method with a MessageProducer with an invalid destination. |
UnsupportedOperationException | - if a client uses this method with a MessageProducer that did not specify a destination at creation time. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
|
pure virtual |
Sends the message to the designated destination, but does not take ownership of the message, caller must still destroy it.
Uses default values for deliveryMode, priority, and time to live.
destination | The destination on which to send the message |
message | the message to be sent. |
CMSException | - if an internal error occurs while sending the message. |
MessageFormatException | - if an Invalid Message is given. |
InvalidDestinationException | - if a client uses this method with a MessageProducer with an invalid destination. |
UnsupportedOperationException | - if a client uses this method with a MessageProducer that did not specify a destination at creation time. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
|
pure virtual |
Sends the message to the designated destination, but does not take ownership of the message, caller must still destroy it.
Uses default values for deliveryMode, priority, and time to live. If the AsyncCallback parameter is set this method will return immediately and the call-back will be notified once the CMS Provider as acknowledge receipt of the Message or an Error occurs.
destination | The destination on which to send the message |
message | the message to be sent. |
onComplete | The AsyncCallback instance to notify on send complete or error, caller retains ownership of this pointer and must destroy it only after the send completes or the connection is closed. |
CMSException | - if an internal error occurs while sending the message. |
MessageFormatException | - if an Invalid Message is given. |
InvalidDestinationException | - if a client uses this method with a MessageProducer with an invalid destination. |
UnsupportedOperationException | - if a client uses this method with a MessageProducer that did not specify a destination at creation time. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.
|
pure virtual |
Sends the message to the designated destination, but does not take ownership of the message, caller must still destroy it.
destination | The destination on which to send the message |
message | The message to be sent. |
deliveryMode | The delivery mode to be used. |
priority | The priority for this message. |
timeToLive | The time to live value for this message in milliseconds. |
CMSException | - if an internal error occurs while sending the message. |
MessageFormatException | - if an Invalid Message is given. |
InvalidDestinationException | - if a client uses this method with a MessageProducer with an invalid destination. |
UnsupportedOperationException | - if a client uses this method with a MessageProducer that did not specify a destination at creation time. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.
|
pure virtual |
Sends the message to the designated destination, but does not take ownership of the message, caller must still destroy it.
If the AsyncCallback parameter is set this method will return immediately and the call-back will be notified once the CMS Provider as acknowledge receipt of the Message or an Error occurs.
destination | The destination on which to send the message |
message | The message to be sent. |
deliveryMode | The delivery mode to be used. |
priority | The priority for this message. |
timeToLive | The time to live value for this message in milliseconds. |
onComplete | The AsyncCallback instance to notify on send complete or error, caller retains ownership of this pointer and must destroy it only after the send completes or the connection is closed. |
CMSException | - if an internal error occurs while sending the message. |
MessageFormatException | - if an Invalid Message is given. |
InvalidDestinationException | - if a client uses this method with a MessageProducer with an invalid destination. |
UnsupportedOperationException | - if a client uses this method with a MessageProducer that did not specify a destination at creation time. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.
|
pure virtual |
Sets the delivery mode for this Producer.
mode | The DeliveryMode |
CMSException | - if an internal error occurs. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.
Referenced by activemq::cmsutil::CachedProducer::setDeliveryMode().
|
pure virtual |
Sets if Message Ids are disabled for this Producer.
value | boolean indicating enable / disable (true / false) |
CMSException | - if an internal error occurs. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
Referenced by activemq::cmsutil::CachedProducer::setDisableMessageID().
|
pure virtual |
Sets if Message Time Stamps are disabled for this Producer.
value | - boolean indicating enable / disable (true / false) |
CMSException | - if an internal error occurs. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
Referenced by activemq::cmsutil::CachedProducer::setDisableMessageTimeStamp().
|
pure virtual |
Set an MessageTransformer instance that is applied to all cms::Message objects before they are sent on to the CMS bus.
The CMS code never takes ownership of the MessageTransformer pointer which implies that the client code must ensure that the object remains valid for the lifetime of the CMS object to which the MessageTransformer has been assigned.
transformer | Pointer to the cms::MessageTransformer to apply on each cms:;MessageSend. |
Implemented in activemq::core::ActiveMQProducer, activemq::core::kernels::ActiveMQProducerKernel, and activemq::cmsutil::CachedProducer.
Referenced by activemq::cmsutil::CachedProducer::setMessageTransformer().
|
pure virtual |
Sets the Priority that this Producers sends messages at.
priority | int value for Priority level |
CMSException | - if an internal error occurs. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
Referenced by activemq::cmsutil::CachedProducer::setPriority().
|
pure virtual |
Sets the Time to Live that this Producers sends messages with.
This value will be used if the time to live is not specified via the send method.
time | default time to live value in milliseconds |
CMSException | - if an internal error occurs. |
Implemented in activemq::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.
Referenced by activemq::cmsutil::CachedProducer::setTimeToLive().