Broker settings

These are usually configured on conf/default.properties on broker runtime (service/pod).

When adjusting any entry, please cross-check whether the backend settings list also contains the same entry; if so, add/update/remove the relevant entry there as well.

# =================================
# FILE POLLING
# =================================

# set `true` to enable file-based submissions
file.polling.enabled=true

# following set of configs will match the standard file path behavior; customize if necessary
# https://aayutechnologies.com/docs/product/as2-gateway/sftp-integration/#4-sftp-folder-structure

# absolute path to the root directory/mount where files are available
file.polling.root.path=/home/sftp
# relative directory under above root, from which single files will be picked;
# e.g. {user or context}/as2gateway/{station-AS2-ID}/{partner-AS2-ID}
file.pattern.prefix=/([^/]+)/as2gateway/([^/]+)/([^/]+)
# pattern for matching filenames; currently matches any name
file.pattern.suffix=([^/]+)
# the full relative path (relative to file.polling.root.path) for file picking (including test-mode partner support);
# e.g. {user or context}/as2gateway/{station-AS2-ID}/{partner-AS2-ID}/{optional 'test' subdirectory level, in case of test-mode submissions}/{filename}
file.polling.pathPattern=${file.pattern.prefix}(|/test)/outbox/(|.+/)${file.pattern.suffix}\\z

# following configs are used to tune the subdirectories for test/prod and single/multiple file submissions

# helper entry; do not modify
file.pattern.base=${file.polling.root.path}${file.pattern.prefix}
# absolute path for a single-file, production-mode submission;
# each matching file will be picked up and sent out as an individual message
file.pattern.prod.singleFile=${file.pattern.base}/outbox/${file.pattern.suffix}
# absolute path for a multiple-file, production-mode submission;
# files matching this pattern and placed into a subdirectory, will be picked as one collection from their parent subdirectory,
# and sent out as multiple-attachment messages as per the multiple-attachment submission guide:
# https://aayutechnologies.com/docs/product/as2-gateway/sftp-integration/#62-sending-files-messages-out-via-partner-outbox
file.pattern.prod.multiFiles=${file.pattern.base}/outbox/(.+)/${file.pattern.suffix}
# absolute path for a single-file, test-mode submission
file.pattern.test.singleFile=${file.pattern.base}/test/outbox/${file.pattern.suffix}
# absolute path for a multiple-file, test-mode submission
file.pattern.test.multiFiles=${file.pattern.base}/test/outbox/(.+)/${file.pattern.suffix}

# use this regular expression pattern to ignore (prevent picking up of) some files based on name,
# e.g. temporary files created while transferring
file.polling.ignoreFileNamePattern=.fuse_hidden.+
# similarly for ignoring paths, e.g. to ignore static/configuration files present within the polled directory hierarchy;
# must be specified relative to file.polling.root.path
file.polling.ignoreFilePathPattern=/[^/]+/as2gateway/.ssh

# files that fail pick-up (do not get enqueued successfully) will be moved to this path, for manual action;
# if the file could be associated with a user account or trading station, the corresponding email address(es) will also be notified
file.polling.moveAfterFailure=${file.polling.root.path}/@{mc.properties.SFTP_SUB_PATH}/failed/@{current.timestamp.yyMMddHHmmss}/@{mc.properties.OPTIONAL_SFTP_DIR_PATH_PATH}
# wait period for steady state; only pick up a file after it has remained unmodified for this many milliseconds
# (prevent picking up files that are still being uploaded/written to the filesystem)
file.polling.fetchAfterModification=30000
# how often to check for new files; a file that was completely uploaded, will be picked up within
# either file.polling.repeatInterval or file.polling.fetchAfterModification milliseconds, whichever is higher
file.polling.repeatInterval=15000
# helper entry; do not modify
file.saver.inbox.path=@{mc.properties.SFTP_SUB_PATH}


# =================================
# S3 POLLING
# =================================

# set `true` to enable S3 bucket-based submissions
s3.polling.enabled=true

