QueueClient Class
- java.
lang. Object - com.
microsoft. azure. servicebus. primitives. ClientEntity - com.
microsoft. azure. servicebus. InitializableEntity - com.
microsoft. azure. servicebus. QueueClient
- com.
- com.
- com.
Implements
public final class QueueClient
extends com.microsoft.azure.servicebus.InitializableEntity
implements IQueueClient
Constructor Summary
Method Summary
Methods inherited from ClientEntity
Methods inherited from java.lang.Object
Constructor Details
QueueClient
public QueueClient(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode)
Parameters:
Throws:
QueueClient
public QueueClient(String namespace, String queuePath, ClientSettings clientSettings, ReceiveMode receiveMode)
Parameters:
Throws:
QueueClient
public QueueClient(URI namespaceEndpointURI, String queuePath, ClientSettings clientSettings, ReceiveMode receiveMode)
Parameters:
Throws:
Method Details
abandon
public 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:
Throws:
abandon
public void abandon(UUID lockToken, Map
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:
Throws:
abandon
public void abandon(UUID lockToken, Map
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:
Throws:
abandon
public 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:
Throws:
abandonAsync
public CompletableFuture
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:
abandonAsync
public CompletableFuture
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:
abandonAsync
public CompletableFuture
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:
abandonAsync
public CompletableFuture
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:
cancelScheduledMessage
public void cancelScheduledMessage(long sequenceNumber)
Cancels the enqueuing of an already sent scheduled message, if it was not already enqueued. This method blocks until the message is sent to the entity. Calling this method is equivalent to calling cancelScheduledMessageAsync(sequenceNumber).get()
. For better performance, use async methods.
Parameters:
Throws:
cancelScheduledMessageAsync
public CompletableFuture
Cancels the enqueuing of an already sent scheduled message, if it was not already enqueued. This is an asynchronous method returning a CompletableFuture which completes when the message is cancelled.
Parameters:
complete
public void complete(UUID lockToken)
Completes a Message using its lock token. This will delete the message from the service.
Parameters:
Throws:
complete
public void complete(UUID lockToken, TransactionContext transaction)
Completes a Message using its lock token. This will delete the message from the service.
Parameters:
Throws:
completeAsync
public CompletableFuture
Asynchronously completes a Message using its lock token. This will delete the message from the service.
Parameters:
completeAsync
public CompletableFuture
Asynchronously completes a Message using its lock token. This will delete the message from the service.
Parameters:
deadLetter
public void deadLetter(UUID lockToken)
Moves a Message to the deadletter sub-queue.
Parameters:
Throws:
deadLetter
public void deadLetter(UUID lockToken, Map
Moves a Message to the deadletter sub-queue with modified message properties.
Parameters:
Throws:
deadLetter
public void deadLetter(UUID lockToken, Map
Moves a Message to the deadletter sub-queue with modified message properties.
Parameters:
Throws:
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)
Moves a Message to the deadletter sub-queue with deadletter reason and error description.
Parameters:
Throws:
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map
Moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.
Parameters:
Throws:
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map
Moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.
Parameters:
Throws:
deadLetter
public 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:
Throws:
deadLetter
public void deadLetter(UUID lockToken, TransactionContext transaction)
Moves a Message to the deadletter sub-queue.
Parameters:
Throws:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter.
Parameters:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with modified properties.
Parameters:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with modified properties.
Parameters:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description.
Parameters:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.
Parameters:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.
Parameters:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description.
Parameters:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter.
Parameters:
getEntityPath
public String getEntityPath()
Gets the path of the entity this client is sending messages to or receiving messages from.
getPrefetchCount
public int getPrefetchCount()
Get the prefetch value set.
getQueueName
public String getQueueName()
Gets the name of the queue.
getReceiveMode
public ReceiveMode getReceiveMode()
Gets the ReceiveMode of the current receiver
onClose
protected CompletableFuture
Overrides:
QueueClient.onClose()registerMessageHandler
@Deprecated
public void registerMessageHandler(IMessageHandler handler)
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:
Throws:
registerMessageHandler
public 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:
Throws:
registerMessageHandler
@Deprecated
public 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:
Throws:
registerMessageHandler
public 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:
Throws:
registerSessionHandler
@Deprecated
public 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:
Throws:
registerSessionHandler
public 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:
Throws:
registerSessionHandler
@Deprecated
public 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:
Throws:
registerSessionHandler
public 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:
Throws:
scheduleMessage
public long scheduleMessage(IMessage message, Instant scheduledEnqueueTimeUtc)
Sends a scheduled message to the Azure Service Bus entity this sender is connected to. A scheduled message is enqueued and made available to receivers only at the scheduled enqueue time. This method blocks until the message is sent to the entity. Calling this method is equivalent to calling scheduleMessageAsync(message, scheduledEnqueueTimeUtc).get()
. For better performance, use async methods.
Parameters:
Throws:
scheduleMessage
public long scheduleMessage(IMessage message, Instant scheduledEnqueueTimeUtc, TransactionContext transaction)
Sends a scheduled message to the Azure Service Bus entity this sender is connected to. A scheduled message is enqueued and made available to receivers only at the scheduled enqueue time. This method blocks until the message is sent to the entity. Calling this method is equivalent to calling scheduleMessageAsync(message, scheduledEnqueueTimeUtc).get()
. For better performance, use async methods.
Parameters:
Throws:
scheduleMessageAsync
public CompletableFuture
Sends a scheduled message to the Azure Service Bus entity this sender is connected to. A scheduled message is enqueued and made available to receivers only at the scheduled enqueue time. This is an asynchronous method returning a CompletableFuture which completes when the message is sent to the entity. The CompletableFuture, on completion, returns the sequence number of the scheduled message which can be used to cancel the scheduling of the message.
Parameters:
scheduleMessageAsync
public CompletableFuture
Sends a scheduled message to the Azure Service Bus entity this sender is connected to. A scheduled message is enqueued and made available to receivers only at the scheduled enqueue time. This is an asynchronous method returning a CompletableFuture which completes when the message is sent to the entity. The CompletableFuture, on completion, returns the sequence number of the scheduled message which can be used to cancel the scheduling of the message.
Parameters:
send
public void send(IMessage message)
Sends a message to the Azure Service Bus entity this sender is connected to. This method blocks until the message is sent to the entity. Calling this method is equivalent to calling sendAsync(message).get()
. For better performance, use async methods.
Parameters:
Throws:
send
public void send(IMessage message, TransactionContext transaction)
Sends a message to the Azure Service Bus entity this sender is connected to. This method blocks until the message is sent to the entity. Calling this method is equivalent to calling sendAsync(message).get()
. For better performance, use async methods.
Parameters:
Throws:
sendAsync
public CompletableFuture
Sends a message to the Azure Service Bus entity this sender is connected to. This is an asynchronous method returning a CompletableFuture which completes when the message is sent to the entity.
Parameters:
sendAsync
public CompletableFuture
Sends a message to the Azure Service Bus entity this sender is connected to. This is an asynchronous method returning a CompletableFuture which completes when the message is sent to the entity.
Parameters:
sendBatch
public void sendBatch(Collection messages)
Sends a batch of messages to the Azure Service Bus entity this sender is connected to. This method blocks until the batch is sent to the entity. Calling this method is equivalent to calling sendBatchAsync(messages).get()
. For better performance, use async methods. When called on partitioned entities, messages meant for different partitions cannot be batched together.
Parameters:
Throws:
sendBatch
public void sendBatch(Collection messages, TransactionContext transaction)
Sends a batch of messages to the Azure Service Bus entity this sender is connected to. This method blocks until the batch is sent to the entity. Calling this method is equivalent to calling sendBatchAsync(messages).get()
. For better performance, use async methods. When called on partitioned entities, messages meant for different partitions cannot be batched together.
Parameters:
Throws:
sendBatchAsync
public CompletableFuture
Sends a batch of messages to the Azure Service Bus entity this sender is connected to. This is an asynchronous method returning a CompletableFuture which completes when the batch is sent to the entity. When called on partitioned entities, messages meant for different partitions cannot be batched together.
Parameters:
sendBatchAsync
public CompletableFuture
Sends a batch of messages to the Azure Service Bus entity this sender is connected to. This is an asynchronous method returning a CompletableFuture which completes when the batch is sent to the entity. When called on partitioned entities, messages meant for different partitions cannot be batched together.
Parameters:
setPrefetchCount
public 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:
Throws:
Applies to
Azure SDK for Java