Collapse All Expand All

.NET Framework Class Library
Session Class See Also

[TIBCO.EMS .NET client library 5.1 documentation]

Create a durable subscriber to the specified topic

Namespace: TIBCO.EMS
Assembly: TIBCO.EMS (in TIBCO.EMS.dll)

# Syntax

    public TopicSubscriber CreateDurableSubscriber(
    	Topic topic,
    	string name
    )

    Public Function CreateDurableSubscriber ( _
    	topic As Topic, _
    	name As String _
    ) As TopicSubscriber

    public:
    TopicSubscriber^ CreateDurableSubscriber(
    	Topic^ topic,
    	String^ name
    )

#### Parameters

topic
  Type: TIBCO.EMS..::.Topic
  Create a durable subscriber for this topic (which cannot be a TemporaryTopic)

name
  Type: System..::.String
  This unique name lets the server associate the subscriber with a subscription.

# Remarks

The server associates a durable subscription with at most one subscriber object at a time. When a subscriber object exists, the subscription is active, and the server delivers messages to it; when no subscriber object exists, the subscription is inactive.

Durable subscriptions guarantee message delivery across periods during which the subscriber is inactive. The server retains unacknowledged messages until the subscriber acknowledges them, or until the messages expire.

Subscription Continuity

Continuity across inactive periods uses two data items from the client:

- Subscription Name a parameter of this method
- Client ID an optional property of the Connection (used only when supplied)

The server uses one or both of these two items to match a subscriber object with its subscription. If a matching subscription exists, and it is inactive, then the server associates it with the subscriber (and the subscription becomes active). The server delivers unacknowledged messages to the subscriber.

If a matching subscription exists, but it is already active, this method throws EMSException.

If a matching subscription to the topic does not yet exist, the server creates one.

Matching Client ID

If the Connection’s client ID is non-null when a session creates a durable subscription, then only sessions of a connection with the same client ID can attach to that subscription.

If the Connection’s client ID is null when a session creates a durable subscription, then any session can attach to that subscription (to receive its messages).

Changing Topic

Notice that the server does not use the topic argument to match a subscriber to an existing subscription. As a result, client programs can change a subscription by altering the topic. The effect is equivalent to deleting the existing subscription (from the server) and creating a new one (albeit with the same client ID and subscription name).

# See Also

Session Class
CreateDurableSubscriber Overload
TIBCO.EMS Namespace