# files that fail pick-up (do not get enqueued successfully) will be moved to this path, for manual action;
# if the file could be associated with a user account or trading station, the corresponding email address(es) will also be notified
s3.polling.moveAfterFailure=as2gateway/@{mc.properties.SFTP_SUB_PATH}/failed/@{current.timestamp.yyMMddHHmmss}/@{mc.properties.OPTIONAL_SFTP_DIR_PATH_PATH}
# how often to check for new files
s3.polling.repeatInterval=15000

# following set of configs will match the standard S3 outbound file pick-up behavior; customize if necessary
# https://aayutechnologies.com/docs/product/as2-gateway/aws-s3-integration/#4-submittingsending-files-through-s3

# prefix within bucket (similar to file.polling.root.path) which will be monitored for new outbound files
s3.pattern.prefix=AS2/send/
# helper property; do not modify
# artificial path, prefixed with {bucket-name}/ to match SFTP pattern
s3.pattern.base=([^/]+)/${s3.pattern.prefix}([^/]+)/([^/]+)

# full S3 prefix (includes bucket name) for a single-file, production-mode submission;
# each matching file will be picked up and sent out as an individual message
s3.pattern.prod.singleFile=${s3.pattern.base}/${file.pattern.suffix}
# full S3 prefix for a multiple-file, production-mode submission;
# files matching this pattern and placed into a subdirectory, will be picked as one collection from their parent subdirectory,
# and sent out as multiple-attachment messages as per the multiple-attachment submission guide:
# https://aayutechnologies.com/docs/product/as2-gateway/aws-s3-integration/#sending-multiple-files-in-one-message
s3.pattern.prod.multiFiles=${s3.pattern.base}/([^/]+)/${file.pattern.suffix}
# full S3 prefix for a single-file, test-mode submission
s3.pattern.test.singleFile=${s3.pattern.base}/test/${file.pattern.suffix}
# full S3 prefix for a multiple-file, test-mode submission
s3.pattern.test.multiFiles=${s3.pattern.base}/test/([^/]+)/${file.pattern.suffix}


# =================================
# EDI GENERATOR INTEGRATION
# =================================

# inbound-file notification receiving endpoint of your EDI Generator deployment; can also be specified when performing the UI-level integration:
# https://aayutechnologies.com/docs/product/as2-gateway/edi-generator-integration/#configure-edig-integration
edig.default_url=http://localhost:5001/edigateway-dev/us-central1/mftgWebHook


# =================================
# OUTBOUND FLOW POLLING
# =================================

# internal settings controlling the periodic processing of outbound/queue entries; usually not needed to modify, except outbound.repeat.interval
# https://developer.adroitlogic.com/connectors/docs/latest/timer/timer_ingress_connector.html
outbound.parallel.execution.count=4
outbound.concurrent.polling.count=1
# time period (milliseconds) that the system would check for new outbound/queue entries; increase this if your volume is low
# after a queue entry is added, it will usually be picked up for processing/sending, within this many ms
outbound.repeat.interval=1000
# helper property; do not modify
outbound.start.delay=1000


# =================================
# DATABASE
# =================================

# JDBC connection URL for the database
database.url=jdbc:mysql://localhost:3306/as2gx?useSSL=false

# JDBC driver to use for connecting to the database; consult the official JDBC driver documentation for your chosen databass
database.driverClass=com.mysql.cj.jdbc.Driver

# user name and password for connecting to the database
database.username=
database.password=

# system will maintain a pool of live database connections for fast operation;
# this query is used to health-check each connection picked from the pool, before it is used for actual operations
# consult documentation of your chosen database for the appropriate validation/health-check query
database.validationQuery=SELECT 1

# =================================
# DATABASE CONNECTIONS
# =================================

# this section controls the pooling of database connections;
# pooling usually results in faster operation as it is not necessary to open a new connection for each query,
# however it may result in additional network activity and resource (e.g. memory) usage
# pool would grow/shrink dynamically based on system load (number of concurrent queries), controlled by following params:

