IMessageAndSessionPump Interface

public interface IMessageAndSessionPump

Represents the pump which is underneath the clients that handles message processing.

Method Summary

Modifier and Type Method and Description
abstract void abandon(UUID lockToken)

Abandon Message with lock token.

abstract void abandon(UUID lockToken, TransactionContext transaction)

Abandon Message with lock token.

abstract void abandon(UUID lockToken, Map<String,Object> propertiesToModify)

Abandon Message with lock token and updated message property.

abstract void abandon(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)

Abandon Message with lock token and updated message property.

abstract CompletableFuture<Void> abandonAsync(UUID lockToken)

Asynchronously abandon Message with lock token.

abstract CompletableFuture<Void> abandonAsync(UUID lockToken, TransactionContext transaction)

Asynchronously abandon Message with lock token.

abstract CompletableFuture<Void> abandonAsync(UUID lockToken, Map<String,Object> propertiesToModify)

Asynchronously abandon Message with lock token and updated message property.

abstract CompletableFuture<Void> abandonAsync(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)

Asynchronously abandon Message with lock token and updated message property.

abstract void complete(UUID lockToken)

Completes a Message using its lock token.

abstract void complete(UUID lockToken, TransactionContext transaction)

Completes a Message using its lock token.

abstract CompletableFuture<Void> completeAsync(UUID lockToken)

Asynchronously completes a Message using its lock token.

abstract CompletableFuture<Void> completeAsync(UUID lockToken, TransactionContext transaction)

Asynchronously completes a Message using its lock token.

abstract void deadLetter(UUID lockToken)

Moves a Message to the deadletter sub-queue.

abstract void deadLetter(UUID lockToken, TransactionContext transaction)

Moves a Message to the deadletter sub-queue.

abstract void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)

Moves a Message to the deadletter sub-queue with deadletter reason and error description.

abstract void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)

Moves a Message to the deadletter sub-queue with deadletter reason and error description.

abstract void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify)

Moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.

abstract void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify, TransactionContext transaction)

Moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.

abstract void deadLetter(UUID lockToken, Map<String,Object> propertiesToModify)

Moves a Message to the deadletter sub-queue with modified message properties.

abstract void deadLetter(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)

Moves a Message to the deadletter sub-queue with modified message properties.

abstract CompletableFuture<Void> deadLetterAsync(UUID lockToken)

Asynchronously moves a Message to the deadletter sub-queue with deadletter.

abstract CompletableFuture<Void> deadLetterAsync(UUID lockToken, TransactionContext transaction)

Asynchronously moves a Message to the deadletter sub-queue with deadletter.

abstract CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)

Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description.

abstract CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)

Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description.

abstract CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify)

Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.

abstract CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify, TransactionContext transaction)

Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.

abstract CompletableFuture<Void> deadLetterAsync(UUID lockToken, Map<String,Object> propertiesToModify)

Asynchronously moves a Message to the deadletter sub-queue with modified properties.

abstract CompletableFuture<Void> deadLetterAsync(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)

Asynchronously moves a Message to the deadletter sub-queue with modified properties.

abstract int getPrefetchCount()

Get the prefetch value set.

abstract void registerMessageHandler(IMessageHandler handler)

Deprecated

Receive messages continuously from the entity.

abstract void registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions)

Receive messages continuously from the entity.

abstract void registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions, ExecutorService executorService)

Receive messages continuously from the entity.

abstract void registerMessageHandler(IMessageHandler handler, ExecutorService executorService)

Receive messages continuously from the entity.

abstract void registerSessionHandler(ISessionHandler handler)

Receive session messages continuously from the queue.

abstract void registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions)

Receive session messages continuously from the queue.

abstract void registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions, ExecutorService executorService)

Receive session messages continuously from the queue.

abstract void registerSessionHandler(ISessionHandler handler, ExecutorService executorService)

Receive session messages continuously from the queue.

abstract void setPrefetchCount(int prefetchCount)

Set the prefetch count of the receiver.

Method Details

abandon

public abstract void abandon(UUID lockToken)

Abandon Message with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message

Parameters:

lockToken - Message lock token getLockToken()

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

abandon

public abstract void abandon(UUID lockToken, TransactionContext transaction)

Abandon Message with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message

Parameters:

lockToken - Message lock token getLockToken()
transaction - TransactionContext which this operation should enlist to.

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

abandon

public abstract void abandon(UUID lockToken, Map propertiesToModify)

Abandon Message with lock token and updated message property. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message

Parameters:

lockToken - Message lock token getLockToken()
propertiesToModify - Message properties to modify.

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

abandon

public abstract void abandon(UUID lockToken, Map propertiesToModify, TransactionContext transaction)

Abandon Message with lock token and updated message property. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message

Parameters:

lockToken - Message lock token getLockToken()
propertiesToModify - Message properties to modify.
transaction - TransactionContext which this operation should enlist to.

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

abandonAsync

public abstract CompletableFuture abandonAsync(UUID lockToken)

Asynchronously abandon Message with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.

Parameters:

lockToken - Message lock token getLockToken()

