Connections

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: pricefx.json, salesforce-api.json, sftp-server.json

Loaded by

Connection service at startup — referenced by name in route URIs


Connection Types

Type

Use Case

pricefx

Pricefx partition connection

rest-oauth2

OAuth2 client credentials flow

rest-basic

Basic HTTP authentication

rest-jwt

JWT authentication

rest-public

No-auth REST API

sftp

SFTP file transfer


JSON Examples

connections/pricefx.json

JSON
{
  "name": "pricefx",
  "type": "pricefx",
  "url": "https://yourpartition.pricefx.eu",
  "partition": "yourpartition",
  "username": "{{pfx.username}}",
  "password": "{{pfx.password}}"
}

connections/external-oauth2.json

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

JSON
{
  "name": "erpSystem",
  "type": "rest-basic",
  "url": "https://erp.company.com/api",
  "username": "{{erp.username}}",
  "password": "{{erp.password}}"
}

connections/public-api.json

JSON
{
  "name": "publicApi",
  "type": "rest-public",
  "url": "https://api.public-service.com"
}

connections/sftp-server.json

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

name

String

Certificate name

type

Enum

CERTIFICATE, KEY, or COMBINED (key + certificate)

body

String

Certificate body in X.509 PEM format


How to Use Connections in Routes

Reference a connection by name in component URIs:

XML
<!-- Default Pricefx connection (implicit) -->
<to uri="pfx-api:fetch?objectType=P&amp;filter=myFilter"/>

<!-- Explicit Pricefx connection name -->
<to uri="pfx-api:fetch?objectType=P&amp;filter=myFilter&amp;connection=secondPartition"/>

<!-- 3rd party REST connection -->
<to uri="pfx-rest:get?uri=/API_PRODUCT_SRV/A_Product&amp;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