Skip to content
Art2link ESB v2.02 LTS HomeDocumentationBlogContact
Best practices/Externalize configuration

Externalize configuration

Anything that changes between environments or over time — an endpoint URL, a credential, a batch size, a retry threshold — belongs in constants or variables, not baked into a map or component. Logic and configuration are different things; keep them apart.

A hardcoded value is a small time-bomb. The test endpoint ships to production because someone forgot to edit the component; a rotated credential means re-touching every artifact that embedded it; a threshold buried in code can only be changed by a redeploy. Each one couples a routine operational change to a code change.

Externalize instead. Pull endpoints, credentials and tunable thresholds into constants, and let the same maps and components reference them by name. The artifact becomes environment-agnostic — it moves from test to production untouched, and operations adjusts behaviour by changing configuration, not logic. Credentials specifically belong with authentications and the port boundary, never inline.

constants (externalized) endpointcredentialthreshold map / componentreferences by name test production artifactunchanged
Litmus test. If promoting an artifact from test to production requires editing it, a configuration value is hiding inside the logic. Lift it into a constant and reference it by name.