DataHub NATS topics
3 min
NATS Topics
Read live values published to Litmus Edge's internal NATS broker.
Tool | Description |
|---|---|
get_current_value_from_topic * | Subscribe to a NATS topic and return the next published message. |
get_multiple_values_from_topic * | Collect multiple sequential values from a NATS topic for trend analysis. |
When to use which
- Spot read: get_current_value_from_topic for the next message on a topic. Useful when DeviceHub publishes tag values you want to inspect without persisting them.
- Short window of samples: get_multiple_values_from_topic to collect N consecutive messages for a quick trend check. For longer or historical windows, use InfluxDB / Time Series tools instead.
Both tools open a NATS subscription, wait for messages, then drain and close cleanly.
Requirements
- NATS_SOURCE, NATS_PORT, NATS_USER, NATS_PASSWORD headers.
- NATS_TLS defaults to true; set to false if your broker is non-TLS.
Setting up NATS access on Litmus Edge
- Navigate to Litmus Edge -> System -> Access Control -> Tokens.
- Create or configure an access token with permissions for the topics you want to read.
- Provide the token username and value as NATS_USER / NATS_PASSWORD in your MCP client configuration.
Related
- DeviceHub, Tags - the tag output topic is what these tools subscribe to.
- InfluxDB / Time Series for historical analysis.