Comment on page
MongoDB
MongoDB publisher transport emits processed events into a defined database collection. Events are serialised using either the provided Document Formatter serializer or a custom transformer implementation.
org.mongodb:mongodb-driver-sync:4.8.1
mongodbPublisher:
servers:
localhost: 27017
enable ssl: false
database: customerdb
collection: emea_customers
ordered inserts: true
credentials:
user: joule
password: password
mechanism: SCRAM_SHA_1
serializer:
batch: false
formatter:
documentFormatter:
contentType: application/octet-stream
encoding: base64
Configuration parameters available for the MongDB publisher transport.
Attribute | Description | Data Type | Required |
---|---|---|---|
database | Name of database | String | |
collection | Name of collection inserts will be applied to | String | |
ordered inserts | Hint to MongDB to insert documents using presented ordering | Boolean Default: true | |
servers | Map of servers with associated ports | Map<String,Integer> | |
enable ssl | Enable SSL | boolean Default: false | |
credentials | Credential configuration | See Credential Attributes section | |
serializer | Serialization configuration | See Serialization Attributes section |
Attribute | Description | Data Type | Required |
---|---|---|---|
username | Username | String | |
password | password | String | |
authenication database | Database to use to authenicate connected user | String Default: admin | |
mechanism | Authenication mechanism Options
| String Default: SCRAM_SHA_1 |
This topic provides configuration parameters available object serialization 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 |
The configuration below will serialize StreamEvents as MongoDB documents.
serializer:
batch: false
formatter:
documentFormatter:
contentType: application/octet-stream
encoding: base64
Joule ships with a MongoDB document formatter which converts a StreamEvents in to a MongoDB Document type.
Last modified 2mo ago