Returns:

a CompletableFuture representing the pending abandon.

abandonAsync

public abstract CompletableFuture abandonAsync(UUID lockToken, TransactionContext transaction)

Asynchronously abandon Message with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.

Parameters:

lockToken - Message lock token getLockToken()
transaction - TransactionContext which this operation should enlist to.

Returns:

a CompletableFuture representing the pending abandon.

abandonAsync

public abstract CompletableFuture abandonAsync(UUID lockToken, Map propertiesToModify)

Asynchronously abandon Message with lock token and updated message property. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.

Parameters:

lockToken - Message lock token getLockToken()
propertiesToModify - Message properties to modify.

Returns:

a CompletableFuture representing the pending abandon.

abandonAsync

public abstract CompletableFuture abandonAsync(UUID lockToken, Map propertiesToModify, TransactionContext transaction)

Asynchronously abandon Message with lock token and updated message property. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.

Parameters:

lockToken - Message lock token getLockToken()
propertiesToModify - Message properties to modify.
transaction - TransactionContext which this operation should enlist to.

Returns:

a CompletableFuture representing the pending abandon.

complete

public abstract void complete(UUID lockToken)

Completes a Message using its lock token. This will delete the message from the service.

Parameters:

lockToken - Message lock token getLockToken()

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

complete

public abstract void complete(UUID lockToken, TransactionContext transaction)

Completes a Message using its lock token. This will delete the message from the service.

Parameters:

lockToken - Message lock token getLockToken()
transaction - TransactionContext which this operation should enlist to.

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

completeAsync

public abstract CompletableFuture completeAsync(UUID lockToken)

Asynchronously completes a Message using its lock token. This will delete the message from the service.

Parameters:

lockToken - Message lock token getLockToken()

Returns:

a CompletableFuture representing the pending complete.

completeAsync

public abstract CompletableFuture completeAsync(UUID lockToken, TransactionContext transaction)

Asynchronously completes a Message using its lock token. This will delete the message from the service.

Parameters:

lockToken - Message lock token getLockToken()
transaction - TransactionContext which this operation should enlist to.

Returns:

a CompletableFuture representing the pending complete.

deadLetter

public abstract void deadLetter(UUID lockToken)

Moves a Message to the deadletter sub-queue.

Parameters:

lockToken - Message lock token getLockToken()

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

deadLetter

public abstract void deadLetter(UUID lockToken, TransactionContext transaction)

Moves a Message to the deadletter sub-queue.

Parameters:

lockToken - Message lock token getLockToken()
transaction - TransactionContext which this operation should enlist to.

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

deadLetter

public abstract void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)

Moves a Message to the deadletter sub-queue with deadletter reason and error description.

Parameters:

lockToken - Message lock token getLockToken()
deadLetterReason - The deadletter reason.
deadLetterErrorDescription - The deadletter error description.

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

deadLetter

public abstract void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)

Moves a Message to the deadletter sub-queue with deadletter reason and error description.

Parameters:

lockToken - Message lock token getLockToken()
deadLetterReason - The deadletter reason.
deadLetterErrorDescription - The deadletter error description.
transaction - TransactionContext which this operation should enlist to.

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

deadLetter

public abstract void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map propertiesToModify)

Moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.

Parameters:

lockToken - Message lock token getLockToken()
deadLetterReason - The deadletter reason.
deadLetterErrorDescription - The deadletter error description.
propertiesToModify - Message properties to modify.

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

deadLetter

public abstract void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map propertiesToModify, TransactionContext transaction)

Moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.

Parameters:

lockToken - Message lock token getLockToken()
deadLetterReason - The deadletter reason.
deadLetterErrorDescription - The deadletter error description.
propertiesToModify - Message properties to modify.
transaction - TransactionContext which this operation should enlist to.

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

deadLetter

public abstract void deadLetter(UUID lockToken, Map propertiesToModify)

Moves a Message to the deadletter sub-queue with modified message properties.

Parameters:

lockToken - Message lock token getLockToken()
propertiesToModify - Message properties to modify.

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

deadLetter

public abstract void deadLetter(UUID lockToken, Map propertiesToModify, TransactionContext transaction)

Moves a Message to the deadletter sub-queue with modified message properties.

Parameters:

lockToken - Message lock token getLockToken()
propertiesToModify - Message properties to modify.
transaction - TransactionContext which this operation should enlist to.

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

deadLetterAsync

public abstract CompletableFuture deadLetterAsync(UUID lockToken)

Asynchronously moves a Message to the deadletter sub-queue with deadletter.

Parameters:

lockToken - Message lock token getLockToken()

Returns:

a CompletableFuture representing the pending deadletter.

deadLetterAsync

public abstract CompletableFuture deadLetterAsync(UUID lockToken, TransactionContext transaction)

Asynchronously moves a Message to the deadletter sub-queue with deadletter.

Parameters:

lockToken - Message lock token getLockToken()
transaction - TransactionContext which this operation should enlist to.

Returns:

a CompletableFuture representing the pending deadletter.

deadLetterAsync

public abstract CompletableFuture deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)

Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description.

Parameters:

