Class RabbitMQConnectorCommonConfiguration

    • Field Detail

      • config

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

      • RabbitMQConnectorCommonConfiguration

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

      • 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
      • 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
      • 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 AMQP 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
      • 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
        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
      • 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()