# don't allow pool to grow above this many connections (during load)
database.connections.maxTotal=40
# don't allow pool to shrink below this many connections (while idle)
database.connections.minSize=2
# at start, pool will have this many connections
database.connections.initialSize=5

# max time that a connection is allowed to stay idle in the pool, before it is evicted/replaced
database.connectionIdleMillis=20000
# when a connection is requested from the pool, reject/fail the request if a connection could not be returned after this many milliseconds
database.connectionWaitMillis=6000
# refresh/health-check connections in the pool periodically
database.refreshIntervalMillis=2000
# log a warning if a connection taken from the pool was not released after this many milliseconds
# (usually happens during long-running operations such as processing large files,
# but may also very rarely be due to unreleased connections caused by critical failures or bugs)
database.leakSuspicionDelay=60000

# ==================================
# = JPA / HIBERNATE CONFIGURATION
# ==================================

# automatically update database schema based on application entity model; used in first application launch
spring.jpa.hibernate.ddl-auto=update

# internal; allows Hibernate to generate SQL optimized for a particular DBMS
spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect

# internal; log each SQL query issued by the application
spring.jpa.show-sql=false

# internal; DB entity naming strategy
spring.jpa.hibernate.naming.implicit-strategy=com.as2gateway.util.SpringImplicitNamingStrategy
spring.jpa.hibernate.naming.physical-strategy=com.as2gateway.util.SpringPhysicalNamingStrategy

# path storing large binary payloads (raw messages, attachments etc)
# applicable ONLY on variants with VLF (large file) support
# you would usually mount a disk/NFS/volume with adequate space under this path of the runtime, visible to both backend and broker
blob.store.path=/var/lib/as2gx


# =================================
# LISTENERS
# =================================

# application receives incoming AS2 traffic on this HTTP port
http.port=8280

# set to `true` to enable receiving AS2 traffic over HTTPS (TLS/SSL)
# AS2 payloads are already encrypted; in most cases, HTTPS only adds an unnecessary overhead
https.enabled=false
# application receives incoming HTTPS AS2 traffic over this port, if enabled
https.port=8443

# these settings configure the AS2 endpoint(s) that are exposed to outside;
# if your AS2 deployment is behind a firewall or otherwise not directly exposed to the public internet,
# configure these to make the application aware of its public endpoints
# application uses these in deriving async MDN receipt URLs and other information that it presents to outside entities

# is there a publicly exposed HTTP endpoint to receive AS2 traffic?
http.public.enabled=true
# public AS2 HTTP endpoint in hostname:port format
http.public.endpoint=localhost:${http.port}
# is there a publicly exposed HTTPS (TLS/SSL) endpoint to receive AS2 traffic?
# (either broker's above built-in endpoint, or a reverse proxy forwarding back to http.port)
https.public.enabled=false
# public AS2 HTTPS endpoint in hostname:port format
https.public.endpoint=localhost:${https.port}

# =================================
# KEYSTORE
# =================================

# NOTE: these keystores are stored and managed in the application DB; modifying the on-disk files has no effect

# internal; entry name/alias for the identity key inside application's HTTPS keystore
https.identity.key.alias=ultraesb
# internal; password used for the above key; DO NOT change after initial run
https.identity.key.password=z0m3p@Sswo4d
# internal; password of the above HTTPS identity keystore
https.identity.store.password=@n07hrPa$worD
# internal; absolute path where above HTTPS identity keystore is located
https.identity.store.path=/opt/ultraesb-x/conf/keys/identity.jks
# internal; password of system's HTTPS trust keystore
https.trust.store.password=ErdaPs$veRD
# internal; absolute path where system's HTTPS trust keystore is located
https.trust.store.path=/opt/ultraesb-x/conf/keys/trust.jks

# =================================
# HTTPS
# =================================

# NOTE: these settings are intentionally relaxed to account for some common server misconfigurations;
# it is recommended to enforce them for strict security of production HTTPS traffic

