Assembly: TIBCO.EMS.UFO (in TIBCO.EMS.UFO.dll)
Syntax
public MessageConsumer CreateSharedConsumer( Topic topic, string sharedSubscriptionName, string messageSelector ) |
Public Function CreateSharedConsumer ( _ topic As Topic, _ sharedSubscriptionName As String, _ messageSelector As String _ ) As MessageConsumer |
public: MessageConsumer^ CreateSharedConsumer( Topic^ topic, String^ sharedSubscriptionName, String^ messageSelector ) |
Parameters
- topic
- Type: TIBCO.EMS.UFO..::.Topic
the Topic to subscribe to
- sharedSubscriptionName
- Type: System..::.String
the name used to identify the shared non-durable subscription
- messageSelector
- Type: System..::.String
only messages with properties matching the message selector expression are added to the shared non-durable subscription. A value of null or an empty string indicates that there is no message selector for 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.