Connections
Named connection definitions for Pricefx and 3rd-party systems.
|
Attribute |
Details |
|---|---|
|
Purpose |
Store credentials and connection details for Pricefx partitions and external systems |
|
Format |
JSON files — one connection per file |
|
Naming |
By connection name: |
|
Loaded by |
Connection service at startup — referenced by name in route URIs |
Connection Types
|
Type |
Use Case |
|---|---|
|
|
Pricefx partition connection (basic auth / partition JWT) |
|
|
Pricefx partition connection authenticated via OAuth credentials issued through Platform Manager (since IM 8.1.0). The client secret is a refresh token exchanged for short-lived access tokens at |
|
|
OAuth2 client credentials flow |
|
|
Basic HTTP authentication |
|
|
JWT authentication |
|
|
No-auth REST API |
|
|
SFTP file transfer |
JSON Examples
connections/pricefx.json
{
"name": "pricefx",
"type": "pricefx",
"url": "https://yourpartition.pricefx.eu",
"partition": "yourpartition",
"username": "{{pfx.username}}",
"password": "{{pfx.password}}"
}
connections/pricefx-oauth.json
{
"name": "pricefx",
"type": "pricefx-client-oauth",
"uri": "https://yourinstance.pricefx.eu/pricefx",
"partition": "yourpartition",
"clientId": "{{pfx.oauth.clientId}}",
"clientSecret": "{{pfx.oauth.clientSecret}}"
}
The clientSecret is encrypted at rest by IM ({ENC}...) the same way as the basic-auth password. Switching a partition between basic auth and OAuth means deploying the other connection type under the same name — connections hot-reload, no restart needed. See Pricefx Client OAuth Connection for the partition setup and token issuance guide.
connections/external-oauth2.json
{
"name": "externalApi",
"type": "rest-oauth2",
"url": "https://api.external.com",
"authUrl": "https://login.external.com/oauth/token",
"clientId": "{{oauth.clientId}}",
"clientSecret": "{{oauth.clientSecret}}",
"authRequestTemplate": "{\"grant_type\": \"client_credentials\", \"client_id\": \"::clientId\", \"client_secret\": \"::clientSecret\"}"
}
connections/erp-basic.json
{
"name": "erpSystem",
"type": "rest-basic",
"url": "https://erp.company.com/api",
"username": "{{erp.username}}",
"password": "{{erp.password}}"
}
connections/public-api.json
{
"name": "publicApi",
"type": "rest-public",
"url": "https://api.public-service.com"
}
connections/sftp-server.json
{
"name": "sftpServer",
"type": "sftp",
"url": "sftp.company.com",
"port": 22,
"username": "{{sftp.username}}",
"password": "{{sftp.password}}",
"remoteDirectory": "/upload"
}
Defining Connections
Option 1: PlatformManager (Recommended)
The preferred way to manage connections on provisioned instances. Connection JSON files are stored in the connections/ directory and managed via PlatformManager.
Option 2: application.properties (Pricefx Only)
Creates a default Pricefx connection named pricefx:
integration.pfx.url=https://yourpartition.pricefx.eu
integration.pfx.username={{pfx.username}}
integration.pfx.partition=yourpartition
integration.pfx.password={{pfx.password}}
integration.pfx.debug=false
SSL Certificates
Each connection can use a self-signed SSL certificate stored in the configuration repository.
|
Option |
Type |
Description |
|---|---|---|
|
|
String |
Certificate name |
|
|
Enum |
|
|
|
String |
Certificate body in X.509 PEM format |
How to Use Connections in Routes
Reference a connection by name in component URIs:
<!-- Default Pricefx connection (implicit) -->
<to uri="pfx-api:fetch?objectType=P&filter=myFilter"/>
<!-- Explicit Pricefx connection name -->
<to uri="pfx-api:fetch?objectType=P&filter=myFilter&connection=secondPartition"/>
<!-- 3rd party REST connection -->
<to uri="pfx-rest:get?uri=/API_PRODUCT_SRV/A_Product&connection=externalApi"/>
AWS S3 Connection
S3 connections are configured via application.properties (not the connections JSON format):
# AWS S3 credentials
s3.accessKey=AKIA...
s3.secretKey={ENC}...encryptedValue...
s3.region=eu-west-1
s3.bucket.name=my-integration-bucket
# Composite S3 consumer settings
pfx:s3.inbound.common=region={{s3.region}}&accessKey={{s3.accessKey}}&deleteAfterRead=false&moveAfterRead=true&destinationBucket={{s3.bucket.name}}&destinationBucketPrefix=archive/&maxMessagesPerPoll=1
Usage in route:
<from uri="aws2-s3://{{s3.bucket.name}}?prefix=inbound/&{{pfx:s3.inbound.common}}&secretKey=RAW({{s3.secretKey}})"/>
Note: secretKey must be wrapped in RAW(...) to prevent Camel URI parsing issues with special characters.
See S3 Integration Pattern for complete examples.
Kafka Connection
Kafka connections use application.properties with composite parameter blocks:
# Kafka broker
pfx:confluent.kafka.brokers=broker1:9092,broker2:9092
# Security (SASL_SSL)
pfx:general-kafka-security-parameters=securityProtocol=SASL_SSL&saslMechanism=PLAIN&saslJaasConfig=RAW(org.apache.kafka.common.security.plain.PlainLoginModule required username="{{kafka.user}}" password="{{kafka.password}}";)
# Consumer defaults
pfx:general-kafka-consumer-parameters=autoOffsetReset=earliest&autoCommitEnable=false&allowManualCommit=true&maxPollRecords=500&maxPollIntervalMs=300000
See Kafka Dual Pipeline Pattern for route examples.
SOAP/Web Service Connection
SOAP endpoints are configured as simple properties:
# SOAP endpoint
soap.myService.wsUrl=https://erp.example.com/services/MyService
soap.myService.soapAction=urn:processDocument
# Optional: basic auth via environment variables
soap.myService.username={{env:SOAP_USER}}
soap.myService.password={{env:SOAP_PASSWORD}}
# Timeouts (milliseconds)
soap.myService.socketTimeout=60000
soap.myService.connectTimeout=30000
See SOAP Outbound Pattern for route examples including FreeMarker payload generation.
Azure FileShare Connection
Azure FileShare is accessed via REST API with shared-access credentials:
# Azure FileShare
azure.fileShare.endpoint=https://myaccount.file.core.windows.net/myshare
azure.fileShare.sasToken={ENC}...encryptedSasToken...
Usage typically involves HTTP calls to the Azure REST API within a REST outbound route pattern. See REST Outbound Pattern.
Common Pitfalls
-
Never hardcode credentials — use
{{property}}placeholders resolved from PlatformManager or environment variables -
The default Pricefx connection must be named
pricefx -
Connection names are referenced in route URIs:
pfx-api:fetch?connection=myConn -
For provisioned instances, prefer PlatformManager connections over
application.properties -
One connection per JSON file in the
connections/directory
See Also
-
Routes — Connections are referenced in routes via the
connection=parameter -
Pricefx Client OAuth Connection — OAuth partition setup, token issuance, and IM configuration
-
pfx-rest Component — REST connections for external APIs
-
pfx-sftp Component — SFTP connections for file transfer
-
Security — certificates and SSL for secure connections