Class AmqpConnector
- java.lang.Object
-
- io.smallrye.reactive.messaging.amqp.AmqpConnector
-
- All Implemented Interfaces:
HealthReporter,ConnectorFactory,IncomingConnectorFactory,OutgoingConnectorFactory
@ApplicationScoped public class AmqpConnector extends Object implements IncomingConnectorFactory, OutgoingConnectorFactory, HealthReporter
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONNECTOR_NAME-
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 voidaddClient(io.vertx.mutiny.amqp.AmqpClient client)List<io.vertx.mutiny.amqp.AmqpClient>getClients()HealthReportgetLiveness()Liveness checks if a connection is established with the broker.org.eclipse.microprofile.reactive.streams.operators.PublisherBuilder<? extends Message<?>>getPublisherBuilder(org.eclipse.microprofile.config.Config config)Creates a channel for the given configuration.HealthReportgetReadiness()Readiness verify that we have an established connection with the broker.HealthReportgetStartup()org.eclipse.microprofile.reactive.streams.operators.SubscriberBuilder<? extends Message<?>,Void>getSubscriberBuilder(org.eclipse.microprofile.config.Config config)Creates a channel for the given configuration.io.vertx.mutiny.core.VertxgetVertx()voidreportFailure(String channel, Throwable reason)voidterminate(Object event)
-
-
-
Field Detail
-
CONNECTOR_NAME
public static final String CONNECTOR_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPublisherBuilder
public org.eclipse.microprofile.reactive.streams.operators.PublisherBuilder<? extends Message<?>> getPublisherBuilder(org.eclipse.microprofile.config.Config config)
Description copied from interface:IncomingConnectorFactoryCreates 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.
-
getSubscriberBuilder
public org.eclipse.microprofile.reactive.streams.operators.SubscriberBuilder<? extends Message<?>,Void> getSubscriberBuilder(org.eclipse.microprofile.config.Config config)
Description copied from interface:OutgoingConnectorFactoryCreates 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.
-
terminate
public void terminate(@Observes(notifyObserver=IF_EXISTS) @Priority(50) @BeforeDestroyed(javax.enterprise.context.ApplicationScoped.class) Object event)
-
getVertx
public io.vertx.mutiny.core.Vertx getVertx()
-
addClient
public void addClient(io.vertx.mutiny.amqp.AmqpClient client)
-
getClients
public List<io.vertx.mutiny.amqp.AmqpClient> getClients()
-
getReadiness
public HealthReport getReadiness()
Readiness verify that we have an established connection with the broker. If the connection is disconnected, readiness is set to false. However, liveness may still be true because of the retry.- Specified by:
getReadinessin interfaceHealthReporter- Returns:
- the report
-
getLiveness
public HealthReport getLiveness()
Liveness checks if a connection is established with the broker. Liveness is set to false after all the retry attempt have been re-attempted.- Specified by:
getLivenessin interfaceHealthReporter- Returns:
- the report
-
getStartup
public HealthReport getStartup()
- Specified by:
getStartupin interfaceHealthReporter
-
-