TIBCO EMS .NET API 10.2
TIBCO EMS .NET API 10.2
TIBCO.EMS.TopicPublisher Class Reference

A client uses a TopicPublisher object to publish messages on a topic. A TopicPublisher object is the publish-subscribe form of a message producer. More...

Inheritance diagram for TIBCO.EMS.TopicPublisher:
TIBCO.EMS.MessageProducer

Public Member Functions

void Publish (Message message)
 Publishes a message to the topic. Uses the TopicPublisher's default delivery mode, priority, and time to live. More...
 
void Publish (Message message, int deliveryMode, int priority, long timeToLive)
 Publishes a message to the topic, specifying delivery mode, priority, and time to live. More...
 
void Publish (Message message, MessageDeliveryMode deliveryMode, int priority, long timeToLive)
 Publishes a message to the topic, specifying delivery mode, priority, and time to live. More...
 
void Publish (Topic topic, Message message)
 Publishes a message to a topic for an unidentified message producer. Uses the TopicPublisher's default delivery mode, priority, and time to live. More...
 
void Publish (Topic topic, Message message, int deliveryMode, int priority, long timeToLive)
 Publishes a message to a topic for an unidentified message producer, specifying delivery mode, priority and time to live. More...
 
void Publish (Topic topic, Message message, MessageDeliveryMode deliveryMode, int priority, long timeToLive)
 Publishes a message to a topic for an unidentified message producer, specifying delivery mode, priority and time to live. More...
 
- Public Member Functions inherited from TIBCO.EMS.MessageProducer
virtual void Send (Destination dest, Message message)
 Sends a message to a destination for an unidentified message producer. Uses the MessageProducer's default delivery mode, priority, and time to live. More...
 
virtual void Send (Destination dest, Message message, ICompletionListener completionListener)
 Asynchronously sends a message to a destination for an unidentified message producer. Uses the MessageProducer's default delivery mode, priority, and time to live. More...
 
virtual void Send (Destination dest, Message message, int deliveryMode, int priority, long timeToLive)
 Sends a message to a destination for an unidentified message producer, specifying delivery mode, priority and time to live. More...
 
virtual void Send (Destination dest, Message message, int deliveryMode, int priority, long timeToLive, ICompletionListener completionListener)
 Asynchronously sends a message to a destination for an unidentified message producer, specifying delivery mode, priority and time to live. More...
 
virtual void Send (Destination dest, Message message, MessageDeliveryMode deliveryMode, int priority, long timeToLive)
 Sends a message to a destination for an unidentified message producer, specifying delivery mode, priority and time to live. More...
 
virtual void Send (Destination dest, Message message, MessageDeliveryMode deliveryMode, int priority, long timeToLive, ICompletionListener completionListener)
 Asynchronously sends a message to a destination for an unidentified message producer, specifying delivery mode, priority and time to live. More...
 
virtual void Send (Message message)
 Sends a message using the MessageProducer's default delivery mode, priority, and time to live. More...
 
virtual void Send (Message message, ICompletionListener completionListener)
 Asynchronously sends a message using the MessageProducer's default delivery mode, priority, and time to live. More...
 
virtual void Send (Message message, int deliveryMode, int priority, long timeToLive)
 Sends a message to the destination, specifying delivery mode, priority, and time to live. More...
 
virtual void Send (Message message, int deliveryMode, int priority, long timeToLive, ICompletionListener completionListener)
 Asynchronously sends a message to the destination, specifying delivery mode, priority, and time to live. More...
 
virtual void Send (Message message, MessageDeliveryMode deliveryMode, int priority, long timeToLive)
 Sends a message to the destination, specifying delivery mode, priority, and time to live. More...
 
virtual void Send (Message message, MessageDeliveryMode deliveryMode, int priority, long timeToLive, ICompletionListener completionListener)
 Asynchronously sends a message to the destination, specifying delivery mode, priority, and time to live. More...
 
void Close ()
 Closes the message producer. More...
 
override string ToString ()
 returns a string representaion of the message producer More...
 

Properties

Topic Topic [get]
 Gets the topic associated with this TopicPublisher. More...
 
- Properties inherited from TIBCO.EMS.MessageProducer
Destination Destination [get]
 Gets the destination associated with this MessageProducer. More...
 
bool DisableMessageID [get, set]
 Get and Sets the disable message id flag More...
 
bool DisableMessageTimestamp [get, set]
 Get and Sets the disable message timestamp flag More...
 
int DeliveryMode [get, set]
 Get and set the delivery mode using integer value, as defined in DeliveryMode class More...
 
MessageDeliveryMode MsgDeliveryMode [get, set]
 Get and set the delivery mode using one of the enum MessageDeliveryMode value. More...
 
