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
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONNECTOR_NAME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClient(io.vertx.mutiny.rabbitmq.RabbitMQClient client)static StringgetExchangeName(RabbitMQConnectorCommonConfiguration config)io.smallrye.reactive.messaging.health.HealthReportgetHealth(boolean strict)io.smallrye.reactive.messaging.health.HealthReportgetLiveness()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.HealthReportgetReadiness()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.VertxgetVertx()voidreportIncomingFailure(String channel, Throwable reason)voidterminate(Object ignored)Application shutdown tidy up; cancels all subscriptions and stops clients.
-
-
-
Field Detail
-
CONNECTOR_NAME
public static final String CONNECTOR_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getExchangeName
public static String getExchangeName(RabbitMQConnectorCommonConfiguration config)
-
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 theConnectorqualifier's parameter indicating a key to whichIncomingConnectorFactoryto use.Note that the connection to the transport or broker is generally postponed until the subscription occurs.
- Specified by:
getPublisherBuilderin interfaceorg.eclipse.microprofile.reactive.messaging.spi.IncomingConnectorFactory- Parameters:
config- the configuration, must not benull, must contain theConnectorFactory.CHANNEL_NAME_ATTRIBUTEattribute.- 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 theConnectorqualifier's parameter indicating a key to whichOutgoingto use.Note that the connection to the transport or broker is generally postponed until the subscription.
- Specified by:
getSubscriberBuilderin interfaceorg.eclipse.microprofile.reactive.messaging.spi.OutgoingConnectorFactory- Parameters:
config- the configuration, nevernull, must contain theConnectorFactory.CHANNEL_NAME_ATTRIBUTEattribute.- 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:
getReadinessin interfaceio.smallrye.reactive.messaging.health.HealthReporter
-
getLiveness
public io.smallrye.reactive.messaging.health.HealthReport getLiveness()
- Specified by:
getLivenessin 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(javax.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)
-
-