Class RabbitMQConnector
java.lang.Object
io.smallrye.reactive.messaging.rabbitmq.RabbitMQConnector
- All Implemented Interfaces:
InboundConnector
,OutboundConnector
,io.smallrye.reactive.messaging.health.HealthReporter
,org.eclipse.microprofile.reactive.messaging.spi.ConnectorFactory
@ApplicationScoped
public class RabbitMQConnector
extends Object
implements InboundConnector, OutboundConnector, io.smallrye.reactive.messaging.health.HealthReporter
-
Field Summary
FieldsFields inherited from interface org.eclipse.microprofile.reactive.messaging.spi.ConnectorFactory
CHANNEL_NAME_ATTRIBUTE, CONNECTOR_ATTRIBUTE, CONNECTOR_PREFIX, INCOMING_PREFIX, OUTGOING_PREFIX
-
Method Summary
Modifier and TypeMethodDescriptionjakarta.enterprise.inject.Instance
<io.vertx.rabbitmq.RabbitMQOptions> jakarta.enterprise.inject.Instance
<io.smallrye.reactive.messaging.ClientCustomizer<io.vertx.rabbitmq.RabbitMQOptions>> jakarta.enterprise.inject.Instance
<com.rabbitmq.client.impl.CredentialsProvider> jakarta.enterprise.inject.Instance
<RabbitMQFailureHandler.Factory> io.smallrye.reactive.messaging.health.HealthReport
Flow.Publisher
<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> getPublisher
(org.eclipse.microprofile.config.Config config) Creates a channel for the given configuration.io.smallrye.reactive.messaging.health.HealthReport
Flow.Subscriber
<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> getSubscriber
(org.eclipse.microprofile.config.Config config) Creates a channel for the given configuration.void
registerClient
(String channel, io.vertx.mutiny.rabbitmq.RabbitMQClient client) void
reportIncomingFailure
(String channel, Throwable reason) void
Application shutdown tidy up; cancels all subscriptions and stops clients.io.vertx.mutiny.core.Vertx
vertx()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.smallrye.reactive.messaging.health.HealthReporter
getStartup
-
Field Details
-
CONNECTOR_NAME
- See Also:
-
-
Method Details
-
getPublisher
public Flow.Publisher<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> getPublisher(org.eclipse.microprofile.config.Config config) Creates a channel for the given configuration. The channel's configuration is associated with a specificconnector
, using theConnector
qualifier's parameter indicating a key to whichIncomingConnectorFactory
to use.Note that the connection to the transport or broker is generally postponed until the subscription occurs.
- Specified by:
getPublisher
in interfaceInboundConnector
- Parameters:
config
- the configuration, must not benull
, must contain theConnectorFactory.CHANNEL_NAME_ATTRIBUTE
attribute.- Returns:
- the created
Flow.Publisher
, will not benull
. - Throws:
IllegalArgumentException
- if the configuration is invalid.NoSuchElementException
- if the configuration does not contain an expected attribute.
-
getSubscriber
public Flow.Subscriber<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> getSubscriber(org.eclipse.microprofile.config.Config config) Creates a channel for the given configuration. The channel's configuration is associated with a specificconnector
, using theConnector
qualifier's parameter indicating a key to whichOutgoing
to use.Note that the connection to the transport or broker is generally postponed until the subscription.
- Specified by:
getSubscriber
in interfaceOutboundConnector
- Parameters:
config
- the configuration, nevernull
, must contain theConnectorFactory.CHANNEL_NAME_ATTRIBUTE
attribute.- Returns:
- the created
SubscriberBuilder
, must not benull
. - Throws:
IllegalArgumentException
- if the configuration is invalid.NoSuchElementException
- if the configuration does not contain an expected attribute.
-
getReadiness
public io.smallrye.reactive.messaging.health.HealthReport getReadiness()- Specified by:
getReadiness
in interfaceio.smallrye.reactive.messaging.health.HealthReporter
-
getLiveness
public io.smallrye.reactive.messaging.health.HealthReport getLiveness()- Specified by:
getLiveness
in interfaceio.smallrye.reactive.messaging.health.HealthReporter
-
terminate
public void terminate(@Observes(notifyObserver=IF_EXISTS) @Priority(50) @BeforeDestroyed(jakarta.enterprise.context.ApplicationScoped.class) Object ignored) Application shutdown tidy up; cancels all subscriptions and stops clients.- Parameters:
ignored
- the incoming event, ignored
-
vertx
public io.vertx.mutiny.core.Vertx vertx() -
registerClient
-
reportIncomingFailure
-
failureHandlerFactories
-
clientOptions
public jakarta.enterprise.inject.Instance<io.vertx.rabbitmq.RabbitMQOptions> clientOptions() -
configCustomizers
public jakarta.enterprise.inject.Instance<io.smallrye.reactive.messaging.ClientCustomizer<io.vertx.rabbitmq.RabbitMQOptions>> configCustomizers() -
credentialsProviders
public jakarta.enterprise.inject.Instance<com.rabbitmq.client.impl.CredentialsProvider> credentialsProviders() -
configMaps
-