AmqpSession Interface
Implements
public interface AmqpSession
extends Disposable, AsyncCloseable
An AMQP session representing bidirectional communication that supports multiple AmqpLink.
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| default Mono<Void> | closeAsync() |
| abstract Mono<Void> |
commitTransaction(AmqpTransaction transaction)
Commit the transaction on the message broker. |
|
abstract
Mono<Amqp |
createConsumer(String linkName, String entityPath, Duration timeout, AmqpRetryPolicy retryPolicy)
Creates a new AMQP link that consumes events from the message broker. |
|
abstract
Mono<Amqp |
createProducer(String linkName, String entityPath, Duration timeout, AmqpRetryPolicy retryPolicy)
Creates a new AMQP link that publishes events to the message broker. |
|
abstract
Mono<Amqp |
createTransaction()
Creates the transaction on the message broker. |
|
abstract
Flux<Amqp |
getEndpointStates()
Gets the endpoint states for the AMQP session. |
| abstract Duration |
getOperationTimeout()
Gets the operation timeout for starting the AMQP session. |
| default Mono<> |
getOrCreateTransactionCoordinator()
Gets an existing or newly created AmqpTransactionCoordinator on the AmqpSession which maintains one instance of the AmqpTransactionCoordinator object. |
| abstract String |
getSessionName()
Gets the name for this AMQP session. |
| abstract boolean |
removeLink(String linkName)
Removes an AmqpLink with the given |
| abstract Mono<Void> |
rollbackTransaction(AmqpTransaction transaction)
Rollback the transaction on the message broker. |
Method Details
closeAsync
public default Mono<Void> closeAsync()
commitTransaction
public abstract Mono<Void> commitTransaction(AmqpTransaction transaction)
Commit the transaction on the message broker.
Parameters:
Returns:
createConsumer
public abstract Mono<AmqpLink> createConsumer(String linkName, String entityPath, Duration timeout, AmqpRetryPolicy retryPolicy)
Creates a new AMQP link that consumes events from the message broker.
Parameters:
Returns:
createProducer
public abstract Mono<AmqpLink> createProducer(String linkName, String entityPath, Duration timeout, AmqpRetryPolicy retryPolicy)
Creates a new AMQP link that publishes events to the message broker.
Parameters:
Returns:
createTransaction
public abstract Mono<AmqpTransaction> createTransaction()
Creates the transaction on the message broker.
Returns:
getEndpointStates
public abstract Flux<AmqpEndpointState> getEndpointStates()
Gets the endpoint states for the AMQP session. AmqpException that occur on the link are reported in the connection state. When the stream terminates, the session is closed.
Returns:
getOperationTimeout
public abstract Duration getOperationTimeout()
Gets the operation timeout for starting the AMQP session.
Returns:
getOrCreateTransactionCoordinator
public default Mono<? extends AmqpTransactionCoordinator> getOrCreateTransactionCoordinator()
Gets an existing or newly created AmqpTransactionCoordinator on the AmqpSession which maintains one instance of the AmqpTransactionCoordinator object. The AmqpTransactionCoordinator is used to create/commit or rollback the transaction which can span over one or more message broker entities. The interface AmqpSession provides default implementation for back-word compatibility but it throws RuntimeException to warn that an implementing class must override and provide implementation of this API. Azure SDK already provides implementation for this API.
Returns:
getSessionName
public abstract String getSessionName()
Gets the name for this AMQP session.
Returns:
removeLink
public abstract boolean removeLink(String linkName)
Removes an AmqpLink with the given linkName.
Parameters:
Returns:
true if the link was removed; false otherwise.rollbackTransaction
public abstract Mono<Void> rollbackTransaction(AmqpTransaction transaction)
Rollback the transaction on the message broker.
Parameters:
Returns: