Event Hub Publisher Block Config
The Event Hub Publisher block can be instantiated by using the block type eventhub.
block is in the Cloud Gateway. config portion of the block configuration) for the eventhub block are as follows:| Field | Type | Required | Default |
|---|---|---|---|
| log_name | String | no | <block name> |
| log_level | String | no | 'off' |
| mqtt/transport_addr | String | yes | |
| mqtt/qos | Integer | no | 0 |
| mqtt/client_id | String | no | |
| mqtt/topics | Array of Strings | yes | |
| store_forward | Object | yes | |
| store_forward/max_store_percent | Integer | no | 10 |
| store_forward/max_batch_interval | Integer | no | 1000 |
| eventhub/transport_addr | String | yes | |
| eventhub/predix_zone_id | String | yes | |
| eventhub/token_file | String | yes | |
| eventhub/topic_map | Array of Objects | yes |
The following is a sample block config for the eventhub block. This should be placed in the blocks section of the overall configuration file.
The block below is configured to subscribe to the MQTT topic input_data on the Predix Edge Broker and publish all data received from that topic to the Event Hub topic output_data on a Predix Time Series instance with the Predix Zone ID xxx-xxx at the URL event-hub-aws-usw02.data-services.predix.io:443.
event_hub_sender, but it can be any string you wish to use."event_hub_sender": {
"type": "eventhub",
"config": {
"log_name": "eventhub_block",
"log_level": "debug",
"mqtt": {
"transport_addr": "mqtt-tcp://predix-edge-broker",
"qos": 1,
"client_id": "event_hub_mqtt_client0",
"topics": [
"input_data"
]
},
"store_forward": {
"max_store_percent": 30,
"max_batch_interval": 2000
},
"eventhub": {
"transport_addr": "event-hub-aws-usw02.data-services.predix.io:443",
"predix_zone_id": "xxx-xxx",
"token_file": "/edge-agent/access_token",
"topic_map": [
{
"eventhub_topic": "output_data",
"mqtt_topics": [
"input_data"
]
}
]
}
}
}log_level and log_name
For details on the log_level and log_name fields of the Event Hub Publisher block's config section, see Common Block Config Fields.
mqtt
For details on fields within the mqtt portion of the Event Hub Publisher block's config section, see Common Block Config Fields.
store_forward/max_store_percent and store_forward/max_batch_interval
For details on the store_forward/max_store_percent and store_forward/max_batch_interval fields of the Event Hub Publisher block's config section, see Common Block Config Fields.
eventhub/transport_addr
The transport_addr field within the eventhub section should be set to the URI of whatever Predix Event Hub instance you wish to publish data to.
eventhub/predix_zone_id
The predix_zone_id field within the eventhub section should be set to the Predix Zone ID of whatever Predix Event Hub instance you wish to publish data to.
eventhub/token_file
The token_file field within the eventhub section should be set to the path to the file on your Predix Edge device that holds your UAA token for authentication with your Predix Event Hub instance.
eventhub/topic_map
proxy_url field within the eventhub section specifies how data will be forwarded from input MQTT topics to output Event Hub topics. This section is an array of objects with the following fields:| Field | Type | Required |
|---|---|---|
| eventhub_topic | String | yes |
| mqtt_topics | Array of Strings | yes |
mqtt_topics field of one object will be published to the Event Hub topic in the eventhub_topic field of that same object.topics list in the mqtt section of the block's config section.