IMessageSender Interface
Implements
public interface IMessageSender
extends IMessageEntityClient
Represents a message sender that sends messages to Azure Service Bus.
Method Summary
Modifier and Type | Method and Description |
---|---|
abstract void |
cancelScheduledMessage(long sequenceNumber)
Cancels the enqueuing of an already sent scheduled message, if it was not already enqueued. |
abstract
Completable |
cancelScheduledMessageAsync(long sequenceNumber)
Cancels the enqueuing of an already sent scheduled message, if it was not already enqueued. |
abstract long |
scheduleMessage(IMessage message, Instant scheduledEnqueueTimeUtc)
Sends a scheduled message to the Azure Service Bus entity this sender is connected to. |
abstract long |
scheduleMessage(IMessage message, Instant scheduledEnqueueTimeUtc, TransactionContext transaction)
Sends a scheduled message to the Azure Service Bus entity this sender is connected to. |
abstract
Completable |
scheduleMessageAsync(IMessage message, Instant scheduledEnqueueTimeUtc)
Sends a scheduled message to the Azure Service Bus entity this sender is connected to. |
abstract
Completable |
scheduleMessageAsync(IMessage message, Instant scheduledEnqueueTimeUtc, TransactionContext transaction)
Sends a scheduled message to the Azure Service Bus entity this sender is connected to. |
abstract void |
send(IMessage message)
Sends a message to the Azure Service Bus entity this sender is connected to. |
abstract void |
send(IMessage message, TransactionContext transaction)
Sends a message to the Azure Service Bus entity this sender is connected to. |
abstract
Completable |
sendAsync(IMessage message)
Sends a message to the Azure Service Bus entity this sender is connected to. |
abstract
Completable |
sendAsync(IMessage message, TransactionContext transaction)
Sends a message to the Azure Service Bus entity this sender is connected to. |
abstract void |
sendBatch(Collection<? extends IMessage> messages)
Sends a batch of messages to the Azure Service Bus entity this sender is connected to. |
abstract void |
sendBatch(Collection<? extends IMessage> messages, TransactionContext transaction)
Sends a batch of messages to the Azure Service Bus entity this sender is connected to. |
abstract
Completable |
sendBatchAsync(Collection<? extends IMessage> messages)
Sends a batch of messages to the Azure Service Bus entity this sender is connected to. |
abstract
Completable |
sendBatchAsync(Collection<? extends IMessage> messages, TransactionContext transaction)
Sends a batch of messages to the Azure Service Bus entity this sender is connected to. |
Method Details
cancelScheduledMessage
public abstract 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 abstract 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:
Returns:
scheduleMessage
public abstract 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:
Returns:
Throws:
scheduleMessage
public abstract 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:
Returns:
Throws:
scheduleMessageAsync
public abstract 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:
Returns:
scheduleMessageAsync
public abstract 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:
Returns:
send
public abstract 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 abstract 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 abstract 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:
Returns:
sendAsync
public abstract 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:
Returns:
sendBatch
public abstract 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 abstract 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 abstract 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:
Returns:
sendBatchAsync
public abstract 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:
Returns:
Applies to
Azure SDK for Java