Class RabbitMQConnectorCommonConfiguration

java.lang.Object
io.smallrye.reactive.messaging.rabbitmq.RabbitMQConnectorCommonConfiguration
Direct Known Subclasses:
RabbitMQConnectorIncomingConfiguration, RabbitMQConnectorOutgoingConfiguration

public class RabbitMQConnectorCommonConfiguration extends Object
Extracts the common configuration for the smallrye-rabbitmq connector.
  • Field Details

    • config

      protected final org.eclipse.microprofile.config.Config config
  • Constructor Details

    • RabbitMQConnectorCommonConfiguration

      public RabbitMQConnectorCommonConfiguration(org.eclipse.microprofile.config.Config config)
      Creates a new RabbitMQConnectorCommonConfiguration.
  • Method Details

    • config

      public org.eclipse.microprofile.config.Config config()
      Returns:
      the connector configuration
    • getFromAlias

      protected <T> Optional<T> getFromAlias(String alias, Class<T> type)
      Retrieves the value stored for the given alias.
      Type Parameters:
      T - the targeted type
      Parameters:
      alias - the attribute alias, must not be null or blank
      type - the targeted type
      Returns:
      the configuration value for the given alias, empty if not set
    • getFromAliasWithDefaultValue

      protected <T> T getFromAliasWithDefaultValue(String alias, Class<T> type, T defaultValue)
      Retrieves the value stored for the given alias. Returns the default value if not present.
      Type Parameters:
      T - the targeted type
      Parameters:
      alias - the attribute alias, must not be null or blank
      type - the targeted type
      defaultValue - the default value
      Returns:
      the configuration value for the given alias, empty if not set
    • getChannel

      public String getChannel()
      Returns:
      the channel name
    • getUsername

      public Optional<String> getUsername()
      Gets the username value from the configuration. Attribute Name: username Description: The username used to authenticate to the broker MicroProfile Config Alias: rabbitmq-username
      Returns:
      the username
    • getPassword

      public Optional<String> getPassword()
      Gets the password value from the configuration. Attribute Name: password Description: The password used to authenticate to the broker MicroProfile Config Alias: rabbitmq-password
      Returns:
      the password
    • getHost

      public String getHost()
      Gets the host value from the configuration. Attribute Name: host Description: The broker hostname MicroProfile Config Alias: rabbitmq-host Default Value: localhost
      Returns:
      the host
    • getPort

      public Integer getPort()
      Gets the port value from the configuration. Attribute Name: port Description: The broker port MicroProfile Config Alias: rabbitmq-port Default Value: 5672
      Returns:
      the port
    • getAddresses

      public Optional<String> getAddresses()
      Gets the addresses value from the configuration. Attribute Name: addresses Description: The multiple addresses for cluster mode, when given overrides the host and port MicroProfile Config Alias: rabbitmq-addresses
      Returns:
      the addresses
    • getSsl

      public Boolean getSsl()
      Gets the ssl value from the configuration. Attribute Name: ssl Description: Whether or not the connection should use SSL MicroProfile Config Alias: rabbitmq-ssl Default Value: false
      Returns:
      the ssl
    • getSslHostnameVerificationAlgorithm

      public String getSslHostnameVerificationAlgorithm()
      Gets the ssl.hostname-verification-algorithm value from the configuration. Attribute Name: ssl.hostname-verification-algorithm Description: Set the hostname verifier algorithm for the TLS connection. Accepted values are `HTTPS`, and `NONE` (defaults). `NONE` disables the hostname verification. Default Value: NONE
      Returns:
      the ssl.hostname-verification-algorithm
    • getTrustAll

      public Boolean getTrustAll()
      Gets the trust-all value from the configuration. Attribute Name: trust-all Description: Whether to skip trust certificate verification MicroProfile Config Alias: rabbitmq-trust-all Default Value: false
      Returns:
      the trust-all
    • getTrustStorePath

      public Optional<String> getTrustStorePath()
      Gets the trust-store-path value from the configuration. Attribute Name: trust-store-path Description: The path to a JKS trust store MicroProfile Config Alias: rabbitmq-trust-store-path
      Returns:
      the trust-store-path
    • getTrustStorePassword

      public Optional<String> getTrustStorePassword()
      Gets the trust-store-password value from the configuration. Attribute Name: trust-store-password Description: The password of the JKS trust store MicroProfile Config Alias: rabbitmq-trust-store-password
      Returns:
      the trust-store-password
    • getConnectionTimeout

      public Integer getConnectionTimeout()
      Gets the connection-timeout value from the configuration. Attribute Name: connection-timeout Description: The TCP connection timeout (ms); 0 is interpreted as no timeout Default Value: 60000
      Returns:
      the connection-timeout
    • getHandshakeTimeout

      public Integer getHandshakeTimeout()
      Gets the handshake-timeout value from the configuration. Attribute Name: handshake-timeout Description: The AMQP 0-9-1 protocol handshake timeout (ms) Default Value: 10000
      Returns:
      the handshake-timeout
    • getAutomaticRecoveryEnabled

      public Boolean getAutomaticRecoveryEnabled()
      Gets the automatic-recovery-enabled value from the configuration. Attribute Name: automatic-recovery-enabled Description: Whether automatic connection recovery is enabled Default Value: false
      Returns:
      the automatic-recovery-enabled
    • getAutomaticRecoveryOnInitialConnection

      public Boolean getAutomaticRecoveryOnInitialConnection()
      Gets the automatic-recovery-on-initial-connection value from the configuration. Attribute Name: automatic-recovery-on-initial-connection Description: Whether automatic recovery on initial connections is enabled Default Value: true
      Returns:
      the automatic-recovery-on-initial-connection
    • getReconnectAttempts

      public Integer getReconnectAttempts()
      Gets the reconnect-attempts value from the configuration. Attribute Name: reconnect-attempts Description: The number of reconnection attempts MicroProfile Config Alias: rabbitmq-reconnect-attempts Default Value: 100
      Returns:
      the reconnect-attempts
    • getReconnectInterval

      public Integer getReconnectInterval()
      Gets the reconnect-interval value from the configuration. Attribute Name: reconnect-interval Description: The interval (in seconds) between two reconnection attempts MicroProfile Config Alias: rabbitmq-reconnect-interval Default Value: 10
      Returns:
      the reconnect-interval
    • getNetworkRecoveryInterval

      public Integer getNetworkRecoveryInterval()
      Gets the network-recovery-interval value from the configuration. Attribute Name: network-recovery-interval Description: How long (ms) will automatic recovery wait before attempting to reconnect Default Value: 5000
      Returns:
      the network-recovery-interval
    • getUser

      public String getUser()
      Gets the user value from the configuration. Attribute Name: user Description: The user name to use when connecting to the broker Default Value: guest
      Returns:
      the user
    • getIncludeProperties

      public Boolean getIncludeProperties()
      Gets the include-properties value from the configuration. Attribute Name: include-properties Description: Whether to include properties when a broker message is passed on the event bus Default Value: false
      Returns:
      the include-properties
    • getRequestedChannelMax

      public Integer getRequestedChannelMax()
      Gets the requested-channel-max value from the configuration. Attribute Name: requested-channel-max Description: The initially requested maximum channel number Default Value: 2047
      Returns:
      the requested-channel-max
    • getRequestedHeartbeat

      public Integer getRequestedHeartbeat()
      Gets the requested-heartbeat value from the configuration. Attribute Name: requested-heartbeat Description: The initially requested heartbeat interval (seconds), zero for none Default Value: 60
      Returns:
      the requested-heartbeat
    • getUseNio

      public Boolean getUseNio()
      Gets the use-nio value from the configuration. Attribute Name: use-nio Description: Whether usage of NIO Sockets is enabled Default Value: false
      Returns:
      the use-nio
    • getVirtualHost

      public String getVirtualHost()
      Gets the virtual-host value from the configuration. Attribute Name: virtual-host Description: The virtual host to use when connecting to the broker MicroProfile Config Alias: rabbitmq-virtual-host Default Value: /
      Returns:
      the virtual-host
    • getClientOptionsName

      public Optional<String> getClientOptionsName()
      Gets the client-options-name value from the configuration. Attribute Name: client-options-name Description: The name of the RabbitMQ Client Option bean used to customize the RabbitMQ client configuration MicroProfile Config Alias: rabbitmq-client-options-name
      Returns:
      the client-options-name
    • getCredentialsProviderName

      public Optional<String> getCredentialsProviderName()
      Gets the credentials-provider-name value from the configuration. Attribute Name: credentials-provider-name Description: The name of the RabbitMQ Credentials Provider bean used to provide dynamic credentials to the RabbitMQ client MicroProfile Config Alias: rabbitmq-credentials-provider-name
      Returns:
      the credentials-provider-name
    • getHealthEnabled

      public Boolean getHealthEnabled()
      Gets the health-enabled value from the configuration. Attribute Name: health-enabled Description: Whether health reporting is enabled (default) or disabled Default Value: true
      Returns:
      the health-enabled
    • getHealthReadinessEnabled

      public Boolean getHealthReadinessEnabled()
      Gets the health-readiness-enabled value from the configuration. Attribute Name: health-readiness-enabled Description: Whether readiness health reporting is enabled (default) or disabled Default Value: true
      Returns:
      the health-readiness-enabled
    • getExchangeName

      public Optional<String> getExchangeName()
      Gets the exchange.name value from the configuration. Attribute Name: exchange.name Description: The exchange that messages are published to or consumed from. If not set, the channel name is used. If set to "", the default exchange is used.
      Returns:
      the exchange.name
    • getExchangeDurable

      public Boolean getExchangeDurable()
      Gets the exchange.durable value from the configuration. Attribute Name: exchange.durable Description: Whether the exchange is durable Default Value: true
      Returns:
      the exchange.durable
    • getExchangeAutoDelete

      public Boolean getExchangeAutoDelete()
      Gets the exchange.auto-delete value from the configuration. Attribute Name: exchange.auto-delete Description: Whether the exchange should be deleted after use Default Value: false
      Returns:
      the exchange.auto-delete
    • getExchangeType

      public String getExchangeType()
      Gets the exchange.type value from the configuration. Attribute Name: exchange.type Description: The exchange type: direct, fanout, headers or topic (default) Default Value: topic
      Returns:
      the exchange.type
    • getExchangeDeclare

      public Boolean getExchangeDeclare()
      Gets the exchange.declare value from the configuration. Attribute Name: exchange.declare Description: Whether to declare the exchange; set to false if the exchange is expected to be set up independently Default Value: true
      Returns:
      the exchange.declare
    • getExchangeArguments

      public String getExchangeArguments()
      Gets the exchange.arguments value from the configuration. Attribute Name: exchange.arguments Description: The identifier of the key-value Map exposed as bean used to provide arguments for exchange creation Default Value: rabbitmq-exchange-arguments
      Returns:
      the exchange.arguments
    • getTracingEnabled

      public Boolean getTracingEnabled()
      Gets the tracing.enabled value from the configuration. Attribute Name: tracing.enabled Description: Whether tracing is enabled (default) or disabled Default Value: true
      Returns:
      the tracing.enabled
    • getTracingAttributeHeaders

      public String getTracingAttributeHeaders()
      Gets the tracing.attribute-headers value from the configuration. Attribute Name: tracing.attribute-headers Description: A comma-separated list of headers that should be recorded as span attributes. Relevant only if tracing.enabled=true Default Value:
      Returns:
      the tracing.attribute-headers
    • validate

      public void validate()