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 Micro-Integration supports workflows in the following directions:
-
Solace to Azure Service Bus
-
Azure Service Bus to Solace
The name of the binder for Azure Service Bus is servicebus.
To share settings across all workflows in a Micro-Integration, configure the parameters using default instead of a workflow-specific identifier (for example, input-0). This reduces repetition when multiple workflows use the same parameter values. Workflow-specific settings override default settings when both are present.
Azure Service Bus Connection Details
Spring Cloud Azure for the Azure Service Bus supports various methods for authentication to ensure secure and flexible integration options. The following approaches are the most commonly used methods to authenticate with Azure Service Bus within your Spring application.
The configuration steps for each method require you to replace placeholders (for example, ${SERVICEBUS_NAMESPACE_CONNECTION_STRING}, ${AZURE_CLIENT_ID}, and so on) with actual values from your Azure environment.
Connection String Authentication
This method utilizes a connection string obtained from the Azure portal for the Azure Service Bus namespace:
spring:
cloud:
azure:
servicebus:
connection-string: ${SERVICEBUS_NAMESPACE_CONNECTION_STRING}
The connection string must provide one of:
-
a Shared Access Key (
SharedAccessKeyNameandSharedAccessKey), for example:Endpoint=sb://<SERVICE_BUS_NAMESPACE>.servicebus.windows.net/;SharedAccessKeyName=<POLICY_NAME>;SharedAccessKey=<SHARED_KEY>
-
OR, a Shared Access Signature (
SharedAccessSignature), for example:Endpoint=sb://<SERVICE_BUS_NAMESPACE>.servicebus.windows.net/;SharedAccessSignature sig=<signature-string>&se=<expiry>&skn=<keyName>&sr=<URL-encoded-resourceURI>
AMQP connection strings are not supported.
Service Principal with Client Secret
This method uses a Microsoft Entra ID service principal with a client secret:
spring:
cloud:
azure:
credential:
client-id: ${AZURE_CLIENT_ID}
client-secret: ${AZURE_CLIENT_SECRET}
profile:
tenant-id: ${TENANT_ID}
subscription-id: ${AZURE_SUBSCRIPTION_ID} # Optional, only if resource provisioning is needed
servicebus:
namespace: ${SERVICEBUS_NAMESPACE}
When using a service principal, ensure that your application has the necessary permissions to access the Azure Service Bus resources. This might involve configuring Microsoft Entra ID roles and permissions accordingly.
For more information on the supported authentication methods for Spring Cloud Azure, see Spring Cloud Azure Authentication.
Azure Service Bus Binder Configuration Options
The following properties are available at the Azure Service Bus binder level. These properties are to be prefixed with spring.cloud.stream.servicebus.bindings.<inputname>.consumer. for source bindings and spring.cloud.stream.servicebus.bindings.<outputname>.producer. for target bindings.
Azure Service Bus Producer Configuration Options
The following configuration options are available for the Azure Service Bus producers.
| Config Option | Type | Valid Values | Default Values | Description |
|---|---|---|---|---|
|
|
|
|
|
The type of Azure Service Bus entity to produce messages to. |
sync
|
boolean
|
[true|false]
|
false
|
Indicates whether to publish messages synchronously from Azure Service Bus. A value of false specifies to publish messages asynchronously, otherwise a value of true specifies to publish messages synchronously |
send-timeout
|
long
|
Any valid long value |
10000
|
The timeout (in milliseconds) for a producer send operation. |
Azure Service Bus Consumer Configuration Options
The following configuration options are available for the Azure Service Bus consumers.
| Config Option | Type | Valid Values | Default Values | Description |
|---|---|---|---|---|
|
|
|
|
|
The type of Azure Service Bus entity to consume messages from. |
|
|
|
|
|
Indicates whether a message is
acknowledged. The value of falseindicates that messages are acknowledged only after being
successfully produced to the Solace event broker. When set to true, messages are automatically
completed after retrieval. |
Solace recommends keeping auto-complete to false as the default. If set to true, messages are acknowledged
upon retrieval (when removed from the Azure Endpoint). This
could lead to message loss if the Micro-Integration malfunctions.
Advanced Configuration
In addition to the basic configuration options, the Azure Service Bus binder allows for more advanced configurations to fine-tune your application's interaction with Azure Service Bus. For more information, see Spring Cloud Stream Binder for Azure Service Bus Configuration.
Connecting to Multiple Systems
To connect to multiple systems of the 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 servicebus binder
servicebus1:
type: servicebus
# 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: servicebus1
output-0:
destination: <output-destination>
binder: solace1 # Reference 1st solace binder
input-1:
destination: <input-destination>
binder: servicebus1
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 servicebus, 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 yourapplication.yml) while using the multiple binder syntax.