# set to `optional` or `required` to enable client authentication (two-way SSL/TLS) for inbound traffic
# `required` will strictly reject any unauthenticated client traffic
https.ssl.verify.client=none
# disable this to enforce validation of remote server certificates for outgoing traffic; disabling is recommended in most cases
https.no.remote.cert.validation=true
# set to an appropriate version string e.g. `TLSv1.2` to enforce the minimum TLS version for handshakes (inbound/outbound)
# see https://docs.oracle.com/en/java/javase/11/docs/specs/security/standard-names.html#sslcontext-algorithms for possible version strings
https.tls.version=TLS
# Strict|AllowAll|DefaultAndLocalhost|Default; set to `Strict` to enforce server TLS certificates to match their hostnames; recommended in most cases
https.host.name.verifier=AllowAll


# =================================
# TIMEOUT
# =================================

# NOTE: the core timeout values will be overridden by partner-level settings
# https://aayutechnologies.com/docs/product/as2-gateway/adding-as2-partner/#2211-transmission-timeout

# max round-trip time (from request to response) for an incoming AS2 message, inside the application
# usually no need to change
response.timeout=130000
# max time to wait for a response (MDN/HTTP ACK) after transmitting an AS2 message out
egress.timeout=120000
# extra time allocated (over socket timeout) for outgoing messages to complete execution
egress.timeout.extra.millis=10000

# network-level socket timeout for incoming connections;
# max time allowed for an inbound message to be read from wire + processed + responded back
http.receive.socket.timeout=120000
# network-level socket timeout for outgoing connections;
# max time allowed for an outbound message to be transmitted + responded back (excluding processing/composition time)
http.send.socket.timeout=120000
# connect timeout for outgoing connections; max time to wait before aborting the connectivity attempt
http.send.connect.timeout=10000


# =================================
# SSL CONTEXT RELOAD
# =================================

# in some configuration changes and tests, web application will invoke the AS2 broker component via HTTP
# this traffic is usually configured to flow through localhost or a private IP (via webapp settings)
# if you deploy behind a firewall, do not expose this port to public internet, unless the webapp is only able to reach broker via internet
# NOTE: same settings are configured in webapp side; both must be kept in sync

# port where webapp will direct-invoke AS2 broker
as2.direct.invoke.port=8283
# shared secret/token used by webapp to authenticate to broker during direct-invoke
as2.direct.invoke.token=6dafba86-6e37-46be-9827-b3688501121a

# =================================

# any incoming messages with this prefix on the `Host` header, e.g. test-${http.public.endpoint}, will be treated as test messages
# https://aayutechnologies.com/docs/product/as2-gateway/partner-types/
test.host.prefix=test-

# suffix to use for Message-IDs (of outgoing messages and MDNs)
# set this to your organization domain name to get IDs of the format `<unique-prefix@your.domain>`
as2.message.id-suffix=@as2gateway.com


# this section controls retry schedule for outbound message failures

# how many times each outgoing message will be retried (on temporary send failures like network issues and HTTP 5xx error responses)
as2.internal.outbound.retry.count=10
# failed messages are retried using an exponential back-off, with this initial/starting delay (millis)
as2.internal.outbound.retry.initial=5000
# multiplication factor for above exponential back-off; e.g. 2 will double the delay after each retry (until ceiling is reached)
as2.internal.outbound.retry.multiplier=2
# max value (ceiling) for retry delay; back-off/delay will not increase beyond this value
# e.g. initial=5000, ceiling=60000 will run retries at 5s, 10s, 20s, 40s, 60s (80s reduced by ceiling), 60s, 60s, ..
as2.internal.outbound.retry.ceiling=60000

# max number of outgoing messages that will be picked in each retry cycle
# when increasing this value, make sure system has sufficient resources (esp. disk and memory) to process such number of messages concurrently
as2.internal.outbound.fetch.limit=10

