Class HiveMQMqttConnectorCommonConfiguration
java.lang.Object
io.quarkiverse.hivemqclient.smallrye.reactive.HiveMQMqttConnectorCommonConfiguration
- Direct Known Subclasses:
HiveMQMqttConnectorIncomingConfiguration,HiveMQMqttConnectorOutgoingConfiguration
Extracts the common configuration for the
smallrye-mqtt-hivemq connector.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHiveMQMqttConnectorCommonConfiguration(org.eclipse.microprofile.config.Config config) Creates a new HiveMQMqttConnectorCommonConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.microprofile.config.Configconfig()Gets the auto-clean-session value from the configuration.Gets the auto-generated-client-id value from the configuration.Gets the auto-keep-alive value from the configuration.Gets the check-topic-enabled value from the configuration.Gets the check-topic-name value from the configuration.Gets the client-id value from the configuration.Gets the connect-timeout-seconds value from the configuration.protected <T> Optional<T>getFromAlias(String alias, Class<T> type) Retrieves the value stored for the given alias.protected <T> TgetFromAliasWithDefaultValue(String alias, Class<T> type, T defaultValue) Retrieves the value stored for the given alias.getHost()Gets the host value from the configuration.Gets the keep-alive-seconds value from the configuration.Gets the liveness-timeout value from the configuration.Gets the max-inflight-queue value from the configuration.Gets the max-message-size value from the configuration.Gets the password value from the configuration.getPort()Gets the port value from the configuration.getQos()Gets the qos value from the configuration.Gets the readiness-timeout value from the configuration.Gets the reconnect-attempts value from the configuration.Gets the reconnect-interval-seconds value from the configuration.Gets the server-name value from the configuration.getSsl()Gets the ssl value from the configuration.Gets the ssl.hostVerifier value from the configuration.Gets the ssl.keystore.location value from the configuration.Gets the ssl.keystore.password value from the configuration.Gets the ssl.keystore.type value from the configuration.Gets the ssl.truststore.location value from the configuration.Gets the ssl.truststore.password value from the configuration.Gets the ssl.truststore.type value from the configuration.getTopic()Gets the topic value from the configuration.Gets the trust-all value from the configuration.Gets the username value from the configuration.Gets the will-flag value from the configuration.Gets the will-qos value from the configuration.Gets the will-retain value from the configuration.voidvalidate()
-
Field Details
-
config
protected final org.eclipse.microprofile.config.Config config
-
-
Constructor Details
-
HiveMQMqttConnectorCommonConfiguration
public HiveMQMqttConnectorCommonConfiguration(org.eclipse.microprofile.config.Config config) Creates a new HiveMQMqttConnectorCommonConfiguration.
-
-
Method Details
-
config
public org.eclipse.microprofile.config.Config config()- Returns:
- the connector configuration
-
getFromAlias
Retrieves the value stored for the given alias.- Type Parameters:
T- the targeted type- Parameters:
alias- the attribute alias, must not benullor blanktype- the targeted type- Returns:
- the configuration value for the given alias, empty if not set
-
getFromAliasWithDefaultValue
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 benullor blanktype- the targeted typedefaultValue- the default value- Returns:
- the configuration value for the given alias, empty if not set
-
getChannel
- Returns:
- the channel name
-
getClientId
Gets the client-id value from the configuration. Attribute Name: client-id Description: Set the client identifier- Returns:
- the client-id
-
getAutoGeneratedClientId
Gets the auto-generated-client-id value from the configuration. Attribute Name: auto-generated-client-id Description: Set if the MQTT client must generate clientId automatically Default Value: true- Returns:
- the auto-generated-client-id
-
getAutoKeepAlive
Gets the auto-keep-alive value from the configuration. Attribute Name: auto-keep-alive Description: Set if the MQTT client must handle `PINGREQ` automatically Default Value: true- Returns:
- the auto-keep-alive
-
getSsl
Gets the ssl value from the configuration. Attribute Name: ssl Description: Set whether SSL/TLS is enabled Default Value: false- Returns:
- the ssl
-
getKeepAliveSeconds
Gets the keep-alive-seconds value from the configuration. Attribute Name: keep-alive-seconds Description: Set the keep alive timeout in seconds Default Value: 30- Returns:
- the keep-alive-seconds
-
getMaxInflightQueue
Gets the max-inflight-queue value from the configuration. Attribute Name: max-inflight-queue Description: Set max count of unacknowledged messages Default Value: 10- Returns:
- the max-inflight-queue
-
getAutoCleanSession
Gets the auto-clean-session value from the configuration. Attribute Name: auto-clean-session Description: Set to start with a clean session (`true` by default) Default Value: true- Returns:
- the auto-clean-session
-
getWillFlag
Gets the will-flag value from the configuration. Attribute Name: will-flag Description: Set if will information are provided on connection Default Value: false- Returns:
- the will-flag
-
getWillRetain
Gets the will-retain value from the configuration. Attribute Name: will-retain Description: Set if the will message must be retained Default Value: false- Returns:
- the will-retain
-
getWillQos
Gets the will-qos value from the configuration. Attribute Name: will-qos Description: Set the QoS level for the will message Default Value: 0- Returns:
- the will-qos
-
getMaxMessageSize
Gets the max-message-size value from the configuration. Attribute Name: max-message-size Description: Set max MQTT message size in bytes Default Value: 8092- Returns:
- the max-message-size
-
getReconnectAttempts
Gets the reconnect-attempts value from the configuration. Attribute Name: reconnect-attempts Description: Set the max reconnect attempts Default Value: 5- Returns:
- the reconnect-attempts
-
getReconnectIntervalSeconds
Gets the reconnect-interval-seconds value from the configuration. Attribute Name: reconnect-interval-seconds Description: Set the reconnect interval in seconds Default Value: 1- Returns:
- the reconnect-interval-seconds
-
getUsername
Gets the username value from the configuration. Attribute Name: username Description: Set the username to connect to the server- Returns:
- the username
-
getPassword
Gets the password value from the configuration. Attribute Name: password Description: Set the password to connect to the server- Returns:
- the password
-
getConnectTimeoutSeconds
Gets the connect-timeout-seconds value from the configuration. Attribute Name: connect-timeout-seconds Description: Set the connect timeout (in seconds) Default Value: 60- Returns:
- the connect-timeout-seconds
-
getTrustAll
Gets the trust-all value from the configuration. Attribute Name: trust-all Description: Set whether all server certificates should be trusted Default Value: false- Returns:
- the trust-all
-
getHost
Gets the host value from the configuration. Attribute Name: host Description: Set the MQTT server host name/IP Mandatory: yes- Returns:
- the host
-
getPort
Gets the port value from the configuration. Attribute Name: port Description: Set the MQTT server port. Default to 8883 if ssl is enabled, or 1883 without ssl- Returns:
- the port
-
getServerName
Gets the server-name value from the configuration. Attribute Name: server-name Description: Set the SNI server name- Returns:
- the server-name
-
getTopic
Gets the topic value from the configuration. Attribute Name: topic Description: Set the MQTT topic. If not set, the channel name is used- Returns:
- the topic
-
getQos
Gets the qos value from the configuration. Attribute Name: qos Description: Set the QoS level when subscribing to the topic or when sending a message Default Value: 0- Returns:
- the qos
-
getSslTruststoreType
Gets the ssl.truststore.type value from the configuration. Attribute Name: ssl.truststore.type Description: Set the truststore type pkcs12, jks, pem] Default Value: jks- Returns:
- the ssl.truststore.type
-
getSslTruststoreLocation
Gets the ssl.truststore.location value from the configuration. Attribute Name: ssl.truststore.location Description: Set the truststore location. In case of pem type this is the cert path- Returns:
- the ssl.truststore.location
-
getSslTruststorePassword
Gets the ssl.truststore.password value from the configuration. Attribute Name: ssl.truststore.password Description: Set the truststore password. In case of pem type this is not necessary- Returns:
- the ssl.truststore.password
-
getSslKeystoreType
Gets the ssl.keystore.type value from the configuration. Attribute Name: ssl.keystore.type Description: Set the keystore type [pkcs12, jks, pem] Default Value: jks- Returns:
- the ssl.keystore.type
-
getSslKeystoreLocation
Gets the ssl.keystore.location value from the configuration. Attribute Name: ssl.keystore.location Description: Set the keystore location. In case of pem type this is the cert path- Returns:
- the ssl.keystore.location
-
getSslKeystorePassword
Gets the ssl.keystore.password value from the configuration. Attribute Name: ssl.keystore.password Description: Set the keystore password. In case of pem type this is the key path- Returns:
- the ssl.keystore.password
-
getSslHostVerifier
Gets the ssl.hostVerifier value from the configuration. Attribute Name: ssl.hostVerifier Description: Enable or disable SSL host verification Default Value: true- Returns:
- the ssl.hostVerifier
-
getCheckTopicEnabled
Gets the check-topic-enabled value from the configuration. Attribute Name: check-topic-enabled Description: Enable check for liveness/readiness Default Value: false- Returns:
- the check-topic-enabled
-
getCheckTopicName
Gets the check-topic-name value from the configuration. Attribute Name: check-topic-name Description: Topic Used to check liveness/readiness Default Value: $SYS/broker/uptime- Returns:
- the check-topic-name
-
getReadinessTimeout
Gets the readiness-timeout value from the configuration. Attribute Name: readiness-timeout Description: Timeout to declare the MQTT Client not ready Default Value: 20000- Returns:
- the readiness-timeout
-
getLivenessTimeout
Gets the liveness-timeout value from the configuration. Attribute Name: liveness-timeout Description: Timeout to declare the MQTT Client not alive Default Value: 120000- Returns:
- the liveness-timeout
-
validate
public void validate()
-