Class 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 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
      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.
      • Methods inherited from interface io.smallrye.reactive.messaging.health.HealthReporter

        getStartup
    • 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 specific connector, using the Connector qualifier's parameter indicating a key to which IncomingConnectorFactory to use.

        Note that the connection to the transport or broker is generally postponed until the subscription occurs.

        Specified by:
        getPublisherBuilder in interface org.eclipse.microprofile.reactive.messaging.spi.IncomingConnectorFactory
        Parameters:
        config - the configuration, must not be null, must contain the ConnectorFactory.CHANNEL_NAME_ATTRIBUTE attribute.
        Returns:
        the created PublisherBuilder, will not be null.
        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 specific connector, using the Connector qualifier's parameter indicating a key to which Outgoing to use.

        Note that the connection to the transport or broker is generally postponed until the subscription.

        Specified by:
        getSubscriberBuilder in interface org.eclipse.microprofile.reactive.messaging.spi.OutgoingConnectorFactory
        Parameters:
        config - the configuration, never null, must contain the ConnectorFactory.CHANNEL_NAME_ATTRIBUTE attribute.
        Returns:
        the created SubscriberBuilder, must not be null.
        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 interface io.smallrye.reactive.messaging.health.HealthReporter
      • getLiveness

        public io.smallrye.reactive.messaging.health.HealthReport getLiveness()
        Specified by:
        getLiveness in interface io.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)
      • reportIncomingFailure

        public void reportIncomingFailure​(String channel,
                                          Throwable reason)