Class RabbitMQConnector
- java.lang.Object
-
- io.smallrye.reactive.messaging.rabbitmq.RabbitMQConnector
-
- All Implemented Interfaces:
HealthReporter,ConnectorFactory,IncomingConnectorFactory,OutgoingConnectorFactory
@ApplicationScoped public class RabbitMQConnector extends Object implements IncomingConnectorFactory, OutgoingConnectorFactory, HealthReporter
-
-
Field Summary
-
Fields inherited from interface org.eclipse.microprofile.reactive.messaging.spi.ConnectorFactory
CHANNEL_NAME_ATTRIBUTE, CONNECTOR_ATTRIBUTE, CONNECTOR_PREFIX, INCOMING_PREFIX, OUTGOING_PREFIX
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HealthReportgetHealth(boolean strict)HealthReportgetLiveness()org.eclipse.microprofile.reactive.streams.operators.PublisherBuilder<? extends Message<?>>getPublisherBuilder(org.eclipse.microprofile.config.Config config)Creates a channel for the given configuration.HealthReportgetReadiness()org.eclipse.microprofile.reactive.streams.operators.SubscriberBuilder<? extends Message<?>,Void>getSubscriberBuilder(org.eclipse.microprofile.config.Config config)Creates a channel for the given configuration.voidreportIncomingFailure(String channel, Throwable reason)voidterminate(Object ignored)Application shutdown tidy up; cancels all subscriptions and stops clients.-
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
-
-
-
-
Method Detail
-
getPublisherBuilder
public org.eclipse.microprofile.reactive.streams.operators.PublisherBuilder<? extends 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 interfaceIncomingConnectorFactory- 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 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 interfaceOutgoingConnectorFactory- 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 HealthReport getReadiness()
- Specified by:
getReadinessin interfaceHealthReporter
-
getLiveness
public HealthReport getLiveness()
- Specified by:
getLivenessin interfaceHealthReporter
-
getHealth
public 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
-
-