Habari STOMP Client for OpenMQ 9.0
Object Pascal STOMP client library for OpenMQ
Loading...
Searching...
No Matches
TBTMessageProducer Class Reference

A client uses a IMessageProducer object to send messages to a destination. More...

Inheritance diagram for TBTMessageProducer:
IMessageProducer TBTMessageProducerSupport

Public Member Functions

 TBTMessageProducer (const TBTSession Session, const IDestination Destination, const Integer SendTimeOut)
 Create MessageProducer.
 
 Close ()
 Closes the message producer.
 
 Dispose ()
 
 Send (const IDestination Destination, const IMessage Message)
 Sends a message to a destination for an unidentified message producer.
 
 Send (const IMessage Message)
 Sends a message using the MessageProducer's default delivery mode, priority, and time to live.
 
 Send (const IMessage Message, const TJMSDeliveryMode DeliveryMode, const Integer Priority, const Integer TimeToLive)
 Sends a message to the destination, specifying delivery mode, priority, and time to live.
 
 Send (const IDestination Destination, const IMessage Message, const TJMSDeliveryMode DeliveryMode, const Integer Priority, const Integer TimeToLive)
 Sends a message to a destination for an unidentified message producer, specifying delivery mode, priority and time to live.
 
- Public Member Functions inherited from TBTMessageProducerSupport
 TBTMessageProducerSupport (const TBTSession Session)
 

Public Attributes

IDestination Destination
 The destination associated with this MessageProducer.
 
- Public Attributes inherited from TBTMessageProducerSupport
Integer Priority
 The producer's default priority.
 
Cardinal TimeToLive
 The default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
 
TJMSDeliveryMode DeliveryMode
 The producer's default delivery mode.
 

Protected Member Functions

 CheckClosed ()
 Check if the instance of this producer has been closed.
 
- Protected Member Functions inherited from TBTMessageProducerSupport
 CheckClosed ()
 
 SetTimeToLive (const Cardinal Value)
 
Cardinal GetTimeToLive ()
 
 SetPriority (const Integer Value)
 
Integer GetPriority ()
 
 SetDeliveryMode (const TJMSDeliveryMode Value)
 
TJMSDeliveryMode GetDeliveryMode ()
 

Additional Inherited Members

- Protected Attributes inherited from TBTMessageProducerSupport
Cardinal FDefaultTimeToLive
 
Integer FDefaultPriority
 
TJMSDeliveryMode FDefaultDeliveryMode
 
TBTSession Session
 

Detailed Description

A client uses a IMessageProducer object to send messages to a destination.

A IMessageProducer object is created by passing a IDestination object to a message-producer creation method supplied by a session.

MessageProducer is the parent interface for all message producers.

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 JMSReplyTo 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).

Constructor & Destructor Documentation

◆ TBTMessageProducer()

TBTMessageProducer::TBTMessageProducer ( const TBTSession Session,
const IDestination Destination,
const Integer SendTimeOut )

Create MessageProducer.

Member Function Documentation

◆ CheckClosed()

TBTMessageProducer::CheckClosed ( )
protected

Check if the instance of this producer has been closed.

Exceptions
IllegalStateException

◆ Close()

TBTMessageProducer::Close ( )

Closes the message producer.

Exceptions
EMQExceptionif the provider fails to close the producer due to some internal error.

◆ Dispose()

TBTMessageProducer::Dispose ( )

◆ Send() [1/4]

TBTMessageProducer::Send ( const IDestination Destination,
const IMessage Message )

Sends a message to a destination for an unidentified message producer.

Uses the MessageProducer's default delivery mode, priority, and time to live.

Typically, a message producer is assigned a destination at creation time; however, the JMS API also supports unidentified message producers, which require that the destination be supplied every time a message is sent.

Parameters
Destinationthe destination to send this message to
Messagethe message to send
Exceptions
EMQExceptionif the JMS provider fails to send the message due to some internal error.

◆ Send() [2/4]

TBTMessageProducer::Send ( const IDestination Destination,
const IMessage Message,
const TJMSDeliveryMode DeliveryMode,
const Integer Priority,
const Integer TimeToLive )

Sends a message to a destination for an unidentified message producer, specifying delivery mode, priority and time to live.

Typically, a message producer is assigned a destination at creation time; however, the JMS API also supports unidentified message producers, which require that the destination be supplied every time a message is sent.

Parameters
Destinationthe destination to send this message to
Messagethe message to send
DeliveryModethe delivery mode to use
Prioritythe priority for this message
TimeToLivethe message's lifetime (in milliseconds)
Exceptions
EMQExceptionif the JMS provider fails to send the message due to some internal error.

◆ Send() [3/4]

TBTMessageProducer::Send ( const IMessage Message)

Sends a message using the MessageProducer's default delivery mode, priority, and time to live.

Parameters
Messagethe message to send
Exceptions
EMQExceptionif the JMS provider fails to send the message due to some internal error.

◆ Send() [4/4]

TBTMessageProducer::Send ( const IMessage Message,
const TJMSDeliveryMode DeliveryMode,
const Integer Priority,
const Integer TimeToLive )

Sends a message to the destination, specifying delivery mode, priority, and time to live.

Parameters
Messagethe message to send
DeliveryModethe delivery mode to use
Prioritythe priority for this message
TimeToLivethe message's lifetime (in milliseconds)
Exceptions
EMQExceptionif the JMS provider fails to send the message due to some internal error.

Member Data Documentation

◆ Destination

IDestination TBTMessageProducer::Destination

The destination associated with this MessageProducer.

See also
GetDestination For reading