TopicPublisher.Publish


Method

Declaration

virtual void Publish( 
    Topic topic, 
    Message message, 
    MessageDeliveryMode deliveryMode, 
    int priority, 
    long timeToLive ); 
 
virtual void Publish( 
    Message message, 
    MessageDeliveryMode deliveryMode, 
    int priority, 
    long timeToLive ); 
 
virtual void Publish( 
    Topic topic, 
    Message message, 
    int deliveryMode, 
    int priority, 
    long timeToLive ); 
 
virtual void Publish( 
    Message message, 
    int deliveryMode, 
    int priority, 
    long timeToLive ); 
 
virtual void Publish( 
    Topic topic, 
    Message message ); 
 
virtual void Publish( 
    Message message ); 

Purpose

Publish a message to a topic.

Remarks

These methods are parallel to the send methods that TopicPublisher inherits from MessageProducer, and they accomplish the same goal—sending messages.

Parameter
Description
topic
When present, the call sends the message to this topic.
When absent, the call sends the message to the publisher’s default topic. When the publisher does not specify a default, the publish call must supply this parameter.
message
Publish this message.
deliveryMode
When present, the call sends the message with this delivery mode.
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.
When absent, the call sends the message with the publisher’s default delivery mode.
priority
When present, the call sends the message with this priority.
Priority affects the order in which the server delivers messages to consumers (higher values first). The JMS 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.
When absent, the call sends the message with the publisher’s default priority.
timeToLive
When present, the call uses this value (in milliseconds) to compute the message expiration.
  • 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).
  • If the time-to-live is zero, then expiration is also zero—indicating that the message never expires.
When absent, the call uses the publisher’s default value to compute expiration.
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.

See Also

MessageProducer.Send


TIBCO Enterprise Message Service™ .NET Reference
System Release 4.3, February 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com