Class AmqpConnectorCommonConfiguration
- java.lang.Object
-
- io.smallrye.reactive.messaging.amqp.AmqpConnectorCommonConfiguration
-
- Direct Known Subclasses:
AmqpConnectorIncomingConfiguration
,AmqpConnectorOutgoingConfiguration
public class AmqpConnectorCommonConfiguration extends Object
Extracts the common configuration for thesmallrye-amqp
connector.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.microprofile.config.Config
config
-
Constructor Summary
Constructors Constructor Description AmqpConnectorCommonConfiguration(org.eclipse.microprofile.config.Config config)
Creates a new AmqpConnectorCommonConfiguration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.microprofile.config.Config
config()
Optional<String>
getAddress()
Gets the address value from the configuration.String
getChannel()
Optional<String>
getClientOptionsName()
Gets the client-options-name value from the configuration.Integer
getConnectTimeout()
Gets the connect-timeout value from the configuration.Optional<String>
getContainerId()
Gets the containerId value from the configuration.protected <T> Optional<T>
getFromAlias(String alias, Class<T> type)
Retrieves the value stored for the given alias.protected <T> T
getFromAliasWithDefaultValue(String alias, Class<T> type, T defaultValue)
Retrieves the value stored for the given alias.String
getHost()
Gets the host value from the configuration.Optional<String>
getPassword()
Gets the password value from the configuration.Integer
getPort()
Gets the port value from the configuration.Integer
getReconnectAttempts()
Gets the reconnect-attempts value from the configuration.Integer
getReconnectInterval()
Gets the reconnect-interval value from the configuration.Optional<String>
getUsername()
Gets the username value from the configuration.Boolean
getUseSsl()
Gets the use-ssl value from the configuration.void
validate()
-
-
-
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 benull
or blanktype
- 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 benull
or blanktype
- the targeted typedefaultValue
- 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: amqp-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: amqp-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: amqp-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: amqp-port Default Value: 5672- Returns:
- the port
-
getUseSsl
public Boolean getUseSsl()
Gets the use-ssl value from the configuration. Attribute Name: use-ssl Description: Whether the AMQP connection uses SSL/TLS MicroProfile Config Alias: amqp-use-ssl Default Value: false- Returns:
- the use-ssl
-
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: amqp-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 second between two reconnection attempts MicroProfile Config Alias: amqp-reconnect-interval Default Value: 10- Returns:
- the reconnect-interval
-
getConnectTimeout
public Integer getConnectTimeout()
Gets the connect-timeout value from the configuration. Attribute Name: connect-timeout Description: The connection timeout in milliseconds MicroProfile Config Alias: amqp-connect-timeout Default Value: 1000- Returns:
- the connect-timeout
-
getContainerId
public Optional<String> getContainerId()
Gets the containerId value from the configuration. Attribute Name: containerId Description: The AMQP container id- Returns:
- the containerId
-
getAddress
public Optional<String> getAddress()
Gets the address value from the configuration. Attribute Name: address Description: The AMQP address. If not set, the channel name is used- Returns:
- the address
-
getClientOptionsName
public Optional<String> getClientOptionsName()
Gets the client-options-name value from the configuration. Attribute Name: client-options-name Description: The name of the AMQP Client Option bean used to customize the AMQP client configuration MicroProfile Config Alias: amqp-client-options-name- Returns:
- the client-options-name
-
validate
public void validate()
-
-