Configuring Connection Details
This section provides instructions for configuring the connection details required to establish communication between your PubSub+ event broker and your third-party system.
The Spring Cloud Stream Binder for PubSub+ uses Spring Boot Auto-Configuration for the Solace Java API to configure its session. In the application.yml
, this typically is configured as follows:
solace: java: host: tcp://localhost:55555 msg-vpn: default client-username: default client-password: default
For more information and options to configure the PubSub+ session, see Spring Boot Auto-Configuration for the Solace Java API.
Preventing Message Loss when Publishing to Topic-to-Queue Mappings
If the connector is publishing to a topic that is subscribed to by a queue, messages may be lost if they are rejected (for example, if queue ingress is shut down).
To prevent message loss, configure the reject-msg-to-sender-on-discard option with the including-when-shutdown
flag.
SFTP Connection Details
The Spring Cloud Stream standard properties for the Connector for SFTP are as follows.
Config Option | Type | Valid Values | Description |
---|---|---|---|
|
|
Required format:
For example:
|
The source or target SFTP server URI and the directory path. The destination must include the start directory name. |
|
|
|
The SFTP consumer/producer is implemented using the Apache Camel SFTP component. This property must be set to |
SFTP Checkpoint Store Configuration Options
The Connector for SFTP stores the current progress of file processing in a checkpoint store backed by a Last Value Queue (LVQ) on a Solace event broker:
-
For an SFTP Consumer, the checkpoint store contains information about the files that have been processed and the files that are currently being processed.
-
For an SFTP Producer, the checkpoint store contains information about the number of events written to the file and the file size (for file rotation purposes).
The following table lists the configuration options for the SFTP checkpoint store.
Configuration Option | Type | Valid Values | Default Value | Description |
---|---|---|---|---|
|
|
Any |
None |
Required. The name of the LVQ (spool size 0) to be used for checkpointing. The queue must exist on the same event broker and Message VPN as the target queue. If the LVQ is deleted (administratively) or a message from the LVQ is deleted or consumed by another consumer, the Connector for SFTP will not be able to resume from the last checkpoint. In addition, the LVQ should not be shared by multiple instances of the Connector for SFTP. |
|
|
|
|
Optional. Set to |
SFTP Source Configuration Options
When configured as a source connector, the Connector for SFTP reads delimited, JSON, and XML files from the SFTP server, splits file data based on configuration into individual events, and sends them to the PubSub+ event broker.
The configuration properties for the SFTP source are divided into two categories: common properties (SFTP connection or file filtering etc.) and file type specific properties.
Common Configuration Options for SFTP Source
This section details the SFTP source configuration properties that are for common for all file types. For more information, see the Apache Camel SFTP component documentation.
All properties must be prefixed with spring.cloud.stream.camel.bindings.<bindingName>.consumer.endpoint.query-parameters
.
Example configuration:
spring: cloud: stream: camel: bindings: input-0: consumer: endpoint: query-parameters: noop: true delete: false includeExt: csv #other properties
Configuration Option | Type | Valid Values | Default Value | Description |
---|---|---|---|---|
|
|
None |
The username to use to log in. |
|
|
|
None |
The password to use to log in, if you are using password authentication. If it is not set, the private key file must be set. |
|
|
|
None |
The private key file for the SFTP endpoint to use for private key verification. |
|
|
|
None |
The private key file passphrase for the SFTP endpoint to use for private key verification. |
|
|
|
|
|
Indicates whether to use passive mode connections. The default ( |
|
|
None |
The You can create a ssh-keyscan -H <host> -P <port> >> known_hosts. For example: ssh-keyscan -H myftpserver -p 22 >> known_hosts |
|
|
|
|
|
Indicates whether to use strict host key checking. The default ( |
|
|
|
|
Indicates whether the |
|
|
None |
A comma-separated list of ciphers to use, listed in order of preference. Possible cipher names are defined by JCraft Java Secure Channel (JSch). Some examples include: aes128-ctr, aes128-cbc, 3des-ctr, 3des-cbc, blowfish-cbc, aes192-cbc, and aes256-cbc. |
|
|
|
None |
A comma-separated list of key exchange protocols to use, listed in order of preference. Possible cipher names are defined by JCraft JSch. Some examples include: diffie-hellman-group-exchange-sha1, diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, diffie-hellman-group-exchange-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, and ecdh-sha2-nistp521. |
|
|
|
None |
A comma-separated list of accepted public key algorithms. Some examples include: ssh-dss, ssh-rsa, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, and ecdsa-sha2-nistp521. |
|
|
|
None |
A comma-separated list of algorithms supported for the server host key. Some examples include: ssh-dss, ssh-rsa, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, and ecdsa-sha2-nistp521. |
|
|
|
|
|
The time in milliseconds to wait for a connection to be established. |
|
|
|
|
The socket timeout, in milliseconds. |
|
|
|
None |
The maximum number of times to retry to establish an initial connection to the remote FTP server. Use 0 to disable this behavior. |
|
|
|
|
The delay in milliseconds to wait before retrying the connection. |
|
|
|
|
The maximum number of keep-alive messages to send without receiving any messages back from the server. If this threshold is reached while keep-alive messages are being sent, the connection is closed. |
|
|
|
|
The interval (in milliseconds) between keep-alive messages. If zero is specified, no keep-alive messages are sent. |
|
|
|
|
The file transfer mode, either binary or ASCII. The default ( |
|
|
A valid charset value. |
None |
The character encoding of the file contents, for example |
|
|
|
|
If |
|
|
|
|
If |
|
|
Any |
None |
An expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move files into a .done subdirectory: To move files into a .processed subdirectory and rename them: To move files into a .processed subdirectory and rename file with current timestamp: |
|
|
Any |
None |
Expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move failed files into an .error subdirectory: To move failed files into an .error subdirectory and rename file: To move failed files into an .error subdirectory and rename them with the current timestamp: |
|
|
A File Language expression. |
None |
Built-in sort using File Language. Supports nested sorts: for example, you can sort by filename and then by modified date. Sort by filename: Sort by file modified time: |
|
|
|
|
If the specified location is a directory, the connector looks for files in all the subdirectories as well. |
|
|
|
|
The maximum depth to traverse when recursively processing a directory. |
|
|
|
None |
The minimum depth to start processing when recursively processing a directory. Using |
|
|
Any |
None |
Ant-style filter exclusion. If both |
|
|
Any |
None |
Ant-style filter inclusion. Multiple inclusions may be specified in comma-delimited format. |
|
|
|
|
Indicates whether the |
|
|
A valid regular expression |
None |
Excludes files where the filename matches the regex pattern (matching is case in-sensitive). |
|
|
A valid regular expression |
None |
Includes files where the filename matches the regex pattern (matching is case-insensitive). |
|
|
A file extension |
None |
Is used to include files matching file extension name (case-insensitive). For example to include |
|
|
A file extension |
None |
Is used to exclude files matching file extension name (case-insensitive). For example to exclude |
|
|
Any |
None |
The source SFTP server URI and the directory path. |
|
|
Any |
|
The amount of time that must elapse before the next poll. |
|
|
Any |
|
The amount of time that must elapse before the first poll starts. |
|
|
Enum values: |
|
The time unit for the |
|
|
|
|
Indicates whether to stop processing the current file if an exception is encountered. When this option is set to When this option is set to |
|
|
Enum values: |
|
Logging levels control how much information is saved to the log file. During troubleshooting, it may be useful to raise the logging level to increase the amount of information the logs receive from the FTP server. |
|
|
|
(that is, 2 MB) |
The maximum size, in bytes, of the files to be consumed. This option helps to prevent Out Of Memory (OOM) errors on systems with a small amount of available memory. |
File Type-Specific Properties
The following sections describe the properties that are specific to each file type.
All properties must be prefixed with spring.cloud.stream.camel.bindings.<bindingName>.consumer.endpoint.query-parameters.
Configuration Option | Type | Valid Values | Default Value | Description |
---|---|---|---|---|
|
|
Enum values: |
|
Required. The file processor to be used to handle the files. Default is |
Delimited File Configuration Properties
The spring.cloud.stream.camel.bindings.<bindingName>.consumer.endpoint.query-parameters.fileType
should be set to delimited
.
Configuraton Option | Type | Valid Values | Default Value | Description |
---|---|---|---|---|
|
|
|
The events in the files are separated by this character. If the specified The following example configuration uses eventDelimiter: xyzxyzxyzxyz ignoreHeaderLine: false paramDelimiter: bar payloadFormat: text The maximum payload sizes for software event brokers are 30 MB for Enterprise Edition and 10 MB for Standard Edition. If the file size is larger than 30 MB, the connector throws an error. |
|
|
|
|
|
Indicates whether the first line of the file should be ignored as a header.
|
|
|
|
The delimiter to use to separate the parameters in the header line or |
|
|
|
None |
The list of parameter names separated by the If not set, and |
|
|
|
Enum Values: |
|
The format of the payload. If If |
JSON File Configuration Properties
The spring.cloud.stream.camel.bindings.<bindingName>.consumer.endpoint.query-parameters.fileType
option should be set to json
.
Configuration Option | Type | Valid Values | Default Value | Description |
---|---|---|---|---|
|
|
A valid JSON path expression |
(root node) |
The JSON path expression to extract, split, or filter the data from the JSON file. The default value of |
XML File Configuration Properties
The spring.cloud.stream.camel.bindings.<bindingName>.consumer.endpoint.query-parameters.fileType
should be set to xml
.
Configuration Option | Type | Valid Values | Default Value | Description |
---|---|---|---|---|
|
|
a valid XPath path expression |
(root node) |
The XPath expression to extract, split, or filter the data from the XML file. The default value of For example, for an <employees> <employee> <name>John</name> <age>30</age> </employee> <employee> <name>Smith</name> <age>40</age> </employee> </employees> |
SFTP Target Configuration Options
The following table lists the SFTP target-specific properties. For more information, see the Apache Camel SFTP Component documentation.
All properties must be prefixed with spring.cloud.stream.camel.bindings.<output-x>.producer.endpoint.query-parameters
.
Example configuration:
spring: cloud: stream: camel: bindings: output-0: producer: endpoint: query-parameters: username: test password: test fileName: output.csv #other properties
Connecting to Multiple Systems
This connector does not support multiple binder system configurations. The multiple binder systems configuration may be supported in future releases.