Class RabbitMQConnector
- java.lang.Object
-
- io.smallrye.reactive.messaging.rabbitmq.RabbitMQConnector
-
- All Implemented Interfaces:
io.smallrye.reactive.messaging.health.HealthReporter
,org.eclipse.microprofile.reactive.messaging.spi.ConnectorFactory
,org.eclipse.microprofile.reactive.messaging.spi.IncomingConnectorFactory
,org.eclipse.microprofile.reactive.messaging.spi.OutgoingConnectorFactory
@ApplicationScoped public class RabbitMQConnector extends Object implements org.eclipse.microprofile.reactive.messaging.spi.IncomingConnectorFactory, org.eclipse.microprofile.reactive.messaging.spi.OutgoingConnectorFactory, io.smallrye.reactive.messaging.health.HealthReporter
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addClient(io.vertx.mutiny.rabbitmq.RabbitMQClient client)
io.smallrye.reactive.messaging.health.HealthReport
getHealth(boolean strict)
io.smallrye.reactive.messaging.health.HealthReport
getLiveness()
org.eclipse.microprofile.reactive.streams.operators.PublisherBuilder<? extends org.eclipse.microprofile.reactive.messaging.Message<?>>
getPublisherBuilder(org.eclipse.microprofile.config.Config config)
Creates a channel for the given configuration.io.smallrye.reactive.messaging.health.HealthReport
getReadiness()
org.eclipse.microprofile.reactive.streams.operators.SubscriberBuilder<? extends org.eclipse.microprofile.reactive.messaging.Message<?>,Void>
getSubscriberBuilder(org.eclipse.microprofile.config.Config config)
Creates a channel for the given configuration.io.vertx.mutiny.core.Vertx
getVertx()
void
reportIncomingFailure(String channel, Throwable reason)
void
terminate(Object ignored)
Application shutdown tidy up; cancels all subscriptions and stops clients.
-
-
-
Method Detail
-
getPublisherBuilder
public org.eclipse.microprofile.reactive.streams.operators.PublisherBuilder<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> getPublisherBuilder(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:
getPublisherBuilder
in interfaceorg.eclipse.microprofile.reactive.messaging.spi.IncomingConnectorFactory
- Parameters:
config
- the configuration, must not benull
, must contain theConnectorFactory.CHANNEL_NAME_ATTRIBUTE
attribute.- Returns:
- the created
PublisherBuilder
, will not benull
. - Throws:
IllegalArgumentException
- if the configuration is invalid.NoSuchElementException
- if the configuration does not contain an expected attribute.
-
getSubscriberBuilder
public org.eclipse.microprofile.reactive.streams.operators.SubscriberBuilder<? extends org.eclipse.microprofile.reactive.messaging.Message<?>,Void> getSubscriberBuilder(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:
getSubscriberBuilder
in interfaceorg.eclipse.microprofile.reactive.messaging.spi.OutgoingConnectorFactory
- 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
-
getHealth
public io.smallrye.reactive.messaging.health.HealthReport getHealth(boolean strict)
-
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
-
getVertx
public io.vertx.mutiny.core.Vertx getVertx()
-
addClient
public void addClient(io.vertx.mutiny.rabbitmq.RabbitMQClient client)
-
-