RabbitMQ source
The RabbitMQ source connects Scenid directly to a queue on your own RabbitMQ broker and consumes its messages continuously. Every message becomes a document. Charts, dashboards and APIs update as messages arrive.
There is nothing to build: no endpoint to call, no consumer to run, no scheduler. You point Scenid at an exchange and a queue, and data flows.
Why it is different
| RabbitMQ source | Other ways to stream data | |
|---|---|---|
| Who pushes? | Nobody. Scenid pulls from your broker | Your code has to call Scenid |
| Infrastructure | Your existing broker | An integration service you write and run |
| Scaling | Several parallel consumers on the same queue | You scale your senders |
| Delivery | Messages are acknowledged after they are indexed, so nothing is lost | Depends on your code |
| Visibility | Live queue depth in the app | You build monitoring |
| Backpressure | The queue buffers while Scenid catches up | You handle retries |
It fits when events already flow through RabbitMQ (IoT gateways, order events, audit streams, integration buses) and you want them in dashboards and APIs without writing glue code.
Set it up
- In the Insights app, create a new source and choose RabbitMQ.
- Enter the connection settings (below).
- Choose Test connection. Scenid connects, declares the exchange and queue and binds them, and reports success or the error.
- Create the source.
Connection settings
| Setting | Description |
|---|---|
| Host | Broker URL, for example amqp://broker.example.com:5672 |
| Virtual host | The vhost |
| Username, Password | Credentials. The password is stored encrypted |
| Exchange name | The exchange to consume from |
| Exchange type | direct, topic or fanout |
| Exchange is durable | Match how the exchange exists on your broker |
| Queue name | The queue Scenid reads |
| Routing key | Binding of the queue to the exchange. Default * |
| Queue is durable | Match your broker |
| Number of test messages | How many messages to sample for field detection. Default 50 |
Give Scenid its own user on the broker with permission to configure, write and read the exchange and queue it uses.
First data, field detection, start
After creation Scenid samples messages for up to ten seconds to detect the fields. The sampled messages are put back on the queue, so none are skipped. Then:
- Open the Data tab and review the detected fields. All fields start as
string, set the right types (float,integer,boolean,date-iso,geo-point, …). - Set duplicate control if messages can be delivered more than once (see below).
- Choose Start import.
While the queue is empty the source says no data has arrived. As soon as messages come in, the import starts by itself.
Messages
- The message body must be JSON.
- Nested objects are flattened with
_({ "gps": { "lat": 1 } }becomesgps_lat). Arrays are stored as text. - If the body has a top-level object
messageorMessage, that object is used as the document. This unwraps envelopes such as SNS. - A field named
_idin the body is ignored. - Oversized documents are skipped and logged.
{
"timestamp": "2026-09-01T12:00:00Z",
"deviceId": "SENS-HH-01",
"site": "Hamburg Warehouse",
"temperature": 21.4,
"humidity": 47.5,
"batteryPct": 96,
"location": "53.5453,9.9937",
"alarm": false
}
Delivery guarantees
- Scenid reads in batches: by default up to 5,000 messages or five seconds, whichever comes first, and writes the batch in bulk.
- Messages are acknowledged after they are indexed. If indexing fails, the messages go back on the queue. Delivery is therefore at least once.
- Because a message can arrive twice, set duplicate control:
- Hash (default): identical messages overwrite each other, so a redelivery is harmless.
- Field: choose a field that identifies the record (for example
deviceIdplus a timestamp field, or an event id) so a new message with the same key updates the document.
- Parallel consumers: each source runs several consumers on the same queue (by default up to four) to keep up with high rates.
Invalid values
A message whose values do not fit the field type (for example "n/a" in a float field) is not retried and not blocked. The problem is counted and listed in the Warnings tab with samples, and the message is acknowledged. Fix the field type or the publisher.
Messages that are not valid JSON are not processed and remain unacknowledged on the queue. Scenid does not dead-letter them, so make sure publishers send JSON, or route failures on the broker side.
New fields appear automatically
If a message contains a field Scenid has not seen, it is added as a disabled text field, and the source shows "New data fields were detected. Please review the field configuration." with an option to activate them all. Nothing breaks when a publisher adds a field.
Idle behaviour
After a period without messages (five minutes by default) the source goes to SUCCESSFUL. It resumes to RUNNING when the next message arrives.
Monitor
- The Information tab shows the queue depth (messages waiting) and ingest progress, throughput per minute and per day, and recent events.
- Warnings collects value problems.
- The Connection tab shows the parameters. Editing them re-tests the connection and restarts the consumers.
Read-only
Documents from a RabbitMQ source cannot be created, edited or deleted in Scenid (data belongs to the queue). Everything you can do with a source still works: aggregate from REST and the SDK, charts and dashboards, CSV export, joins, transforms. Use Reset data to clear the documents.
Try it with the sample data
The test data contains 80 JSON messages (rabbitmq-sensor-messages.jsonl) and a publisher script for your own broker:
yarn add amqplib
RABBIT_URL=amqp://user:pass@localhost:5672/insights \
RABBIT_EXCHANGE=sensor-events RABBIT_ROUTING_KEY=readings \
node publish-rabbitmq.mjs ../rabbitmq-sensor-messages.jsonl 200
Create the RabbitMQ source with exchange sensor-events (type topic), queue sensor-readings and routing key readings. Then publish. Watch the documents arrive.
Read the data in code
import sdk from '@scenid/cloud-sdk'
const { result } = await sdk.asAdmin().Insights().Source('Sensor stream').aggregate({
size: 20,
sort: [{ timestamp: 'desc' }],
filter: [{ term: { alarm: true } }]
})
The source is available to dashboards and APIs the moment the first message has been indexed.