# in case of multiple-file message submissions (e.g. several files under same SFTP/S3 subfolder),
# processing of the subfolder content will start after this many minutes from the last modification to the folder content (steady state)
multiple.attachment.retry.minutes=2


# File size/count controls

# max allowed size of an incoming message body/payload; larger messages may be rejected with HTTP 413 errors
# NOTE: this may differ from the actual size of file(s) included in the message
# if increasing this value, make sure system has sufficient resources (esp. disk and memory) to process such large payloads,
# and the chosen database and JDBC driver supports transferring and storing of such payloads
# (e.g. MySQL JDBC driver only supports binary payloads upto 1GB, and the size must be configured on `max_allowed_packet` in `mysqld.cnf`
ingress.max.payload.size=10485760

# some systems may not include an `AS2-Version` header in their request/response; enabling this will  prevent issuing of warnings in such cases
ignore.missing.as2-version=true

# max total size of content (files) allowed in one outgoing message submission
# NOTE: this may differ from the actual size of the final composed AS2 message
outbound.max.size=10485760
# max number of files that can be included in one outgoing message submission
outbound.max.files=10


# =================================
# EMail
# =================================

# SMTP details/credentials for connecting to your email server

# SMTP email server hostname, e.g. AWS SES
spring.mail.host=email-smtp.us-east-1.amazonaws.com
# port number to connect on the email server
spring.mail.port=587
# 'From' address (MAILFROM) to use for sending emails out; may need to be authorized before use, e.g. in case of SES
spring.mail.from=noreply@as2gateway.com
# name to use (along with the 'From' address) for sending emails out
spring.mail.fromName=AS2 Gateway
# SMTP server log-in username
spring.mail.username=
# SMTP server log-in password
spring.mail.password=

# internal JavaMail properties; not necessary to change in most cases
# https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html#properties

# mail.transport.protocol property
spring.mail.properties.mail.transport.protocol=smtp
# mail.smtp.auth property; disable only if you use a SMTP server that allows anonymous/unauthenticated connections (e.g. locally installed)
spring.mail.properties.mail.smtp.auth=true
# mail.smtp.starttls.enable property; disable if your server does not require/support STARTTLS authentication
spring.mail.properties.mail.smtp.starttls.enable=true
# mail.smtp.timeout property; increase this if your server/network is slow, or timeouts are commonly observed during email sending
spring.mail.properties.mail.smtp.timeout=180000

# 'From' address (MAILFROM) to use for system-generated support notifications; recommended: an address that can receive replies
spring.mail.fromSupport=support@as2gateway.com


# Hostname settings

# publicly accessible base URL of the web interface
host.url=http://${webhost.name}:8080

# hostname designated for overall system (recommended: hostname of web interface); for internal use
host.name=localhost

# internal; domain/tenant name used for the super-admin account
super.user.org.domain=as2gateway.com


# =================================
# Async Task Executor
# =================================

# this executor/thread pool is used for non-real-time like sending out emails

# how many threads (and hence concurrent tasks) are supported
task.executor.maxPoolSize=20
# how many tasks can get queued while the executor is busy/saturated, before starting to reject tasks
task.executor.queueCapacity=100


# FDA/EMA file processing related configurations

# max expectable size of an FDA ACK2 file; if FDA sends a file larger than this, system will not consider or parse it as a possible ACK2 response
# (there is no reliable way to identify an ACK2 file, using the filename or other HTTP/AS2/MIME metadata)
fda.ack2.max-length=20480
# allowed extensions for FDA ACK2 files; system will not consider incoming files with other extensions as possible ACK2 responses
fda.ack2.extensions=.txt,.htm,.html
# some FDA centers may return ACK2s in HTML format, which need to be parsed as XMLs (instead of usual textual format);
# this identifies such file extensions (in addition to .xml) that must be considered as XML as such
fda.ack2.xml-extensions=.htm,.html

# max expectable size of an EMA ACK file; if EMA sends a file larger than this, system will not consider or parse it as a possible ACK response
ema.ack.max-length=20480