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 |
|
|
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/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=admin
integration.pfx.partition=yourpartition
integration.pfx.password=yourpassword
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"/>
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
connection=parameter -
pfx-rest Component — REST connections for external APIs
-
pfx-sftp Component — SFTP connections for file transfer
-
Certificates — SSL certificates for secure connections