Connector Configuration

Providing Configuration

For information about about how the connector detects configuration properties, see Spring Boot: Externalized Configuration.

Converting Canonical Spring Property Names to Environment Variables

For information about converting the Spring property names to environment variables, see the Spring documentation.

Spring Profiles

If multiple configuration files exist within the same configuration directory for use in different environments (development, production, etc.), use Spring profiles.

Using Spring profiles allow you to define different application property files under the same directory using the filename format, application-{profile}.yml.

For example:

  • application.yml: The properties in non-specific files that always apply. Its properties are overridden by the properties defined in profile-specific files.
  • application-dev.yml: Defines properties specific to the development environment.
  • application-prod.yml: Defines properties specific to the production environment.

Individual profiles can then be enabled by setting the spring.profiles.active property. See Spring Boot: Profile-Specific Files for more information and an example.

Configuring Locations to Find Spring Property Files

By default, the connector detects any Spring property files as described in the Spring Boot’s default locations.

  • If you want to add additional locations, add --spring.config.additional-location=file:<custom-config-dir>.

  • If you want to exclusively use the locations that you’ve defined and ignore Spring Boot’s default locations, add --spring.config.location=optional:classpath:/,optional:classpath:/config/,file:<custom-config-dir>.

For an example of the command to add additional locations, see Quick Start: Running the Connector Using the Command Line.

For more information about configuring locations to find Sprint property files, see Spring Boot documentation.

If you want configuration files for multiple, different connectors within the same config directory for use in different environments (such as, development, production, etc.), we recommend that you use Spring Boot Profiles instead of child directories. For example:

  • Set up your configuration like this:

    • config/application-prod.yml
    • config/application-dev.yml

  • Do not do this:

    • config/prod/application.yml
    • config/dev/application.yml

Child directories are intended to be used for merging configuration from multiple sources of confiugration properties. For more information and an example of when you might want to use multiple child directories to compose your application’s configuration, see the Spring Boot documentation.

Obtaining Build Information

For connector versions 2.0.0 and later, build information that includes the version, build date, time, and description is enabled by default using the Spring Boot Actuator Info Endpoint. By default, a connector only shares information related to its build.

The following example shows the structure of the output data:

{
"build": {
"version": "<connector version>",
"artifact": "<connector artifact>",
"name": "<connector name>",
"time": "<connector build time>",
"group": "<connector group>",
"description": "<connector description>",
"support": "<support information>"
}
}

If you want to exclude build data from the output of the info endpoint, set management.info.build.enabled to false.

Alternatively, if you want to disable the info endpoint entirely, you can remove info from the list of endpoints specified in management.endpoints.web.exposure.include.

Spring Configuration Options

This connector packages use Spring configuration options to customize functionality that includes Spring Cloud Binder for Solace PubSub+ and other common Spring Boot libraries.

Using the Spring Cloud Binder for Solace PubSub+

An important piece for customizing the Spring configuration options for PubSub+ Self-Contained Connectors is the Spring Cloud Binder for Solace PubSub+. There are configuration options available that you may find useful to configure the connector such as:

  • endpointType, which is a consumer configuration option to configure the type of endpoint (queue or topic endpoint) that consumers read messages from

  • selector, which is a consumer configuration option to configure an endpoint's message selector

  • producer configuration options to publish messages within transacted sessions

  • authentication schemes to connect to a PubSub+ event broker, such as basic authentication (default) , client certificate, or OAuth 2.0

For more information about:

Using Other Spring Boot Libraries

The following are other common references to Spring Boot libraries that you can use to configure your connector that you may find useful:

JMS Binder Configuration Options

The following properties are available at the binder level and are complementary to the properties in Configuring Connection Details.

These properties are to be prefixed with jms-binder.

 

Config Option Type Valid Values Default Value Description

health-check.interval

long

> 0

10000

Interval (in ms) between reconnection attempts while health status is RECONNECTING

healthcheck.reconnectattempts-until-down long >=0 10

The number of reconnection attempts until JMS binder transitions from RECONNECTING to DOWN.

A value of 0 means unlimited number of attempts which means that the binder would never transition to the DOWN state.

healthcheck.reconnectattempts-until-down

long

>= 0

10

The number of reconnection attempts until JMS binder transitions from RECONNECTING to DOWN.

A value of 0 means unlimited number of attempts which means that the binder would never transition to the DOWN state.

jndi.context

java.util. Properties

key/value pairs

 

Standard JNDI properties. See JNDI Context section for details.

jndi.connectionfactory.name

String

 

 

The connection factory’s JNDI name used for the lookup

jndi.connectionfactory.user

String

 

 

The user to authenticate with TIBCO EMS.

jndi.connectionfactory.password

String

 

 

The password to authenticate with the TIBCO EMS.

The properties in the table above are complementary to the properties described in Configuring Connection Details.

JMS Consumer Options

The following configuration options are available to JMS consumers. Options within the same table share the same prefix.

The following options in Config Option are prefixed with  spring.cloud.stream.jms.bindings.<bindingName>.consumer.

 

Config Option Type Valid Values Default Value Description

batch-max-size

int

> -1

50

The maximum number of messages that can be grouped together in a single batch. If a consumer polls for messages and none are available, a partial batch is created.

transacted

boolean

true or false

true

Specifies whether messages are received within a local transaction. When set to true, it indicates that the JMS consumer reads messages within a local transaction and commits the transaction when the batch has been successfully processed.

Set to false to disable transactions. We recommend that you disable transactions because single message transactions (i.e., when batch-max-size=1) lower your performance significantly.

