TIBCO EMS .NET API 8.5
TIBCO EMS .NET API 8.5
TIBCO.EMS.TopicSubscriber Class Reference

A client uses a TopicSubscriber object to receive messages that have been published to a topic. More...

Inheritance diagram for TIBCO.EMS.TopicSubscriber:
TIBCO.EMS.MessageConsumer

Properties

Topic Topic [get]
 Gets the Topic associated with this subscriber More...
 
bool NoLocal [get]
 Gets the NoLocal attribute for this subscriber. More...
 
- Properties inherited from TIBCO.EMS.MessageConsumer
string MessageSelector [get]
 Gets this message consumer's message selector expression. More...
 
EMSMessageHandler MessageHandler
 The message event handler for asynchronous message consumption. More...
 
IMessageListener MessageListener [get, set]
 Get and set the asynchronous message listener More...
 

Additional Inherited Members

- Public Member Functions inherited from TIBCO.EMS.MessageConsumer
Message Receive ()
 Receives the next message produced for this message consumer. More...
 
Message Receive (long timeout)
 Receives the next message that arrives within the specified timeout interval. More...
 
Message ReceiveNoWait ()
 Receives the next message if one is immediately available. More...
 
void Close ()
 Closes the message consumer More...
 
override string ToString ()
 return a string representation of the message consumer More...
 

Detailed Description

A client uses a TopicSubscriber object to receive messages that have been published to a topic.

A TopicSubscriber object is the publish/subscribe form of a MessageConsumer. The TopicSubscriber class inherits almost all of its behavior from MessageConsumer and adds the properties, NoLocal and Topic. A MessageConsumer is created by Session.createConsumer.

A TopicSession allows the creation of multiple TopicSubscriber objects per topic. It will deliver each message for a topic to each subscriber eligible to receive it. Each copy of the message is treated as a completely separate message. Work done on one copy has no effect on the others; acknowledging one does not acknowledge the others; one message may be delivered immediately, while another waits for its subscriber to process messages ahead of it.

Regular TopicSubscriber objects are not durable. They receive only messages that are published while they are active.

Messages filtered out by a subscriber's message selector will never be delivered to the subscriber. From the subscriber's perspective, they do not exist.

In some cases, a connection may both publish and subscribe to a topic. The subscriber NoLocal attribute allows a subscriber to inhibit the delivery of messages published by its own connection.

If a client needs to receive all the messages published on a topic, including the ones published while the subscriber is inactive, it uses a durable TopicSubscriber. The EMS Server retains a record of this durable subscription and insures that all messages from the topic's publishers are retained until they are acknowledged by this durable subscriber or they have expired.

Sessions with durable subscribers must always provide the same client identifier. In addition, each client must specify a name that uniquely identifies (within client identifier) each durable subscription it creates. Only one session at a time can have a TopicSubscriber for a particular durable subscription.

A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and a new topic and/or message selector. Changing a durable subscription is equivalent to unsubscribing (deleting) the old one and creating a new one.

The unsubscribe method is used to delete a durable subscription. The unsubscribe method can be used at the Session or TopicSession level. This method deletes the state being maintained on behalf of the subscriber by its provider.

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

Property Documentation

bool TIBCO.EMS.TopicSubscriber.NoLocal
get

Gets the NoLocal attribute for this subscriber.

When NoLocal is true, the subscriber does not receive messages sent through the same server connection (that is, the connection associated with the subscriber).

Programs set this property when creating the subscriber, and cannot subsequently change it.

Returns
true if locally published messages are being inhibited
Topic TIBCO.EMS.TopicSubscriber.Topic
get

Gets the Topic associated with this subscriber

The subscriber consumes messages from this topic.

Programs set this topic property when creating the subscriber and cannot subsequently change it.

Returns
this subscriber's Topic

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