pfx-sftp:parameters

pfx-sftp:parameters

All parameters for the pfx-sftp component -- SFTPConnection fields, the Pricefx connection parameter, and URI resolution logic.


SFTPConnection Parameters

These fields are configured on an SFTP connection object in Integration Manager:

Field

Type

Default

Description

host

String

(required)

Address of the SFTP server.

port

int

22

Port the SFTP server listens on.

path

String

/

Starting access point (base directory) for the connection. All URI directories are resolved relative to this path.

username

String

(optional)

Username for authentication.

password

String

(optional)

Password for authentication. Encrypted at rest in the Integration Manager database.

strictHostKeyChecking

boolean

false

Whether host keys are verified during connection. Disabled by default for development convenience; should be enabled in production.

Certificate-Based Authentication

When a certificateName is set on the connection, the component looks up the corresponding private key and injects it into the SFTP configuration. This enables key-based authentication instead of (or in addition to) password authentication.

Pricefx Endpoint Parameter

The following parameter is added by the Pricefx wrapper on top of the standard Camel SFTP endpoint:

Parameter

Type

Description

connection

String

Name of the SFTP connection to use. When set, host, port, path, username, password, and strictHostKeyChecking are resolved from the connection.

All standard Apache Camel SFTP parameters remain available when using pfx-sftp. Common examples include:

Parameter

Type

Description

fileName

String

Name (or expression) of the file to read/write.

delete

boolean

Delete the file after successful processing.

noop

boolean

Leave the file unchanged after reading (do not move or delete).

move

String

Directory to move the file to after processing (e.g., .done).

moveFailed

String

Directory to move the file to if processing fails.

tempPrefix

String

Temporary file prefix during upload (e.g., .uploading). Prevents downstream pickup of partial files.

recursive

boolean

Process files in subdirectories.

readLock

String

Read-lock strategy to prevent reading files still being written.

delay

long

Polling delay in milliseconds (consumer only).

See the Apache Camel SFTP documentation for the full list.

URI Resolution Logic

When the connection parameter is specified, the following resolution occurs:

  1. The connection is looked up from the Integration Manager connection registry.

  2. Protocol is set to sftp.

  3. Host, port, and strictHostKeyChecking are applied from the connection.

  4. Directory resolution:

    • If no directory is specified in the URI, the connection's path is used.

    • If a directory is specified and differs from the default, it is appended to the connection's path.

    • Example: connection path /data + URI directory exports = /data/exports.

  5. Username and password are applied if present on the connection.

  6. A private key is injected if the connection has a certificateName.

Resolution Example

Given a connection my-sftp-conn with:

  • host = sftp.example.com, port = 22, path = /data, username = integrator

And a URI:

pfx-sftp://dummy/outbound?connection=my-sftp-conn&tempPrefix=.uploading

The resolved URI is effectively:

sftp://integrator@sftp.example.com:22/data/outbound?tempPrefix=.uploading&strictHostKeyChecking=no

Common Pitfalls

Pitfall

Recommendation

Credentials in route XML

Never hardcode username or password in the URI. Use the connection parameter to reference a managed connection with encrypted credentials.

strictHostKeyChecking left off in production

Default is false. Enable it in production environments and ensure the server host key is pre-trusted.

Unexpected effective path

The URI directory is appended to the connection path, not treated as an absolute path. Always verify the effective path when troubleshooting "file not found" errors.

Connection Testing

The SFTPConnection.test() method opens an SFTP channel to verify connectivity. It connects using the configured host, port, username, password, and strictHostKeyChecking setting, then validates the configured path exists on the server.