IMessageSession Interface

Definition

Describes a Session object. IMessageSession can be used to perform operations on sessions.

public interface IMessageSession : Microsoft.Azure.ServiceBus.Core.IMessageReceiver
type IMessageSession = interface
    interface IMessageReceiver
    interface IReceiverClient
    interface IClientEntity
Public Interface IMessageSession
Implements IMessageReceiver
Implements

Remarks

Service Bus Sessions, also called 'Groups' in the AMQP 1.0 protocol, are unbounded sequences of related messages. ServiceBus guarantees ordering of messages in a session.

Any sender can create a session when submitting messages into a Topic or Queue by setting the SessionId property on Message to some application defined unique identifier. At the AMQP 1.0 protocol level, this value maps to the group-id property.

Sessions come into existence when there is at least one message with the session's SessionId in the Queue or Topic subscription. Once a Session exists, there is no defined moment or gesture for when the session expires or disappears.

Properties

LastPeekedSequenceNumber

Gets the sequence number of the last peeked message.

(Inherited from IMessageReceiver)
LockedUntilUtc

Gets the time that the session identified by SessionId is locked until for this client.

SessionId

Gets the SessionId.

Methods

CompleteAsync(IEnumerable<String>)

Completes a series of Message using a list of lock tokens. This will delete the message from the service.

(Inherited from IMessageReceiver)
DeferAsync(String, IDictionary<String,Object>)

Indicates that the receiver wants to defer the processing for the message.

(Inherited from IMessageReceiver)
GetStateAsync()

Gets the session state.

PeekAsync()

Fetches the next active message without changing the state of the receiver or the message source.

(Inherited from IMessageReceiver)
PeekAsync(Int32)

Fetches the next batch of active messages without changing the state of the receiver or the message source.

(Inherited from IMessageReceiver)
PeekBySequenceNumberAsync(Int64)

Asynchronously reads the next message without changing the state of the receiver or the message source.

(Inherited from IMessageReceiver)
PeekBySequenceNumberAsync(Int64, Int32)

Peeks a batch of messages.

(Inherited from IMessageReceiver)
ReceiveAsync()

Receive a message from the entity defined by Path using ReceiveMode mode.

(Inherited from IMessageReceiver)
ReceiveAsync(Int32)

Receives a maximum of maxMessageCount messages from the entity defined by Path using ReceiveMode mode.

(Inherited from IMessageReceiver)
ReceiveAsync(Int32, TimeSpan)

Receives a maximum of maxMessageCount messages from the entity defined by Path using ReceiveMode mode.

(Inherited from IMessageReceiver)
ReceiveAsync(TimeSpan)

Receive a message from the entity defined by Path using ReceiveMode mode.

(Inherited from IMessageReceiver)
ReceiveDeferredMessageAsync(IEnumerable<Int64>)

Receives a IList<T> of deferred messages identified by sequenceNumbers.

(Inherited from IMessageReceiver)
ReceiveDeferredMessageAsync(Int64)

Receives a specific deferred message identified by sequenceNumber.

(Inherited from IMessageReceiver)
RenewLockAsync(Message)

Renews the lock on the message. The lock will be renewed based on the setting specified on the queue.

(Inherited from IMessageReceiver)
RenewLockAsync(String)

Renews the lock on the message. The lock will be renewed based on the setting specified on the queue. New lock token expiry date and time in UTC format.

(Inherited from IMessageReceiver)
RenewSessionLockAsync()

Renews the lock on the session specified by the SessionId. The lock will be renewed based on the setting specified on the entity.

SetStateAsync(Byte[])

Set a custom state on the session which can be later retrieved using GetStateAsync()

Applies to