int Priority [get, set]
 Gets and Sets the priority of the message producer. More...
 
long TimeToLive [get, set]
 Gets and Sets the time to live property of the message producer. More...
 
long DeliveryDelay [get, set]
 Gets and Sets the delivery delay property of the message producer. More...
 

Detailed Description

A client uses a TopicPublisher object to publish messages on a topic. A TopicPublisher object is the publish-subscribe form of a message producer.

This class extends MessageProducer. It overloads more send methods, specializing the destination parameter to a queue.

Normally, the Topic is specified when a TopicPublisher is created. In this case, an attempt to use the publish methods for an unidentified TopicPublisher will throw a UnsupportedOperationException.

If the TopicPublisher is created with an unidentified Topic, an attempt to use the publish methods that assume that the Topic has been identified will throw a UnsupportedOperationException.

During the execution of its publish method, a message must not be changed by other threads within the client. If the message is modified, the result of the publish is undefined.

After publishing a message, a client may retain and modify it without affecting the message that has been published. The same message object may be published multiple times.

The following message headers are set as part of publishing a message: Destination, DeliveryMode, Expiration, Priority, MessageID and TimeStamp. When the message is published, the values of these headers are ignored. After completion of the publish, the headers hold the values specified by the method publishing the message. It is possible for the publish method to not set the MessageID and TimeStamp if they are explicitly disabled by setting the MessageProducer.DisableMessageID or MessageProducer.DisableMessageTimestamp property.

Creating a MessageProducer provides the same features as creating a TopicPublisher. A MessageProducer object is recommended when creating new code. The TopicPublisher is provided to support existing code. Because TopicPublisher inherits from MessageProducer, it inherits the send methods that are a part of the MessageProducer interface. Using the send methods will have the same effect as using the publish methods: they are functionally the same

Note: This class is provided for backward compatibility to support older EMS clients programs. New clients should use the MessageProducer class instead.

Member Function Documentation

void TIBCO.EMS.TopicPublisher.Publish ( Message  message)
inline

Publishes a message to the topic. Uses the TopicPublisher's default delivery mode, priority, and time to live.

Parameters
messageThe message to publish.
void TIBCO.EMS.TopicPublisher.Publish ( Message  message,
int  deliveryMode,
int  priority,
long  timeToLive 
)
inline

Publishes a message to the topic, specifying delivery mode, priority, and time to live.

Parameters
messageThe message to publish.
deliveryModeThe delivery mode to use. This argument may be either an enumerated value (see MessageDeliveryMode) or an integer (see DeliveryMode). We recommend enumerated values, because they enable .NET to do stronger type checking at compile time, which can enhance program reliability.
priorityThe priority for this message. Priority affects the order in which the server delivers messages to consumers (higher values first). The Jakarta Messaging specification defines ten levels of priority value, from zero (lowest priority) to 9 (highest priority). The specification suggests that clients consider 0-4 as gradations of normal priority, and priorities 5-9 as gradations of expedited priority.
timeToLiveThe message's lifetime (in milliseconds) before it expires.
  • If the time-to-live is non-zero, the expiration is the sum of that time-to-live and the sending client's current time (GMT). This rule applies even within sessions with transaction semantics - the timer begins with the send call, not the commit call.
  • If the time-to-live is zero, then expiration is also zero - indicating that the message never expires.

Programs can use this property to define a default time-to-live for messages that this producer sends. Individual sending calls can override this default value.

Whenever your application uses non-zero values for message expiration or time-to-live, you must ensure that clocks are synchronized among all the host computers that send and receive messages. Synchronize clocks to a tolerance that is a very small fraction of the smallest or time-to-live.

void TIBCO.EMS.TopicPublisher.Publish ( Message  message,
MessageDeliveryMode  deliveryMode,
int  priority,
long  timeToLive 
)
inline

Publishes a message to the topic, specifying delivery mode, priority, and time to live.

Parameters
messageThe message to publish.
deliveryModeThe delivery mode to use. This argument may be either an enumerated value (see MessageDeliveryMode) or an integer (see DeliveryMode). We recommend enumerated values, because they enable .NET to do stronger type checking at compile time, which can enhance program reliability.
priorityThe priority for this message. Priority affects the order in which the server delivers messages to consumers (higher values first). The Jakarta Messaging specification defines ten levels of priority value, from zero (lowest priority) to 9 (highest priority). The specification suggests that clients consider 0-4 as gradations of normal priority, and priorities 5-9 as gradations of expedited priority.
timeToLiveThe message's lifetime (in milliseconds) before it expires.
  • If the time-to-live is non-zero, the expiration is the sum of that time-to-live and the sending client's current time (GMT). This rule applies even within sessions with transaction semantics - the timer begins with the send call, not the commit call.
  • If the time-to-live is zero, then expiration is also zero - indicating that the message never expires.

