Send data from Litmus Edge to Zerobus Ingest
For every connector field, see the Databricks Zerobus Ingest integration guide in Litmus's documentation. For the workspace URL and endpoint steps, see Get your workspace URL and Zerobus Ingest endpoint. For the service principal requirements, see Configure authentication.
Maintained by: Litmus, in the Litmus Edge documentation.
Use this page to publish DeviceHub tag data from Litmus Edge into Unity Catalog Delta tables.
When to use this connector
- You run Litmus Edge and want DeviceHub tag data in a Unity Catalog table.
- You want to send custom JSON from Litmus Edge Analytics or Digital Twins to a table. The steps are the same, and you define the table columns to match your payload.
How it works
- Direction: Outbound only. Inbound subscriptions aren't supported. Each outbound topic sends one DeviceHub tag or topic from Litmus Edge to a Databricks table.
- Table: You create the table in Databricks. The example in Step 6 matches the DeviceHub tag payload. For custom JSON, define the columns to match your payload.
- Authentication: The connector authenticates with the client ID and OAuth secret of a service principal.
Requirements
- Litmus Edge with the Databricks Zerobus Ingest connector.
- A Databricks workspace in a region that supports Zerobus Ingest. See Availability.
- A cloud storage bucket or container for the external location. See Step 1.
- A target table that meets the Table requirements.
- Access to create the objects in Steps 1 to 6, and to run the
GRANTstatements in Step 7.
Create a cloud storage bucket
Create a cloud storage bucket or container for your Databricks deployment. This storage is the external location for your catalog. Note its URI for Step 2. The documentation for your storage service describes how to create a bucket or container.
Don't secure the storage through a private endpoint. Zerobus Ingest doesn't write to storage secured that way. See Limitations.
Create an external location
In your Databricks workspace, create an external location and link it to the bucket or container from Step 1. See Create an external location.
Create a service principal and an OAuth secret
- Create a service principal in your workspace. See Manage service principals.
- Generate an OAuth secret for the service principal.
- Record the client ID, a UUID, and the OAuth secret. You enter both in Step 8. The secret is displayed only at creation time, so store it securely.
Zerobus Ingest also requires the Workspace access entitlement on the service principal. On the service principal's Configurations tab, make sure this entitlement is selected. See Configure authentication.
Create a catalog
Create a catalog backed by the external location from Step 2. See Create a catalog.
Don't use a catalog whose storage location is Default Storage. The Litmus connector requires a catalog backed by an explicit external location.
Create a schema
In the catalog, create a schema, or use the default schema that Databricks creates. See Create a schema.
Create a table
Create a table whose columns match the data fields that Litmus Edge publishes. The following example matches the DeviceHub tag payload and ends with a recommended rescue column:
CREATE TABLE IF NOT EXISTS <catalog>.<schema>.<table> (
success BOOLEAN,
datatype STRING,
timestamp BIGINT,
registerId STRING,
value DOUBLE,
deviceID STRING,
tagName STRING,
deviceName STRING,
description STRING,
metadata VARIANT,
rescue VARIANT
);
Replace <catalog> and <schema> with the names from Step 4 and Step 5, and <table> with a table name of your choice. For identifier rules, see Databricks identifiers and CREATE TABLE.
Then apply the zerobus-rescue tag to the rescue column:
ALTER TABLE <catalog>.<schema>.<table>
ALTER COLUMN rescue SET TAGS ('zerobus-rescue');
Zerobus Ingest stores a field that the table doesn't define, or a value of the wrong type in a nullable column, in rescue instead of rejecting the record. The tag can take up to 5 minutes to take effect. See Zerobus rescue column.
Grant permissions to the service principal
Run these statements in your workspace, replacing <catalog>, <schema>, <table>, and <client-id> with your values:
GRANT USE CATALOG ON CATALOG <catalog> TO `<client-id>`;
GRANT USE SCHEMA ON SCHEMA <catalog>.<schema> TO `<client-id>`;
GRANT MODIFY, SELECT ON TABLE <catalog>.<schema>.<table> TO `<client-id>`;
For the privilege model, see Unity Catalog privileges reference.
Steps 8 to 10 happen in Litmus Edge.
Add the Databricks Zerobus Ingest connector
Follow the steps to add a connector in Litmus Edge, and select the Databricks Zerobus Ingest connector provider. Configure these parameters:
Parameter | Value |
|---|---|
Name | The name of the connector. |
Workspace URL | The URL of your Databricks workspace, |
Zerobus Ingest URL | The Zerobus Ingest URL for your workspace. See Get your workspace URL and Zerobus Ingest endpoint to find the values. |
Client ID | The client ID of the service principal from Step 3. |
OAuth Secret | The OAuth secret generated for the service principal in Step 3. |
Catalog | The catalog from Step 4. |
Schema | The schema from Step 5, for example |
Default Table | The table from Step 6. |
The Zerobus Ingest URL uses this format:
<workspace-id>.zerobus.<region>.cloud.databricks.com
Enable the connector
Click the toggle in the connector tile to enable the connector. If the connector shows a Failed status, review the connector page and the relevant error messages.
Add an outbound topic
- Click the connector tile. The connector Dashboard appears.
- Click the Topics tab.
- Click the Add a new topic icon. The Data Integration dialog box appears.
- Configure these parameters:
- Data Direction: Select Local to Remote - Outbound.
- Local Data Topic: Select the DeviceHub tag or topic in Litmus Edge that you want to publish.
- Remote Data Topic (optional): Enter the name of the Databricks table for this topic. If you leave it empty, data goes to the Default Table from Step 8. If you enter a different table, create it and grant the service principal access to it first, as in Step 6 and Step 7.
- Enable: Turn on the toggle to enable the topic.
- Click OK to add the topic.
- On the connector tile, check that the connector shows a CONNECTED status and that the topic shows an Enabled status.
Verify data in Databricks
In Databricks, open the target catalog, schema, and table, and run this query:
SELECT * FROM <catalog>.<schema>.<table>
ORDER BY timestamp DESC
LIMIT 100;
Confirm that rows appear with values from your Litmus Edge tags. You can also check ingestion activity in the Databricks SQL Editor, or check the table's data freshness in Unity Catalog.
Troubleshooting
Symptom | Cause | Fix |
|---|---|---|
The connector shows a Failed status. | The Litmus guide doesn't list causes for this status. | Review the connector page and the relevant error messages in Litmus Edge. |
You created the catalog on Default Storage. | The connector requires a catalog backed by an explicit external location. | Create a catalog backed by an external location, as in Step 4. |
Litmus Edge doesn't receive data from Databricks. | The connector is outbound only. | Add outbound topics with Data Direction set to Local to Remote - Outbound, as in Step 10. |
Additional resources
- Zerobus Ingest errors: the error codes that Zerobus Ingest returns.
- Zerobus Ingest quotas: region availability and delivery guarantees.
- Zerobus Ingest release stages: the release stage of each Zerobus Ingest interface.