Creates a durable subscriber to the specified topic, using a message selector or specifying whether messages published by its own connection should be delivered to it.

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 JMS provider 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 which 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. An inactive durable subscriber is one that exists but does not currently have a message consumer associated with it.

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 subscriber is equivalent to unsubscribing (deleting) the old one and creating a new one.

Namespace:  Kaazing.JMS
Assembly:  Kaazing.JMS (in Kaazing.JMS.dll)

Syntax

Visual Basic
Function CreateDurableSubscriber ( _
	topic As ITopic, _
	name As String, _
	messageSelector As String, _
	noLocal As Boolean _
) As ITopicSubscriber
C#
ITopicSubscriber CreateDurableSubscriber(
	ITopic topic,
	string name,
	string messageSelector,
	bool noLocal
)
Visual C++
ITopicSubscriber^ CreateDurableSubscriber(
	ITopic^ topic, 
	String^ name, 
	String^ messageSelector, 
	bool noLocal
)

Parameters

topic
Type: Kaazing.JMS..::..ITopic
the non-temporary Topic to subscribe to
name
Type: System..::..String
the name used to identify this subscription
messageSelector
Type: System..::..String
only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
noLocal
Type: System..::..Boolean
if set, inhibits the delivery of messages published by its own connection

Implements

ISession..::..CreateDurableSubscriber(ITopic, String, String, Boolean)

Exceptions

ExceptionCondition
Kaazing.JMS..::..JMSExceptionif the session fails to create a subscriber due to some internal error.
Kaazing.JMS..::..InvalidDestinationExceptionif an invalid topic is specified.
Kaazing.JMS..::..InvalidSelectorExceptionif the message selector is invalid.

See Also