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.

This connector supports workflows in the following directions:

  • Solace to Azure Cosmos DB

For more information about workflows, see Enabling Workflows and Managing Workflows.

The name of the binder for Azure Cosmos DB is cosmosdb.

Azure Cosmos DB Connection Details

To configure the Azure Cosmos DB connection details, set the following values in the application.yml file:

cosmosdb:
  bindings:
    <outputname>:
      producer:
        endpoint:
          query-parameters:
            databaseEndpoint: <database-url>
            accountKey: <account-key>
            containerPartitionKeyPath: <partition-key>

Where:

  • databaseEndpoint is the Azure Cosmos DB database endpoint URL, in the following format:

    localhost:8081 or https://<account-name>.documents.azure.com:443/

  • accountKey is the Azure Cosmos DB account key for authentication.

  • containerPartitionKeyPath is the name of the payload field to use as the partition key (for example, uniqueId). The partition key determines how data is distributed across partitions in the Azure Cosmos DB container.

    Hierarchical partition keys are not supported.

You can also specify the following optional query-parameters:

Parameter Type Valid Values Description
container-name String Any valid container name. The default Azure Cosmos DB container name for operations.
operation String upsertItem The Azure Cosmos DB operation to perform.
autoDiscoverContainer boolean (true | false) Specifies whether to automatically discover container settings.
preferredRegions String Comma-separated region names The preferred Azure regions for Azure Cosmos DB operations.

Azure Cosmos DB Producer Configuration Options

The following configuration options are available for the Azure Cosmos DB producer.

Prefix this property with spring.cloud.stream.cosmosdb.default.producer.endpoint.:

Parameter Type Valid Values Description
exchange-pattern String InOnly Message exchange pattern.

Prefix the following properties with spring.cloud.stream.cosmosdb.bindings.<outputname>.producer.endpoint.:

Parameter Type Valid Values Description
transacted boolean (true | false)

Specifies whether to use transacted routes:

  • true—Use transacted routes. Acknowledgments are sent on commit (successful write to the database). Default. Best for high-reliability use cases requiring exactly-once semantics.

  • false—Use non-transacted routes. Acknowledgments are sent on insert (when processing begins). Best for high throughput, lower latency scenarios.

Connecting to Multiple Systems

To connect to multiple systems of a same type, use the multiple binder syntax.

For example:

spring: 
  cloud:
    stream: 
      binders:
        
        # 1st solace binder in this example 
     solace1:
          type: solace 
       environment: 
         solace: 
           java:
             host: tcp://localhost:55555
         
     # 2nd solace binder in this example 
     solace2:
          type: solace 
          environment: 
            solace: 
           java:
             host: tcp://other-host:55555
        
     # The only cosmosdb binder 
     cosmosdb1:
          type: cosmosdb
       # Add `environment` property map here if you need to customize this binder. 
       # But for this example, we'll assume that defaults are used.
          
     # Required for internal use 
     undefined:
          type: undefined 
     bindings:
          input-0:
            destination: <input-destination> 
         binder: cosmosdb1
          output-0:
            destination: <output-destination>
            binder: solace1 # Reference 1st solace binder 
       input-1:
            destination: <input-destination> 
         binder: cosmosdb1
          output-1:
            destination: <output-destination>
            binder: solace2 # Reference 2nd solace binder

The configuration above defines two binders of type solace and one binder of type cosmosdb, which are then referenced within the bindings.

Each binder above is configured independently under spring.cloud.stream.binders.<bindername>.environment..

  • When connecting to multiple systems, all binder configuration must be specified using the multiple binder syntax for all binders. For example, under the spring.cloud.stream.binders.<binder-name>.environment.

  • Do not use single-binder configuration (for example, solace.java.* at the root of your application.yml) while using the multiple binder syntax.