lockToken - Message lock token getLockToken()
deadLetterReason - The deadletter reason.
deadLetterErrorDescription - The deadletter error description.

Returns:

a CompletableFuture representing the pending deadletter.

deadLetterAsync

public abstract CompletableFuture deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)

Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description.

Parameters:

lockToken - Message lock token getLockToken()
deadLetterReason - The deadletter reason.
deadLetterErrorDescription - The deadletter error description.
transaction - TransactionContext which this operation should enlist to.

Returns:

a CompletableFuture representing the pending deadletter.

deadLetterAsync

public abstract CompletableFuture deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map propertiesToModify)

Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.

Parameters:

lockToken - Message lock token getLockToken()
deadLetterReason - The deadletter reason.
deadLetterErrorDescription - The deadletter error description.
propertiesToModify - Message properties to modify.

Returns:

a CompletableFuture representing the pending deadletter.

deadLetterAsync

public abstract CompletableFuture deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map propertiesToModify, TransactionContext transaction)

Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.

Parameters:

lockToken - Message lock token getLockToken()
deadLetterReason - The deadletter reason.
deadLetterErrorDescription - The deadletter error description.
propertiesToModify - Message properties to modify.
transaction - TransactionContext which this operation should enlist to.

Returns:

a CompletableFuture representing the pending deadletter.

deadLetterAsync

public abstract CompletableFuture deadLetterAsync(UUID lockToken, Map propertiesToModify)

Asynchronously moves a Message to the deadletter sub-queue with modified properties.

Parameters:

lockToken - Message lock token getLockToken()
propertiesToModify - Message properties to modify.

Returns:

a CompletableFuture representing the pending deadletter.

deadLetterAsync

public abstract CompletableFuture deadLetterAsync(UUID lockToken, Map propertiesToModify, TransactionContext transaction)

Asynchronously moves a Message to the deadletter sub-queue with modified properties.

Parameters:

lockToken - Message lock token getLockToken()
propertiesToModify - Message properties to modify.
transaction - TransactionContext which this operation should enlist to.

Returns:

a CompletableFuture representing the pending deadletter.

getPrefetchCount

public abstract int getPrefetchCount()

Get the prefetch value set.

Returns:

The set prefetch count value.

registerMessageHandler

@Deprecated
public abstract void registerMessageHandler(IMessageHandler handler)

Deprecated

Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. IMessageHandler methods are executed on java.util.concurrent.commonPool()

Parameters:

handler - The IMessageHandler instance

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

registerMessageHandler

@Deprecated
public abstract void registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions)

Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. IMessageHandler methods are executed on java.util.concurrent.commonPool()

Parameters:

handler - The IMessageHandler instance
handlerOptions - MessageHandlerOptions

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

registerMessageHandler

public abstract void registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions, ExecutorService executorService)

Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. IMessageHandler methods are executed on the passed executor service.

Parameters:

handler - The IMessageHandler instance
handlerOptions - MessageHandlerOptions
executorService - ExecutorService which is used to execute IMessageHandler methods

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

registerMessageHandler

public abstract void registerMessageHandler(IMessageHandler handler, ExecutorService executorService)

Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. IMessageHandler methods are executed on the passed executor service.

Parameters:

handler - The IMessageHandler instance
executorService - ExecutorService which is used to execute IMessageHandler methods.

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

registerSessionHandler

@Deprecated
public abstract void registerSessionHandler(ISessionHandler handler)

Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. ISessionHandler methods are executed on java.util.concurrent.commonPool()

Parameters:

handler - The ISessionHandler instance

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

registerSessionHandler

@Deprecated
public abstract void registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions)

Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. ISessionHandler methods are executed on java.util.concurrent.commonPool()

Parameters:

handler - The ISessionHandler instance
handlerOptions - SessionHandlerOptions

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

registerSessionHandler

public abstract void registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions, ExecutorService executorService)

Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. ISessionHandler methods are executed on the passed executor service.

Parameters:

handler - The ISessionHandler instance
handlerOptions - SessionHandlerOptions
executorService - ExecutorService which is used to execute ISessionHandler methods

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

registerSessionHandler

public abstract void registerSessionHandler(ISessionHandler handler, ExecutorService executorService)

Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. ISessionHandler methods are executed on the passed executor service.

Parameters:

handler - The ISessionHandler instance
executorService - ExecutorService which is used to execute ISessionHandler methods

Throws:

InterruptedException

- if the current thread was interrupted while waiting
ServiceBusException - if the current thread was interrupted while waiting

setPrefetchCount

public abstract void setPrefetchCount(int prefetchCount)

Set the prefetch count of the receiver. Prefetch speeds up the message flow by aiming to have a message readily available for local retrieval when and before the application asks for one using Receive. Setting a non-zero value prefetches PrefetchCount number of messages. Setting the value to zero turns prefetch off. For RECEIVEANDDELETE mode, the default value is 0. For PEEKLOCK mode, the default value is 100.

The value cannot be set until the receiver is created.

Parameters:

prefetchCount - The desired prefetch count.

Throws:

ServiceBusException - if sets the value failed

Applies to