QueueClient Class
- java.
lang. Object - ClientEntity
- com.
microsoft. azure. servicebus. InitializableEntity - com.
microsoft. azure. servicebus. QueueClient
- com.
- com.
public class QueueClient implements IQueueClient
Constructor Summary
Method Summary
Modifier and Type | Method and Description |
---|---|
void | abandon(UUID lockToken) |
void | abandon(UUID lockToken, Map<String, Object> propertiesToModify) |
void | abandon(UUID lockToken, Map<String, Object> propertiesToModify, TransactionContext transaction) |
void | abandon(UUID lockToken, TransactionContext transaction) |
CompletableFuture<Void> | abandonAsync(UUID lockToken) |
CompletableFuture<Void> | abandonAsync(UUID lockToken, Map<String, Object> propertiesToModify) |
CompletableFuture<Void> | abandonAsync(UUID lockToken, Map<String, Object> propertiesToModify, TransactionContext transaction) |
CompletableFuture<Void> | abandonAsync(UUID lockToken, TransactionContext transaction) |
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 . For better performance, use async methods. |
CompletableFuture<Void> |
cancelScheduledMessageAsync(long sequenceNumber)
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. |
void | complete(UUID lockToken) |
void | complete(UUID lockToken, TransactionContext transaction) |
CompletableFuture<Void> | completeAsync(UUID lockToken) |
CompletableFuture<Void> | completeAsync(UUID lockToken, TransactionContext transaction) |
void | deadLetter(UUID lockToken) |
void | deadLetter(UUID lockToken, Map<String, Object> propertiesToModify) |
void | deadLetter(UUID lockToken, Map<String, Object> propertiesToModify, TransactionContext transaction) |
void | deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription) |
void | deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String, Object> propertiesToModify) |
void | deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String, Object> propertiesToModify, TransactionContext transaction) |
void | deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction) |
void | deadLetter(UUID lockToken, TransactionContext transaction) |
CompletableFuture<Void> | deadLetterAsync(UUID lockToken) |
CompletableFuture<Void> | deadLetterAsync(UUID lockToken, Map<String, Object> propertiesToModify) |
CompletableFuture<Void> | deadLetterAsync(UUID lockToken, Map<String, Object> propertiesToModify, TransactionContext transaction) |
CompletableFuture<Void> | deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription) |
CompletableFuture<Void> | deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String, Object> propertiesToModify) |
CompletableFuture<Void> | deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String, Object> propertiesToModify, TransactionContext transaction) |
CompletableFuture<Void> | deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction) |
CompletableFuture<Void> | deadLetterAsync(UUID lockToken, TransactionContext transaction) |
String |
getEntityPath()
Gets the path of the entity this client is sending messages to or receiving messages from. |
int | getPrefetchCount() |
String |
getQueueName()
Gets the name of the queue. |
Receive |
getReceiveMode()
Gets the ReceiveMode of the current receiver |
CompletableFuture<Void> | onClose() |
void | registerMessageHandler(IMessageHandler handler) |
void | registerMessageHandler(IMessageHandler handler, ExecutorService executorService) |
void | registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions) |
void | registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions, ExecutorService executorService) |
void | registerSessionHandler(ISessionHandler handler) |
void | registerSessionHandler(ISessionHandler handler, ExecutorService executorService) |
void | registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions) |
void | registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions, ExecutorService executorService) |
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 . For better performance, use async methods. |
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 . For better performance, use async methods. |
CompletableFuture<Long> |
scheduleMessageAsync(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 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. |
CompletableFuture<Long> |
scheduleMessageAsync(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 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. |
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 . For better performance, use async methods. |
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 . For better performance, use async methods. |
CompletableFuture<Void> |
sendAsync(IMessage message)
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. |
CompletableFuture<Void> |
sendAsync(IMessage message, TransactionContext transaction)
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. |
void |
sendBatch(Collection<? extends IMessage> 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 . For better performance, use async methods. |
void |
sendBatch(Collection<? extends IMessage> 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 . For better performance, use async methods. |
CompletableFuture<Void> |
sendBatchAsync(Collection<? extends IMessage> messages)
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. |
CompletableFuture<Void> |
sendBatchAsync(Collection<? extends IMessage> messages, TransactionContext transaction)
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. |
void | setPrefetchCount(int prefetchCount) |
Inherited Members
Constructor Details
QueueClient
public QueueClient(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode)
Parameters:
QueueClient
public QueueClient(String namespace, String queuePath, ClientSettings clientSettings, ReceiveMode receiveMode)
Parameters:
QueueClient
public QueueClient(URI namespaceEndpointURI, String queuePath, ClientSettings clientSettings, ReceiveMode receiveMode)
Parameters:
Method Details
abandon
public void abandon(UUID lockToken)
Parameters:
abandon
public void abandon(UUID lockToken, Map
Parameters:
abandon
public void abandon(UUID lockToken, Map
Parameters:
abandon
public void abandon(UUID lockToken, TransactionContext transaction)
Parameters:
abandonAsync
public CompletableFuture
Parameters:
abandonAsync
public CompletableFuture
Parameters:
abandonAsync
public CompletableFuture
Parameters:
abandonAsync
public CompletableFuture
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 . For better performance, use async methods.
Overrides:
QueueClient.cancelScheduledMessage(long sequenceNumber)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.
Overrides:
QueueClient.cancelScheduledMessageAsync(long sequenceNumber)Parameters:
Returns:
complete
public void complete(UUID lockToken)
Parameters:
complete
public void complete(UUID lockToken, TransactionContext transaction)
Parameters:
completeAsync
public CompletableFuture
Parameters:
completeAsync
public CompletableFuture
Parameters:
deadLetter
public void deadLetter(UUID lockToken)
Parameters:
deadLetter
public void deadLetter(UUID lockToken, Map
Parameters:
deadLetter
public void deadLetter(UUID lockToken, Map
Parameters:
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)
Parameters:
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map
Parameters:
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map
Parameters:
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)
Parameters:
deadLetter
public void deadLetter(UUID lockToken, TransactionContext transaction)
Parameters:
deadLetterAsync
public CompletableFuture
Parameters:
deadLetterAsync
public CompletableFuture
Parameters:
deadLetterAsync
public CompletableFuture
Parameters:
deadLetterAsync
public CompletableFuture
Parameters:
deadLetterAsync
public CompletableFuture
Parameters:
deadLetterAsync
public CompletableFuture
Parameters:
deadLetterAsync
public CompletableFuture
Parameters:
deadLetterAsync
public CompletableFuture
Parameters:
getEntityPath
public String getEntityPath()
Gets the path of the entity this client is sending messages to or receiving messages from.
Overrides:
QueueClient.getEntityPath()Returns:
getPrefetchCount
public int getPrefetchCount()
getQueueName
public String getQueueName()
Gets the name of the queue.
Overrides:
QueueClient.getQueueName()Returns:
getReceiveMode
public ReceiveMode getReceiveMode()
Gets the ReceiveMode of the current receiver
Overrides:
QueueClient.getReceiveMode()Returns:
onClose
protected CompletableFuture
registerMessageHandler
public void registerMessageHandler(IMessageHandler handler)
Parameters:
registerMessageHandler
public void registerMessageHandler(IMessageHandler handler, ExecutorService executorService)
Parameters:
registerMessageHandler
public void registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions)
Parameters:
registerMessageHandler
public void registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions, ExecutorService executorService)
Parameters:
registerSessionHandler
public void registerSessionHandler(ISessionHandler handler)
Parameters:
registerSessionHandler
public void registerSessionHandler(ISessionHandler handler, ExecutorService executorService)
Parameters:
registerSessionHandler
public void registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions)
Parameters:
registerSessionHandler
public void registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions, ExecutorService executorService)
Parameters:
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 . For better performance, use async methods.
Overrides:
QueueClient.scheduleMessage(IMessage message, Instant scheduledEnqueueTimeUtc)Parameters:
Returns:
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 . For better performance, use async methods.
Overrides:
QueueClient.scheduleMessage(IMessage message, Instant scheduledEnqueueTimeUtc, TransactionContext transaction)Parameters:
TransactionContext which this operation should enlist to.
Returns:
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.
Overrides:
QueueClient.scheduleMessageAsync(IMessage message, Instant scheduledEnqueueTimeUtc)Parameters:
Returns:
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.
Overrides:
QueueClient.scheduleMessageAsync(IMessage message, Instant scheduledEnqueueTimeUtc, TransactionContext transaction)Parameters:
TransactionContext which this operation should enlist to.
Returns:
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 . For better performance, use async methods.
Overrides:
QueueClient.send(IMessage message)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 . For better performance, use async methods.
Overrides:
QueueClient.send(IMessage message, TransactionContext transaction)Parameters:
TransactionContext which this operation should enlist to.
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.
Overrides:
QueueClient.sendAsync(IMessage message)Parameters:
Returns:
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.
Overrides:
QueueClient.sendAsync(IMessage message, TransactionContext transaction)Parameters:
TransactionContext which this operation should enlist to.
Returns:
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 . For better performance, use async methods.
Overrides:
QueueClient.sendBatch(Collection<? extends IMessage> messages)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 . For better performance, use async methods.
Overrides:
QueueClient.sendBatch(Collection<? extends IMessage> messages, TransactionContext transaction)Parameters:
TransactionContext which this operation should enlist to.
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.
Overrides:
QueueClient.sendBatchAsync(Collection<? extends IMessage> messages)Parameters:
Returns:
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.
Overrides:
QueueClient.sendBatchAsync(Collection<? extends IMessage> messages, TransactionContext transaction)Parameters:
TransactionContext which this operation should enlist to.
Returns:
setPrefetchCount
public void setPrefetchCount(int prefetchCount)
Parameters:
Applies to
Azure SDK for Java