Programs can use this property to define a default time-to-live for messages that this producer sends. Individual sending calls can override this default value.

Whenever your application uses non-zero values for message expiration or time-to-live, you must ensure that clocks are synchronized among all the host computers that send and receive messages. Synchronize clocks to a tolerance that is a very small fraction of the smallest or time-to-live.

void TIBCO.EMS.TopicPublisher.Publish ( Topic  topic,
Message  message 
)
inline

Publishes a message to a topic for an unidentified message producer. Uses the TopicPublisher's default delivery mode, priority, and time to live.

Typically, a message producer is assigned a topic at creation time; however, the TIBCO EME .NET API also supports unidentified message producers, which require that the topic be supplied every time a message is published.

Parameters
topicThe Topic to which this message is to be published.
messageThe message to publish.
void TIBCO.EMS.TopicPublisher.Publish ( Topic  topic,
Message  message,
int  deliveryMode,
int  priority,
long  timeToLive 
)
inline

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

Typically, a message producer is assigned a topic at creation time; however, the TIBCO EME .NET API also supports unidentified message producers, which require that the topic be supplied every time a message is published.

Parameters
topicThe Topic to which this message is to be published
messageThe message to publish.
deliveryModeThe delivery mode to use. This argument may be either an enumerated value (see MessageDeliveryMode) or an integer (see DeliveryMode). We recommend enumerated values, because they enable .NET to do stronger type checking at compile time, which can enhance program reliability.
priorityThe priority for this message. Priority affects the order in which the server delivers messages to consumers (higher values first). The Jakarta Messaging specification defines ten levels of priority value, from zero (lowest priority) to 9 (highest priority). The specification suggests that clients consider 0-4 as gradations of normal priority, and priorities 5-9 as gradations of expedited priority.
timeToLiveThe message's lifetime (in milliseconds) before it expires.
  • If the time-to-live is non-zero, the expiration is the sum of that time-to-live and the sending client's current time (GMT). This rule applies even within sessions with transaction semantics - the timer begins with the send call, not the commit call.
  • If the time-to-live is zero, then expiration is also zero - indicating that the message never expires.

Programs can use this property to define a default time-to-live for messages that this producer sends. Individual sending calls can override this default value.

Whenever your application uses non-zero values for message expiration or time-to-live, you must ensure that clocks are synchronized among all the host computers that send and receive messages. Synchronize clocks to a tolerance that is a very small fraction of the smallest or time-to-live.

void TIBCO.EMS.TopicPublisher.Publish ( Topic  topic,
Message  message,
MessageDeliveryMode  deliveryMode,
int  priority,
long  timeToLive 
)
inline

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

Typically, a message producer is assigned a topic at creation time; however, the TIBCO EME .NET API also supports unidentified message producers, which require that the topic be supplied every time a message is published.

Parameters
topicThe Topic to which this message is to be published
messageThe message to publish.
deliveryModeThe delivery mode to use. This argument may be either an enumerated value (see MessageDeliveryMode) or an integer (see DeliveryMode). We recommend enumerated values, because they enable .NET to do stronger type checking at compile time, which can enhance program reliability.
priorityThe priority for this message. Priority affects the order in which the server delivers messages to consumers (higher values first). The Jakarta Messaging specification defines ten levels of priority value, from zero (lowest priority) to 9 (highest priority). The specification suggests that clients consider 0-4 as gradations of normal priority, and priorities 5-9 as gradations of expedited priority.
timeToLiveThe message's lifetime (in milliseconds) before it expires.
  • If the time-to-live is non-zero, the expiration is the sum of that time-to-live and the sending client's current time (GMT). This rule applies even within sessions with transaction semantics - the timer begins with the send call, not the commit call.
  • If the time-to-live is zero, then expiration is also zero - indicating that the message never expires.

Programs can use this property to define a default time-to-live for messages that this producer sends. Individual sending calls can override this default value.

Whenever your application uses non-zero values for message expiration or time-to-live, you must ensure that clocks are synchronized among all the host computers that send and receive messages. Synchronize clocks to a tolerance that is a very small fraction of the smallest or time-to-live.

Property Documentation

Topic TIBCO.EMS.TopicPublisher.Topic
get

Gets the topic associated with this TopicPublisher.

Each send call directs a message to a topic.

A client can use this property to define a default topic for messages that this publisher sends. Individual sending calls can override this default value.

A client sets this topic when creating the publisher, and cannot subsequently change it.

Returns
this publisher's topic

Copyright © Cloud Software Group, Inc. All rights reserved.