Skip to main content
phase4 reads its configuration from the standard helger-config stack. At runtime the library merges values from multiple sources in priority order:
  1. Java system properties (-Dproperty=value)
  2. Environment variables
  3. private-application.properties (classpath)
  4. application.properties (classpath)
Place your settings in application.properties on the classpath. To override individual values without modifying that file, use private-application.properties (higher priority) or Java system properties.
The legacy files phase4.properties and private-phase4.properties are still supported for backward compatibility but are deprecated since 4.0.1. Migrate to application.properties.

All configuration properties

The properties below are all read by AS4Configuration in com.helger.phase4.config.

Global runtime mode

PropertyTypeDefaultDescription
global.debugbooleanfalseEnables global debug mode. Set to true during development to relax some checks (e.g., allows plain-HTTP endpoints).
global.productionbooleanfalseEnables production mode. Influences behaviour in some profile validators.
global.nostartupinfobooleantrueWhen true, suppresses the startup information log line that lists the active configuration.

Data storage

PropertyTypeDefaultDescription
global.datapathstringphase4-dataBase directory for persistent data files such as PModes. Relative to the application working directory or absolute. See Data path.
phase4.manager.inmemorybooleantrueWhen true, managers (PMode, duplicate detection) are kept in memory only and not persisted to disk. Set to false to persist PModes as XML files under global.datapath.

Message dumps

PropertyTypeDefaultDescription
phase4.dump.pathstringphase4-dumpsBase directory where incoming and outgoing message dumps are written. Relative to the application working directory or absolute. See Data path.

Security and cryptography

Keystore and truststore properties use the prefix org.apache.wss4j.crypto.merlin.. See Crypto setup for the full reference.

Duplicate detection

PropertyTypeDefaultDescription
phase4.incoming.duplicatedisposal.minuteslong10Number of minutes that incoming message IDs are retained for duplicate detection. After this window, the same message ID can be accepted again.

Endpoint address

PropertyTypeDefaultDescription
phase4.endpoint.addressstring(none)The public URL of this AS4 access point. Required by some profiles (e.g., Peppol production requires https).

AS4 profile

PropertyTypeDefaultDescription
phase4.default.profilestring(none)The default AS4 profile ID used when no profile is specified on the sender builder. Example: peppol. (Replaces phase4.profile which is still accepted as a fallback.)

Error handling

PropertyTypeDefaultDescription
phase4.errormsg.include.stacktracesbooleanfalseWhen true, Java stack traces are included in outgoing AS4 error messages. Disable in production to avoid information leakage.

WSS4J synchronization

PropertyTypeDefaultDescription
phase4.wss4j.syncsecuritybooleanfalseWhen true, all WSS4J sign/verify and encrypt/decrypt operations are synchronized. Enable when multiple threads in the same JVM share the same WSS4J crypto object.

Compatibility

PropertyTypeDefaultDescription
phase4.compatibility.domibusbooleanfalseEnable special Domibus compatibility workarounds. Required in environments where phase4 communicates with multiple Domibus nodes.
phase4.http.response.accept.allstatuscodesbooleantrueWhen true (the default since 4.1.1), all HTTP response status codes are accepted. Set to false to restore the pre-4.1.0 behaviour that rejected responses with status ≥ 300.

Minimal application.properties example

application.properties
# Runtime mode
global.debug=false
global.production=true
global.nostartupinfo=true

# Data storage
global.datapath=/var/lib/as4/data
phase4.manager.inmemory=false

# Message dumps
phase4.dump.path=/var/lib/as4/dumps

# This AP's public endpoint URL
phase4.endpoint.address=https://as4.example.com/as4

# Keystore (Merlin/WSS4J format)
org.apache.wss4j.crypto.merlin.keystore.type=PKCS12
org.apache.wss4j.crypto.merlin.keystore.file=/etc/as4/keystore.p12
org.apache.wss4j.crypto.merlin.keystore.password=secret
org.apache.wss4j.crypto.merlin.keystore.alias=mykey
org.apache.wss4j.crypto.merlin.keystore.private.password=secret

# Trust store
org.apache.wss4j.crypto.merlin.truststore.type=PKCS12
org.apache.wss4j.crypto.merlin.truststore.file=/etc/as4/truststore.p12
org.apache.wss4j.crypto.merlin.truststore.password=peppol

Providing a custom configuration programmatically

For testing or programmatic control, you can replace the global configuration object before any phase4 code runs:
import com.helger.config.ConfigFactory;
import com.helger.config.fallback.ConfigWithFallback;
import com.helger.config.fallback.IConfigWithFallback;
import com.helger.config.source.MultiConfigurationValueProvider;
import com.helger.phase4.config.AS4Configuration;

// Build a custom value provider (example: start from the default and override one property)
MultiConfigurationValueProvider vp = ConfigFactory.createDefaultValueProvider();
// ... add or override sources as needed ...

IConfigWithFallback customConfig = new ConfigWithFallback(vp);

// Install globally — call this early, before any AS4 operations
AS4Configuration.setConfig(customConfig);
AS4Configuration.setConfig() is intended for testing. In production, prefer application.properties or environment variables so that configuration is externalized from code.

Priority order at a glance

Java system properties     (highest)
Environment variables
private-application.properties
application.properties     (lowest among file sources)
All sources are merged — a property defined in a higher-priority source wins.

Build docs developers (and LLMs) love