Adds a rule on the subscription as defined by the given rule name, filter and action.
Note: Remove the default true filter on the subscription before adding a rule. Otherwise, the added rule will have no affect as the true filter will always result in the subscription receiving all messages.
Name of the rule
A Boolean, SQL expression or a Correlation filter. For SQL Filter syntax, see SQLFilter syntax.
Action to perform if the message satisfies the filtering expression. For SQL Rule Action syntax, see SQLRuleAction syntax.
Closes the AMQP link for the receivers created by this client. Once closed, neither the SubscriptionClient nor its receivers can be used for any further operations.
Creates a Receiver for receiving messages from a Subscription which does not have sessions enabled.
An enum indicating the mode in which messages should be received. Possible values are:
ReceiveMode.peekLock
: Once a message is received in this mode, the receiver has a lock on
the message for a particular duration. If the message is not settled by this time, it lands back
on Service Bus to be fetched by the next receive operation.ReceiveMode.receiveAndDelete
: Messages received in this mode get automatically removed from
Service Bus.Receiver A receiver to receive messages from a Subscription which does not have sessions enabled.
Creates a Receiver for receiving messages from a session enabled Subscription. When no sessionId is given, a random session among the available sessions is used.
An enum indicating the mode in which messages should be received. Possible values are:
ReceiveMode.peekLock
: Once a message is received in this mode, the receiver has a lock on
the message for a particular duration. If the message is not settled by this time, it lands back
on Service Bus to be fetched by the next receive operation.ReceiveMode.receiveAndDelete
: Messages received in this mode get automatically removed from
Service Bus.Options to provide sessionId and duration of automatic lock renewal for the session receiver.
SessionReceiver A receiver to receive from a session in the Subscription.
Gets all rules associated with the subscription
Fetches the next batch of active messages (including deferred but not deadlettered messages).
peek()
fetches the first active message. Each subsequent call fetches the
subsequent message.received
message, peeked
message is a read-only version of the message.
It cannot be Completed/Abandoned/Deferred/Deadlettered
. The lock on it cannot be renewed.Promise<ReceivedSBMessage[]>
Peeks the desired number of active messages (including deferred but not deadlettered messages) from the specified sequence number.
received
message, peeked
message is a read-only version of the message.
It cannot be Completed/Abandoned/Deferred/Deadlettered
. The lock on it cannot be renewed.The sequence number from where to read the message.
Promise<ReceivedSBMessage[]>
Removes the rule on the subscription identified by the given rule name.
Caution: If all rules on a subscription are removed, then the subscription will not receive any more messages.
Generated using TypeDoc
Describes the client that allows interacting with a Service Bus Subscription. Use the
createSubscriptionClient
function on the ServiceBusClient object to instantiate a SubscriptionClient