tibemsSession_CreateDurableSubscriber


Function

Purpose

Create a durable topic subscriber.

C Declaration

tibems_status tibemsSession_CreateDurableSubscriber( 
    tibemsSession session, 
    tibemsTopicSubscriber* topicSubscriber, 
    tibemsTopic topic, 
    const char* name, 
    const char* messageSelector, 
    tibems_bool noLocal ); 

COBOL Call

CALL "tibemsSession_CreateDurableSubscriber" 
     USING BY VALUE session, 
           BY REFERENCE topicSubscriber, 
           BY VALUE topic, 
           BY REFERENCE name, 
           BY REFERENCE messageSelector, 
           BY VALUE noLocal, 
           RETURNING tibems-status 
END-CALL. 

session, subscriber and topic have usage pointer.

Parameter
Description
session
Create the topic subscriber in this session.
topicSubscriber
The function stores the new topic subscriber object in this location.
topic
Create a durable subscriber for this topic (which cannot be a tibemsTemporaryTopic).
name
This unique name lets the server associate the subscriber with a subscription.
messageSelector
When non-null, the server filters messages using this selector, so the subscriber receives only matching messages; see Message Selectors.
When null, or the empty string, the subscriber receives messages without filtering.
noLocal
When true, the server filters messages so the subscriber does not receive messages that originate locally—that is, messages sent through the same connection.
When false, the consumer receives messages with local origin.

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:

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 function fails with TIBEMS_INVALID_CONSUMER.

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

Matching Client ID

Changing Topic or Selector

Notice that the server does not use the topic and message selector arguments to match a subscriber to an existing subscription. As a result, client programs can change a subscription by altering either or both of these arguments. 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

tibemsTopic

tibemsTopicSubscriber

tibemsConnection


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