Publish JSON based events to the mature standard document storePublishes JSON-based events to MongoDB, a widely-used document store
Overview
Document database support is provided using the MongoDB Publisher Transport. Processed events are published to a specified MongoDB database collection.
The events are serialised using a document formatter serialiser or a custom transformer implementation.
This transport is designed to facilitate efficient data publishing into MongoDB with customisable serialisation options.
Some key features are:
MongoDB integrationSends processed events to a defined MongoDB collection.
Serialiser optionsUses a default Document Formatter serialiser or allows custom serialisation.
This example sets up the MongoDB Publisher Transport to send events to a local MongoDB instance (localhost:27017).
It stores data in the customerdb database and emea_customers collection, using ordered inserts.
Authentication is done with the joule user and SCRAM-SHA-1 mechanism. Events are serialised individually (not in batches) with Base64 encoding and application/octet-stream content type. SSL is disabled.
This topic provides configuration parameters available object serialisation process.
Attribute
Description
Data Type
Required
transform
User provided implementation
CustomTransformer
formatter
This is used when a custom transformer is not provided. Useful when chaining Joule processes
Formatter
Default: documentFormatter (See Document Formatter)
contentType
Type of content to inform receiving application
String
Default: application/octet-stream
encoding
Payload encoding method
String
Default: base64
batch
Flag to batch multiple messages in to a single payload
Boolean
Default: false
Serialiser example
The configuration below will serialise StreamEvents as MongoDB documents.
Document formatter
The document formatter in Joule is a built-in tool that converts StreamEvents into MongoDB's Document type.
This allows the processed events to be formatted correctly before being inserted into a MongoDB collection. The formatter ensures that the data is serialised in a way that MongoDB can understand and store efficiently.