public interface AmqpSession extends Disposable, AsyncCloseable
AMQP links.Disposable.Composite, Disposable.Swap| Modifier and Type | Method and Description |
|---|---|
default Mono<Void> |
closeAsync() |
Mono<Void> |
commitTransaction(AmqpTransaction transaction)
Commit the transaction on the message broker.
|
Mono<AmqpLink> |
createConsumer(String linkName,
String entityPath,
Duration timeout,
AmqpRetryPolicy retryPolicy)
Creates a new AMQP link that consumes events from the message broker.
|
Mono<AmqpLink> |
createProducer(String linkName,
String entityPath,
Duration timeout,
AmqpRetryPolicy retryPolicy)
Creates a new AMQP link that publishes events to the message broker.
|
Mono<AmqpTransaction> |
createTransaction()
Creates the transaction on the message broker.
|
Flux<AmqpEndpointState> |
getEndpointStates()
Gets the endpoint states for the AMQP session.
|
Duration |
getOperationTimeout()
Gets the operation timeout for starting the AMQP session.
|
default Mono<? extends AmqpTransactionCoordinator> |
getOrCreateTransactionCoordinator()
Gets an existing or newly created
AmqpTransactionCoordinator on the AmqpSession which maintains
one instance of the AmqpTransactionCoordinator object. |
String |
getSessionName()
Gets the name for this AMQP session.
|
boolean |
removeLink(String linkName)
Removes an
AmqpLink with the given linkName. |
Mono<Void> |
rollbackTransaction(AmqpTransaction transaction)
Rollback the transaction on the message broker.
|
dispose, isDisposedString getSessionName()
Duration getOperationTimeout()
Mono<AmqpLink> createProducer(String linkName, String entityPath, Duration timeout, AmqpRetryPolicy retryPolicy)
linkName - Name of the link.entityPath - The entity path this link connects to when producing events.timeout - Timeout required for creating and opening AMQP link.retryPolicy - The retry policy to use when sending messages.Mono<AmqpLink> createConsumer(String linkName, String entityPath, Duration timeout, AmqpRetryPolicy retryPolicy)
linkName - Name of the link.entityPath - The entity path this link connects to, so that it may read events from the message broker.timeout - Timeout required for creating and opening an AMQP link.retryPolicy - The retry policy to use when consuming messages.boolean removeLink(String linkName)
AmqpLink with the given linkName.linkName - Name of the link to remove.true if the link was removed; false otherwise.Flux<AmqpEndpointState> getEndpointStates()
AmqpExceptions that occur on the link are
reported in the connection state. When the stream terminates, the session is closed.Mono<AmqpTransaction> createTransaction()
Mono<Void> commitTransaction(AmqpTransaction transaction)
transaction - to commit.Mono<Void> rollbackTransaction(AmqpTransaction transaction)
transaction - to rollbackdefault Mono<? extends AmqpTransactionCoordinator> getOrCreateTransactionCoordinator()
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.AmqpTransactionCoordinator.UnsupportedOperationException - Indicting implementation not found error. Azure SDK should provide
implementation of this API but if runtime is not able to find it in its classpath or version mismatch can cause
this exception.default Mono<Void> closeAsync()
closeAsync in interface AsyncCloseableCopyright © 2021 Microsoft Corporation. All rights reserved.