Class RabbitMQConnector

java.lang.Object
io.smallrye.reactive.messaging.rabbitmq.RabbitMQConnector
All Implemented Interfaces:
InboundConnector, OutboundConnector, io.smallrye.reactive.messaging.health.HealthReporter, org.eclipse.microprofile.reactive.messaging.spi.ConnectorFactory

@ApplicationScoped public class RabbitMQConnector extends Object implements InboundConnector, OutboundConnector, io.smallrye.reactive.messaging.health.HealthReporter
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from interface org.eclipse.microprofile.reactive.messaging.spi.ConnectorFactory

    CHANNEL_NAME_ATTRIBUTE, CONNECTOR_ATTRIBUTE, CONNECTOR_PREFIX, INCOMING_PREFIX, OUTGOING_PREFIX
  • Method Summary

    Modifier and Type
    Method
    Description
    jakarta.enterprise.inject.Instance<io.vertx.rabbitmq.RabbitMQOptions>
     
    jakarta.enterprise.inject.Instance<io.smallrye.reactive.messaging.ClientCustomizer<io.vertx.rabbitmq.RabbitMQOptions>>
     
    jakarta.enterprise.inject.Instance<Map<String,?>>
     
    jakarta.enterprise.inject.Instance<com.rabbitmq.client.impl.CredentialsProvider>
     
    jakarta.enterprise.inject.Instance<RabbitMQFailureHandler.Factory>
     
    io.smallrye.reactive.messaging.health.HealthReport
     
    Flow.Publisher<? extends org.eclipse.microprofile.reactive.messaging.Message<?>>
    getPublisher(org.eclipse.microprofile.config.Config config)
    Creates a channel for the given configuration.
    io.smallrye.reactive.messaging.health.HealthReport
     
    Flow.Subscriber<? extends org.eclipse.microprofile.reactive.messaging.Message<?>>
    getSubscriber(org.eclipse.microprofile.config.Config config)
    Creates a channel for the given configuration.
    void
    registerClient(String channel, io.vertx.mutiny.rabbitmq.RabbitMQClient client)
     
    void
     
    void
    terminate(Object ignored)
    Application shutdown tidy up; cancels all subscriptions and stops clients.
    io.vertx.mutiny.core.Vertx
     

    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
  • Field Details

  • Method Details

    • getPublisher

      public Flow.Publisher<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> getPublisher(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:
      getPublisher in interface InboundConnector
      Parameters:
      config - the configuration, must not be null, must contain the ConnectorFactory.CHANNEL_NAME_ATTRIBUTE attribute.
      Returns:
      the created Flow.Publisher, will not be null.
      Throws:
      IllegalArgumentException - if the configuration is invalid.
      NoSuchElementException - if the configuration does not contain an expected attribute.
    • getSubscriber

      public Flow.Subscriber<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> getSubscriber(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:
      getSubscriber in interface OutboundConnector
      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
    • 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
    • vertx

      public io.vertx.mutiny.core.Vertx vertx()
    • registerClient

      public void registerClient(String channel, io.vertx.mutiny.rabbitmq.RabbitMQClient client)
    • reportIncomingFailure

      public void reportIncomingFailure(String channel, Throwable reason)
    • failureHandlerFactories

      public jakarta.enterprise.inject.Instance<RabbitMQFailureHandler.Factory> failureHandlerFactories()
    • clientOptions

      public jakarta.enterprise.inject.Instance<io.vertx.rabbitmq.RabbitMQOptions> clientOptions()
    • configCustomizers

      public jakarta.enterprise.inject.Instance<io.smallrye.reactive.messaging.ClientCustomizer<io.vertx.rabbitmq.RabbitMQOptions>> configCustomizers()
    • credentialsProviders

      public jakarta.enterprise.inject.Instance<com.rabbitmq.client.impl.CredentialsProvider> credentialsProviders()
    • configMaps

      public jakarta.enterprise.inject.Instance<Map<String,?>> configMaps()