SALES: 1-800-867-1380
This topic has not yet been rated - Rate this topic

BrokeredMessage.Complete Method

Completes the receive operation of a message and indicates that the message should be marked as processed and deleted.

Namespace:  Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)
public void Complete()
ExceptionCondition
ObjectDisposedException

Thrown when the message is in disposed state or the receiver with which the message was received is in disposed state.

InvalidOperationException

Thrown when invoked on a message that has not been received from the message server or invoked on a message that has not been received in peek-lock mode.

MessagingCommunicationException

Thrown when the queue or subscription that receives the message is no longer present in the message server.

TimeoutException

Thrown when the operation times out. The timeout period is initialized through the MessagingFactorySettings. You may need to increase the value of OperationTimeout to avoid this exception if the timeout value is relatively low.

MessageLockLostException

Thrown if the lock on the message has expired. LockDuration is an entity-wide setting and can be initialized through LockDuration and LockDuration for queues and subscriptions respectively.

SessionLockLostException

Thrown if the lock on the session has expired. The session lock duration is the same as the message LockDuration and is an entity-wide setting. It can be initialized through LockDuration and LockDuration for queues and subscriptions respectively.

ServerBusyException

When service bus service is busy and is unable process the request.

MessagingEntityNotFoundException

When messaging entity the message was received from has been deleted.

UnauthorizedAccessException

When the security token provided by the TokenProvider does not contain the claims to perform this operation.

QuotaExceededException

When the number of concurrent connections to an entity exceed the maximum allowed value.

Complete must only be called on a message that has been received by using a receiver operating in Peek-Lock ReceiveMode. This method is used as a handshake between the receiver and the service bus for a guaranteed delivery of the message. If the receiver failed before calling this method, the message will be kept in the queue.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.