IMessageBrowser Interface

public interface IMessageBrowser

Represents a message browser that can browse messages from Azure Service Bus.

Method Summary

Modifier and Type Method and Description
abstract IMessage peek()

reads next the active message without changing the state of the receiver or the message source.

abstract IMessage peek(long fromSequenceNumber)

Reads next the active message without changing the state of the receiver or the message source.

abstract CompletableFuture<IMessage> peekAsync()

Asynchronously reads the active messages without changing the state of the receiver or the message source.

abstract CompletableFuture<IMessage> peekAsync(long fromSequenceNumber)

Asynchronously reads next the active message without changing the state of the receiver or the message source.

abstract Collection<IMessage> peekBatch(int messageCount)

Reads next batch of the active messages without changing the state of the receiver or the message source.

abstract Collection<IMessage> peekBatch(long fromSequenceNumber, int messageCount)

Reads next batch of the active messages without changing the state of the receiver or the message source.

abstract CompletableFuture<Collection<IMessage>> peekBatchAsync(int messageCount)

Asynchronously reads the next batch of active messages without changing the state of the receiver or the message source.

abstract CompletableFuture<Collection<IMessage>> peekBatchAsync(long fromSequenceNumber, int messageCount)

Asynchronously reads the next batch of active messages without changing the state of the receiver or the message source.

Method Details

peek

public abstract IMessage peek()

reads next the active message without changing the state of the receiver or the message source. The first call to peek() fetches the first active message for this receiver. Each subsequent call fetches the subsequent message in the entity.

Returns:

Message peeked

Throws:

InterruptedException

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

peek

public abstract IMessage peek(long fromSequenceNumber)

Reads next the active message without changing the state of the receiver or the message source.

Parameters:

fromSequenceNumber - The sequence number from where to read the message.

Returns:

Message peeked

Throws:

InterruptedException

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

peekAsync

public abstract CompletableFuture peekAsync()

Asynchronously reads the active messages without changing the state of the receiver or the message source.

Returns:

Message peeked

peekAsync

public abstract CompletableFuture peekAsync(long fromSequenceNumber)

Asynchronously reads next the active message without changing the state of the receiver or the message source.

Parameters:

fromSequenceNumber - The sequence number from where to read the message.

Returns:

CompletableFuture that returns Message peeked.

peekBatch

public abstract Collection peekBatch(int messageCount)

Reads next batch of the active messages without changing the state of the receiver or the message source.

Parameters:

messageCount - The number of messages.

Returns:

Batch of Message peeked

Throws:

InterruptedException

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

peekBatch

public abstract Collection peekBatch(long fromSequenceNumber, int messageCount)

Reads next batch of the active messages without changing the state of the receiver or the message source.

Parameters:

fromSequenceNumber - The sequence number from where to read the message.
messageCount - The number of messages.

Returns:

Batch of Message peeked

Throws:

InterruptedException

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

peekBatchAsync

public abstract CompletableFuture<>> peekBatchAsync(int messageCount)

Asynchronously reads the next batch of active messages without changing the state of the receiver or the message source.

Parameters:

messageCount - The number of messages.

Returns:

CompletableFuture that returns batch of Message peeked.

peekBatchAsync

public abstract CompletableFuture<>> peekBatchAsync(long fromSequenceNumber, int messageCount)

Asynchronously reads the next batch of active messages without changing the state of the receiver or the message source.

Parameters:

fromSequenceNumber - The sequence number from where to read the message.
messageCount - The number of messages.

Returns:

CompletableFuture that returns batch of Message peeked.

Applies to