destination-type

String

(queue|topic|unknown)

unknown

The type of destination where messages are consumed from.

queue

The destination value is assumed to be a physical queue and no JNDI lookup is done.

topic

The destination value is assumed to be a physical topic and no JNDI lookup is done. This option requires durable-subscription-name to also be set.

unknown

The destination value is assumed to be a JNDI name. The actual destination name is only known after a successful lookup. A valid JNDI context must be configured via jms-binder.jndi.context.

durablesubscription-name

String

A valid subscription.

None.

The name of the shared durable subscription to consume from. The subscription is created on the broker if it doesn’t already exist.

Applies, and is mandatory, when destination-type is or resolves to a topic.

The following options in Config Option are prefixed with spring.cloud.stream.bindings.<bindingName>.consumer.

 

Config Options Type Valid Values Default Value Description

concurrency

int

> 0

1

The number of concurrent consumers to create.

If a configuration option applies to all JMS input bindings, it can be prefixed with either:

  • spring.cloud.stream.jms.default.consumer if the option is from the first table.
  • spring.cloud.stream.default.consumer if the option is from the second table.

The mentioned classes are convenient way to assign a configuration to all JMS input bindings.

JMS Producer Options

The following configuration options are available to JMS producers.

The following options in Config Option are prefixed with spring.cloud.stream.jms.bindings.<bindingName>.producer.

 

Config Option Type Valid Values Default Value Description

destination-type

String

(queue|topic|unknown)

unknown

The type of destination where messages are published to.

queue

The destination value is assumed to be a physical queue and no JNDI lookup is done.

topic

The destination value is assumed to be a physical topic and no JNDI lookup is done.

unknown

The destination value is assumed to be a JNDI name. The actual destination name is only known after a successful lookup. A valid JNDI context must be configured via jms-binder.jndi.context.

transacted

boolean

true or false

true

Specifies whether the JMS producer publishes messages from a received batch using a local transaction.

Setting transacted to true provides duplicate protection in case of producer failures. Set to false to disable transactions.

If a configuration option applies to all JMS output bindings, it can be prefixed with spring.cloud.stream.jms.default.producer. This prefix is a convenient way to assign a configuration to all JMS output bindings.

Connector Configuration Options

The following table lists the configuration options. The following options in Config Option are prefixed with solace.connector.:

Config Option Type Valid Values Default Value Description

management.leader-
election.fail-over.max-attempts

int

> 0

3

The maximum number of attempts to perform a fail-over.

management.leader-
election.fail-over.back-off-initial-interval

long

> 0

1000

The initial interval (milliseconds) to back-off when retrying a fail-over.

management.leader-
election.fail-over.back-off-max-interval

long

> 0

10000

The maximum interval (milliseconds) to back-off when retrying a fail-over.

management.leader-election.fail-over.back- off-multiplier

double

>= 1.0

2.0

The multiplier to apply to the back-off interval between each retry of a fail-over.

management.leader- election.mode

enum

(standalone|active_active|
active_standby)

standalone

The connector’s leader election mode.

standalone: A single instance of a connector without any leader election capabilities.

active_active: A participant in a cluster of connector instances where all instances are active.

active_standby: A participant in a cluster of connector instances where only one instance is active (i.e. the leader), and the others are standby.

management.queue

string

any

null

The management queue name.

management.session.*

 

See Spring Boot Auto-Configuration for the Solace Java API

 

Defines the management session. This has the same interface as that used by solace.java.*.

See Spring Boot Auto-Configuration for the Solace Java API for more information.

security.enabled

boolean

(true|false)

true

If true, security is enabled. Otherwise, anyone has access to the connector’s endpoints.

security.csrf-enabled

(Only for versions earlier than 2.0.0)

boolean

(true|false)

true

If true, CSRF protection is enabled. Makes sense only if solace.connector.security.enabled is true.

security.users[<index>].name

string

any

null

The name of the user.

security.users[<index>].password

string

any

null

The password for the user.

security.users[<index>].roles

list<string>

admin

empty list (i.e. read- only)

The list of roles that the specified user has. It has read-only access if no roles are returned.

Workflow Configuration Options

These configuration options are defined under the following prefixes:

  • solace.connector.workflows.<workflow-id>.: If the options support per-workflow configuration and the default prefixes.
  • solace.connector.default.workflow.: If the options support default workflow configuration.
Config Option Applicable Scopes Type Valid Values Default Value Description

enabled

Per-Workflow

boolean

(true|false)

false

If true, the workflow is enabled.

transform-headers.expressions

Per-Workflow Default

Map<string,string>

Key: A header name.

Value: A SpEL string that accepts headers as parameters.

empty map

A mapping of header names to header value SpEL expressions.

The SpEL context contains the headers parameter that can be used to read the input message’s headers.

acknowledgment.publish-async

Per- Workflow
Default

boolean

(true|false)

false

If true, publisher acknowledgment processing is done asynchronously.

The workflow’s consumer and producer bindings must support this mode, otherwise the publisher acknowledgments are processed synchronously regardless of this setting.

acknowledgment.back- pressure-threshold

Per-Workflow
Default

int

>= 1

255

The maximum number of outstanding messages with unresolved acknowledgments.

Message consumption is paused when the threshold is reached to allow for producer acknowledgments to catch up.

acknowledgment.publish-timeout

Per-Workflow
Default

int

>= -1

600000

The maximum amount of time (in milliseconds) to wait for asynchronous publisher acknowledgments before considering a message as failed. A value of -1 means to wait indefinitely for publisher acknowledgments.