[TIBCO.EMS .NET client library 8.1 documentation]

Create a shared non-durable subscription (with the specified name on the specified topic - if one does not already exist), and a consumer on that subscription.

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

Syntax

public MessageConsumer CreateSharedConsumer(
	Topic topic,
	string sharedSubscriptionName
)
Public Function CreateSharedConsumer ( _
	topic As Topic, _
	sharedSubscriptionName As String _
) As MessageConsumer
public:
MessageConsumer^ CreateSharedConsumer(
	Topic^ topic, 
	String^ sharedSubscriptionName
)

Parameters

topic
Type: TIBCO.EMS..::.Topic
the Topic to subscribe to
sharedSubscriptionName
Type: System..::.String
the name used to identify the shared non-durable subscription

Remarks

If a shared non-durable subscription already exists with the same name and client identifier (if set), and the same topic and message selector value has been specified, then this method creates a MessageConsumer on the existing subscription.

A non-durable shared subscription is used by a client which needs to be able to share the work of receiving messages from a topic subscription amongst multiple consumers. A non-durable shared subscription may therefore have more than one consumer. Each message from the subscription will be delivered to only one of the consumers on that subscription. Such a subscription is not persisted and will be deleted (together with any undelivered messages associated with it) when there are no consumers on it. The term "consumer" here means a MessageConsumer on any client.

A shared non-durable subscription is identified by a name specified by the client and by the client identifier (which may be unset). An application which subsequently wishes to create a consumer on that shared non-durable subscription must use the same client identifier.

If a shared non-durable subscription already exists with the same name and client identifier (if set) but a different topic or message selector has been specified, and there is a consumer already active (i.e. not closed) on the subscription, then an EMSException will be thrown.

There is no restriction on durable subscriptions and shared non-durable subscriptions having the same name and clientId (which may be unset). Such subscriptions would be completely separate.

See Also