Tahu Host Application
Since Camel 4.8
Only consumer is supported
URI format
hostId
is the Sparkplug Host Application IDtahu-host://hostId?options
tahu-host:BasicHostApp?clientId=HostClient1
Configuring Options
Camel components are configured on two separate levels:
-
component level
-
endpoint level
Configuring Component Options
At the component level, you set general and shared configurations that are, then, inherited by the endpoints. It is the highest configuration level.
For example, a component may have security settings, credentials for authentication, urls for network connection and so forth.
Some components only have a few options, and others may have many. Because components typically have pre-configured defaults that are commonly used, then you may often only need to configure a few options on a component; or none at all.
You can configure components using:
-
the Component DSL.
-
in a configuration file (
application.properties
,*.yaml
files, etc). -
directly in the Java code.
Configuring Endpoint Options
You usually spend more time setting up endpoints because they have many options. These options help you customize what you want the endpoint to do. The options are also categorized into whether the endpoint is used as a consumer (from), as a producer (to), or both.
Configuring endpoints is most often done directly in the endpoint URI as path and query parameters. You can also use the Endpoint DSL and DataFormat DSL as a type safe way of configuring endpoints and data formats in Java.
A good practice when configuring options is to use Property Placeholders.
Property placeholders provide a few benefits:
-
They help prevent using hardcoded urls, port numbers, sensitive information, and other settings.
-
They allow externalizing the configuration from the code.
-
They help the code to become more flexible and reusable.
The following two sections list all the options, firstly for the component followed by the endpoint.
Component Options
The Tahu Host Application component supports 12 options, which are listed below.
Name | Description | Default | Type |
---|---|---|---|
MQTT client ID length check enabled. | false | boolean | |
Required MQTT client ID to use for all server definitions, rather than specifying the same one for each. Note that if neither the 'clientId' parameter nor an 'MqttClientId' are defined for an MQTT Server, a random MQTT Client ID will be generated automatically, prefaced with 'Camel'. | String | ||
MQTT connection keep alive timeout, in seconds. | 30 | int | |
Delay before recurring node rebirth messages will be sent. | 5000 | long | |
Required MQTT server definitions, given with the following syntax in a comma-separated list: MqttServerName:(MqttClientId:)(tcp/ssl)://hostname(:port),… | String | ||
Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean | |
Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean | |
To use a shared Tahu configuration. | TahuConfiguration | ||
Password for MQTT server authentication. | String | ||
SSL configuration for MQTT server connections. | SSLContextParameters | ||
Enable/disable global SSL context parameters use. | false | boolean | |
Username for MQTT server authentication. | String |
Endpoint Options
The Tahu Host Application endpoint is configured using URI syntax:
tahu-host:hostId
With the following path and query parameters:
Query Parameters (11 parameters)
Name | Description | Default | Type |
---|---|---|---|
MQTT client ID length check enabled. | false | boolean | |
Required MQTT client ID to use for all server definitions, rather than specifying the same one for each. Note that if neither the 'clientId' parameter nor an 'MqttClientId' are defined for an MQTT Server, a random MQTT Client ID will be generated automatically, prefaced with 'Camel'. | String | ||
MQTT connection keep alive timeout, in seconds. | 30 | int | |
Delay before recurring node rebirth messages will be sent. | 5000 | long | |
Required MQTT server definitions, given with the following syntax in a comma-separated list: MqttServerName:(MqttClientId:)(tcp/ssl)://hostname(:port),… | String | ||
Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean | |
To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | ExceptionHandler | ||
Sets the exchange pattern when the consumer creates an exchange. Enum values:
| ExchangePattern | ||
Password for MQTT server authentication. | String | ||
SSL configuration for MQTT server connections. | SSLContextParameters | ||
Username for MQTT server authentication. | String |
Message Headers
The Tahu Host Application component supports 5 message header(s), which is/are listed below:
Name | Description | Default | Type |
---|---|---|---|
CamelTahuMessageType (consumer) Constant: | The Sparkplug message type of the message. Enum values:
| String | |
CamelTahuEdgeNodeDescriptor (consumer) Constant: | The Sparkplug edge node descriptor string source of a message or metric. | String | |
CamelTahuMessageTimestamp (consumer) Constant: | The timestamp of a Sparkplug message. | Long | |
CamelTahuMessageUUID (consumer) Constant: | The UUID of a Sparkplug message. | UUID | |
CamelTahuMessageSequenceNumber (consumer) Constant: | The sequence number of a Sparkplug message. | Long |