Configuring Connection Details
This section provides instructions for configuring the connection details required to establish communication between the Micro-Integration and your third-party system.
For information about configuring the connection to the event broker, see Connecting to Your Event Broker .
For information about configuring error handling, see Error Handling.
This Micro-Integration supports workflows in the following direction:
-
Solace to MongoDB
The name of the binder for MongoDB is mongodb.
To share settings across all workflows in a Micro-Integration, configure the binder-specific parameters under default at the binder level instead of under a workflow-specific identifier (for example, input-0) in bindings. This reduces repetition when multiple workflows use the same parameter values. Workflow-specific settings override default settings when both are present.
Note that default is a sibling of bindings; it is not nested under bindings. Use the same hierarchy under default as you use under bindings.<binding-name>. For example, for bindings.input-0.consumer.someProperty=someValue the default setting is default.consumer.someProperty=someValue.
spring:
cloud:
stream:
<binder-name>:
default:
<shared parameters>
bindings:
input-0:
<workflow-specific parameters>
Prerequisites
-
The target MongoDB database and collection must already exist. This Micro-Integration does not automatically create databases or collections.
-
The database user specified in the connection configuration must have the necessary privileges to perform write operations on the target collection.
-
Message payloads must be JSON objects (or a single-element JSON array). The Micro-Integration converts the payload to a MongoDB document before writing.
-
If you want the Micro-Integration to update existing documents in
UPSERTmode (the default), ensure each message payload includes an_idfield that matches the target document. If the payload does not include an_idfield, MongoDB generates a new unique_idand always inserts a new document. InINSERTmode, the Micro-Integration always inserts a new document regardless of whether the payload contains an_idfield; if it does not, MongoDB generates one automatically.
MongoDB Connection Details
The following table lists the configuration options for connecting to MongoDB. These properties must be prefixed with mongodb in your application.yml file. The MongoDB Micro-Integration supports two authentication options:
# Option 1: Username/password authentication mongodb: connection-string: mongodb://<host>:<port> database-name: <database-name> # Optional username: <username> password: <password> auth-database: <auth-database> # Optional; defaults to admin # Option 2: TLS/mTLS authentication mongodb: connection-string: mongodb://<host>:<port> database-name: <database-name> # Optional tls-enabled: true trust-store-path: /path/to/truststore.p12 trust-store-password: <trust-store-password> # key-store-path: /path/to/client.p12 # Optional; required for mTLS # key-store-password: <key-store-password> # Optional; required for mTLS
| Config Option | Type | Valid Values | Default Value | Description |
|---|---|---|---|---|
|
|
|
Required. The MongoDB connection URI (for example, |
||
|
|
|
Optional. The default MongoDB database name. Can be overridden per-workflow via the |
||
|
|
|
Optional. The username for SCRAM authentication with the MongoDB database. Required for username/password authentication. |
||
|
|
|
Optional. The password for SCRAM authentication with the MongoDB database. Required for username/password authentication. |
||
|
|
|
|
Optional. The MongoDB database where the user is defined. |
|
|
|
|
|
|
Optional. When |
|
|
|
Optional. Required when TLS is enabled. The path to the PKCS12 trust store containing the CA certificate used to validate the MongoDB server. |
||
|
|
|
Optional. Required when TLS is enabled. The password for the PKCS12 trust store. |
||
|
|
|
Optional. The path to the PKCS12 key store containing the client certificate and private key for mutual TLS. |
||
|
|
|
Optional. The password for the PKCS12 key store. |
MongoDB Binder Configuration Options
The following configuration options are available for MongoDB producers. Prefix the destination property with spring.cloud.stream.bindings.output-<workflow-id>. Prefix the operation property with spring.cloud.stream.mongodb.bindings.output-<workflow-id>.producer.endpoint.query-parameters.
| Config Option | Type | Valid Values | Default Value | Description |
|---|---|---|---|---|
|
|
|
Required. The target MongoDB collection in |
||
|
|
|
|
|
Optional. Specifies the write behavior for the collection. |
Supported Payload Types
The MongoDB Micro-Integration accepts the following payload types. All payload types are internally converted to a document before being written to MongoDB.
| Payload Type | Description |
|---|---|
|
Map |
A |
|
List |
A |
|
JSON String |
A JSON object or single-element JSON array encoded as a |
|
JSON Bytes |
A JSON object or single-element JSON array encoded as a UTF-8 |
If a field in the payload is null or absent, that field is not included in the UPSERT operation.