- Chapter
- Chapter 1 — Enterprise Integration Fundamentals
- Prerequisites
- Volume VI (APIs)
- You will be able to
- Identify the business and technical drivers for integration in an enterprise landscape, classify integration needs as data exchange, process integration, legacy access or external service use, recognise their typical constraints, and map each need to candidate integration styles and patterns
- Covers
- Data exchange; Business processes; Legacy integration; External services
On this page
- 1. Concept / Definition
- 2. Why It Exists
- 3. Core Concepts
- 4. How It Works Internally — Integration Needs Inventory
- 4A. Deep Dive — Integration as a Cost Centre
- 5. APIs / Features / Syntax
- 6. Practical Examples
- 7. Common Problems & Mistakes
- 8. Performance & Production Considerations
- 9. Architecture & Design Considerations
- 10. Interview Questions & Answers
1Concept / Definition
Enterprise integration connects independently built applications so they can share data and participate in shared business processes — without merging them into one system.

| TOC driver | Definition | Example |
|---|---|---|
| Data exchange | Making data owned by one system available to others | Product catalogue from ERP to e-commerce |
| Business processes | Coordinating steps of one process across systems | Order-to-cash: shop → payment → WMS → ERP |
| Legacy integration | Connecting old systems whose interfaces predate modern standards | Loyalty points on a mainframe |
| External services | Using capabilities provided by other organisations | Payment gateways, carriers, tax services |
2Why It Exists
Enterprises buy best-of-breed packages, build custom applications, acquire companies and adopt SaaS. Each system owns part of the truth. A single customer journey — browse, order, pay, ship, invoice, support — touches half a dozen of them. Without integration, humans re-key data, processes stall and reports disagree.

3Core Concepts
3.1 Data exchange
| Data exchange aspect | Questions |
|---|---|
| Ownership | Which system is the source of truth for customer, product, price? |
| Direction | One-way publish or bidirectional sync? |
| Latency | Nightly? Minutes? Seconds? |
| Volume | Hundreds of records or millions? |
| Shape | Full snapshots or change events (CDC)? |
| Quality | Validation, deduplication, reference data mapping |
3.2 Business processes

| Process integration aspect | Concern |
|---|---|
| Sequencing | Payment before fulfilment |
| State | Where is order 5001 now? |
| Failures | Payment ok but warehouse down — compensate? |
| Coordination style | Orchestration vs choreography (Chapter 7) |
| Consistency | No distributed transactions → sagas (Volume VIII) |
3.3 Legacy integration

| Legacy technique | When |
|---|---|
| Messaging bridge (IBM MQ) | Mainframe already speaks MQ |
| Screen/terminal adapters | Last resort for green-screen apps |
| Database CDC (Debezium) | Emit changes without touching code |
| File drops | Batch-oriented systems |
| API façade (strangler fig) | Gradual replacement |
3.4 External services

| External integration concern | Design response |
|---|---|
| Different availability and SLAs | Timeouts, retries, circuit breakers, queues |
| Contract changes by provider | Anti-corruption layer, contract monitoring |
| Security | OAuth, mTLS, secrets management, IP allow-lists |
| Asynchronous results | Webhooks, polling, callbacks |
| Cost per call | Caching, batching, rate limiting |
4How It Works Internally — Integration Needs Inventory
| Integration | Driver | Direction | Latency | Volume | Criticality |
|---|---|---|---|---|---|
| Products ERP → shop | Data exchange | One-way | 15 min | 50k items | Medium |
| Order → payment | External service | Request/reply | < 2 s | 200/min | Critical |
| Order → WMS | Business process | Command | < 1 min | 200/min | Critical |
| Shipment → ERP invoice | Business process | Event | < 15 min | 200/min | High |
| Loyalty → mainframe | Legacy | Batch | Nightly | 10k/day | Medium |

4ADeep Dive — Integration as a Cost Centre

| Hidden integration cost | Mitigation |
|---|---|
| Duplicated mapping logic | Canonical models, shared schemas |
| Undocumented interfaces | Integration catalogue, AsyncAPI/OpenAPI |
| Fragile scripts and cron jobs | Managed integration platforms, monitoring |
| Error handling by email | Dead-letter queues, replay tooling (Chapter 5) |
| Tribal knowledge | Ownership per integration |
5APIs / Features / Syntax
| Need | Java ecosystem tools |
|---|---|
| Data exchange | Spring Batch, CDC (Debezium), Kafka Connect |
| Process integration | Spring Integration, Camel, workflow engines (Temporal, Camunda) |
| Legacy | IBM MQ JMS client, Camel mainframe components, CDC |
| External services | Spring RestClient, webhooks with Spring MVC, Resilience4j |
| Documentation | AsyncAPI (events), OpenAPI (APIs) |
6Practical Examples
6.1 Re-keying orders
A distributor's sales team re-typed web orders into the ERP twice daily; errors caused 3% wrong shipments. An order integration via messaging removed manual entry and cut order-to-ship time from 1 day to 2 hours.
6.2 Legacy loyalty
Loyalty points lived on a mainframe updated nightly by files. Customers saw stale balances in the app. Debezium CDC on the mainframe's DB2 replica published point changes to Kafka within seconds, without modifying COBOL programs.
6.3 Worked example — source-of-truth matrix
Scenario. A retailer's shop, warehouse system, ERP and CRM all held product, price, customer and stock data. When figures disagreed, nobody could say which system was right, and every fix created a new inconsistency somewhere else.
| Entity | Source of truth | Consumers |
|---|---|---|
| Product master | ERP | Shop, WMS, search |
| Price | Pricing service | Shop, POS |
| Customer profile | CRM | Shop, billing, support |
| Stock level | WMS | Shop, ERP |
| Order | Order service | WMS, ERP, analytics |
What it shows. The matrix names exactly one source of truth for each entity and lists the systems that consume copies. Product master data comes from the ERP; prices from the pricing service; customer profiles from the CRM; stock levels from the warehouse management system; and orders from the order service. Every integration then has a clear direction: data flows from the source of truth to consumers, and consumers never change their copy and send it back. Disagreements are resolved by checking the source, not by debate.
Takeaway. Start integration work by agreeing ownership, not technology. A source-of-truth matrix is quick to produce, removes most arguments, and determines the direction of every data flow.
6.4 Worked example — integration contract card
Scenario. An integration between the order service and the warehouse system failed silently over a weekend. On Monday, nobody knew who owned it, what delivery time was promised or how to replay the lost messages.
| Field | Content |
|---|---|
| Name | OrderPlaced → WMS |
| Driver | Business process |
| Style | Messaging (Kafka topic orders.v1) |
| Owner | Orders team (producer), WMS team (consumer) |
| SLA | p99 < 60 s end-to-end |
| Error handling | DLQ orders.v1.wms.dlq, replay runbook |
What it shows. An integration contract card documents each integration in one place: its name and business driver, the style and technology, here a Kafka topic orders.v1, the owners on both sides, the service level, p99 under 60 seconds end to end, and error handling, a dead-letter topic with a replay runbook. With the card in place, on-call engineers know whom to call, which alerts should fire when latency exceeds the SLA, and how to recover lost messages.
Takeaway. Treat every integration as a product with an owner, an SLA and a runbook. A one-page contract card per integration is cheap to write and pays for itself in the first incident.
6.5 Worked example — external payment integration
Scenario. ShopNow integrated a payment service provider for cards and UPI. The team expected one REST API, but found that a single payment involved several different integration styles.
| Step | Mechanism |
|---|---|
| Create payment | REST call with idempotency key |
| Customer authentication (3DS/UPI) | Redirect/collect flow |
| Result | Webhook (signed) + reconciliation job |
| Settlement files | Daily SFTP |
What it shows. Creating a payment is a synchronous REST call that carries an idempotency key, so retries never create duplicate payments. Customer authentication, such as 3-D Secure or a UPI collect request, happens through a redirect or app flow outside ShopNow's control. The final result arrives asynchronously as a signed webhook, backed by a reconciliation job that queries the provider for any payments whose webhooks were missed. Settlement data arrives as daily files over SFTP for the finance team.
Takeaway. External services often combine several integration styles. Design for each one explicitly, including idempotency, signature verification, reconciliation for missed callbacks and file processing, rather than assuming a single synchronous API.
6.6 Worked example — process view vs data view
Scenario. In a design workshop for order fulfilment, the data architects drew which systems held which data, while the business analysts drew the steps from checkout to delivery. Each group thought the other had missed the point.
| View | Question answered |
|---|---|
| Data view | Who owns and who needs each entity? |
| Process view | Which steps happen in which system, in what order, with what failure handling? |
What it shows. Both views are needed and answer different questions. The data view shows ownership and flows: who masters orders, stock and customers, and who holds copies. The process view shows behaviour over time: which system performs each step, in what order, what happens when a step fails, and who compensates. An integration design that has only the data view misses timing and failure handling; one with only the process view misses ownership and creates conflicting copies of data.
Takeaway. Produce both a data view and a process view for significant integrations, and check them against each other. Gaps between them are where integration failures usually hide.
6.7 Worked example — latency requirements drive style
Scenario. A team planned to integrate everything with events because events were the company standard. For some flows this was ideal; for others it was either too slow or unnecessarily complex.
| Requirement | Style |
|---|---|
| Stock visible to shop within 5 s | Events |
| Accounting postings by next morning | Batch file or event batch |
| Fraud check before order confirmation | Synchronous API |
What it shows. How soon the receiver needs the information is the main factor in choosing an integration style. Stock levels must appear in the shop within five seconds, which suits events. Accounting postings are needed by the next morning, so a nightly batch file or batched events are simpler and cheaper. A fraud check must complete before the order is confirmed, because its result decides the next step, so it must be a synchronous API call with a timeout and fallback.
Takeaway. Ask "how fresh must the data be, and does the caller wait for the answer?" before choosing a style. Different flows in the same business process often need different styles.
6.8 Worked example — anti-corruption layer for SaaS CRM
Scenario. ShopNow adopted a SaaS CRM. Within months, CRM field names with suffixes like __c, CRM-specific loyalty codes and nullable fields had spread through the order and marketing code bases, and every CRM change broke something.
@Component
class CrmCustomerTranslator { // keeps CRM model out of our domain
Customer toDomain(SalesforceContact c) {
return new Customer(
CustomerId.of(c.externalId__c()),
c.firstName() + " " + c.lastName(),
Tier.valueOf(c.loyaltyTier__c().toUpperCase()));
}
}What it shows. An anti-corruption layer is a translation component at the boundary that converts the external model into the domain's own model. Here, CrmCustomerTranslator turns a SalesforceContact into a domain Customer, mapping the external ID to a CustomerId value object, combining names and converting the loyalty tier text into the domain's Tier enum. Only this class knows the CRM's model; the rest of the code works with Customer. When the CRM changes, only the translator changes.
Takeaway. Never let an external or legacy model leak into your domain. Put translation at the boundary, test it thoroughly with real sample data, and treat changes in the external system as changes to one class.
6.9 Worked example — M&A integration
Scenario. ShopNow acquired a regional retailer with its own ERP, customer data and warehouses. The board wanted combined reporting immediately and full integration within a year.
| Phase | Integration approach |
|---|---|
| Day 1 | File exchanges and reports between both ERPs |
| Month 3 | Shared customer master via events |
| Year 1 | Migrate acquired company onto group platforms |
What it shows. The integration was phased to deliver value at each stage. On day one, file exchanges and reports between the two ERPs gave the board combined figures without changing either system. By month three, a shared customer master distributed through events let both companies recognise common customers. By year one, the acquired company migrated onto the group's platforms, retiring its ERP. Each phase used the simplest integration style that met that phase's needs.
Takeaway. Integration is a business enabler, so plan it in phases tied to business milestones. Start with low-risk, quick integrations and move to deeper consolidation once ownership and target platforms are agreed.
6.10 Worked example — integration catalogue fields
Scenario. An enterprise architect inherited a landscape of about 120 integrations documented in scattered wiki pages, many out of date. During incidents, nobody could find who owned an integration or how it worked.
| Field | Why |
|---|---|
| Systems & owners | Accountability |
| Style & technology | Operability |
| Data classification | Security/compliance |
| Volumes & SLAs | Capacity |
| Runbooks & DLQs | Incident response |
What it shows. The minimum metadata in the table turns a list into an operational tool. Systems and owners give accountability; style and technology tell operators how to monitor and troubleshoot; data classification drives security and compliance reviews; volumes and SLAs support capacity planning and alerting; and runbooks and dead-letter queues support incident response. Stored in a searchable catalogue, ideally generated from code and configuration where possible, it becomes the first place engineers look.
Takeaway. Maintain an integration catalogue with a small, mandatory set of fields, and keep it current by making catalogue updates part of the definition of done for any integration change.
6.11 Worked example — CDC for data exchange
Scenario. The legacy order database had no events, and its application could not be changed safely. Several new services needed to react to new and updated orders in near real time.
{ "name": "orders-cdc",
"config": { "connector.class": "io.debezium.connector.postgresql.PostgresConnector",
"database.hostname": "orders-db", "table.include.list": "public.orders",
"topic.prefix": "cdc" } }What it shows. Change data capture reads the database's transaction log and turns committed row changes into events, without touching the application. The Debezium PostgreSQL connector configuration shown points at the orders database, includes only the public.orders table and publishes changes to Kafka topics prefixed with cdc. Consumers receive inserts, updates and deletes within seconds. Because CDC exposes table structure, a small transformation step usually maps raw row changes into proper business events before other teams consume them.
Takeaway. Use CDC to integrate systems you cannot change, but do not publish raw table changes as a long-term contract. Translate them into business events, so consumers are not coupled to the legacy schema.
6.12 Worked example — prioritising integration work
Scenario. The integration team had a backlog of twelve requested integrations and capacity for three this quarter. Every requester claimed theirs was the most urgent.
| Integration | Business value | Risk today | Priority |
|---|---|---|---|
| Order → WMS (manual) | High | High errors | 1 |
| Price sync (nightly) | Medium | Stale prices | 2 |
| HR → IAM provisioning | Medium | Security gaps | 2 |
| BI extract | Low | Low | 3 |
What it shows. Scoring each integration by business value and current risk made the choice transparent. Orders still entered manually into the warehouse system had high value and frequent costly errors, so it came first. The nightly price sync, which caused stale prices, and HR-to-identity provisioning, which left security gaps when staff left, came next. A BI extract with low value and low risk could wait. The scores were shared with stakeholders, which ended most debates.
Takeaway. Prioritise integration work by business value and risk, and make the scoring visible. Manual processes with high error rates and security gaps usually justify the earliest investment.
6.13 Worked example — publishing a business event for data exchange
Scenario. The catalog service needed to notify search, pricing and the shop whenever a product changed. An earlier version published events inside the database transaction, and when the transaction rolled back, consumers had already received events for changes that never happened.
@Service
class ProductPublisher {
private final KafkaTemplate<String, ProductChanged> kafka;
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
void on(ProductUpdated e) {
var event = new ProductChanged(e.sku(), e.name(), e.price(),
e.version(), Instant.now());
// key = sku → per-product order
kafka.send("catalog.products.v1", e.sku(), event);
}
}| Design choice | Reason |
|---|---|
| Publish after commit | No events for rolled-back changes |
| Key by SKU | Consumers see changes per product in order |
| Version field | Consumers ignore stale updates |
What it shows. The ProductPublisher listens with @TransactionalEventListener in the AFTER_COMMIT phase, so the Kafka event is sent only after the database transaction has committed. The event is a dedicated ProductChanged record with the SKU, name, price, a version number and a timestamp, not the JPA entity. Using the SKU as the message key keeps all events for one product in the same Kafka partition, so consumers see them in order. If the send itself fails, a transactional outbox is the more robust pattern.
Takeaway. Publish integration events only for committed changes, use dedicated event types as the contract, and choose message keys that preserve the ordering consumers need. For guaranteed delivery, use the outbox pattern.
6.14 Worked example — webhook receiver for an external service
Scenario. ShopNow's payment provider reports final payment results by calling a webhook. During a sale, slow processing in the webhook handler caused the provider to time out and retry, creating duplicate processing and alarming partners.
@PostMapping("/webhooks/payments")
ResponseEntity<Void> paymentEvent(@RequestHeader("X-Signature") String sig,
@RequestBody byte[] body) {
if (!signatures.valid(sig, body)) return ResponseEntity.status(401).build();
inbox.store(body); // persist first, process async
return ResponseEntity.accepted().build(); // 202 quickly
}| Rule | Reason |
|---|---|
| Verify signature | Authenticity |
| Store then acknowledge fast | Provider timeouts and retries |
| Process asynchronously, idempotently | Duplicates are normal |
What it shows. The receiver does only three things synchronously: it verifies the provider's signature over the raw body, rejecting forged calls with 401; it stores the raw payload in an inbox table; and it returns 202 Accepted immediately. A separate process then handles inbox entries asynchronously and idempotently, using the provider's event ID to ignore duplicates. The provider sees fast, reliable acknowledgements, and processing problems no longer cause retries.
Takeaway. Webhook endpoints should verify, persist and acknowledge quickly, then process asynchronously and idempotently. Back them with reconciliation, because some webhooks will always be lost.
7Common Problems & Mistakes
- No clear source of truth per entity.
- Treating process integration as data copying.
- Direct coupling to legacy internals.
- Ignoring external service failure modes.
- Undocumented integrations with no owner.
- Choosing technology before understanding needs.
8Performance & Production Considerations
| Aspect | Guideline |
|---|---|
| Inventory | Catalogue all integrations with owners |
| Latency | Requirements per integration |
| Volume | Capacity planning per flow |
| Errors | DLQs, replay, alerts |
| External | Resilience patterns, contract monitoring |
9Architecture & Design Considerations
- Start from business drivers, then choose styles.
- Define ownership and sources of truth.
- Protect domains with anti-corruption layers.
- Treat integration as a first-class architecture concern with its own roadmap.
10Interview Questions & Answers
Why do enterprises need integration?
No single system can run a whole business. Enterprises use many applications, such as ERP, CRM, e-commerce, warehouse, finance and HR systems, often from different vendors and eras, each specialised for one part of the business. Business information and processes cross these boundaries: an order placed in the shop must reach the warehouse, finance and customer service. Integration lets systems share data from its source of truth and coordinate steps in a process, so people do not re-enter data by hand. Done well, it keeps data consistent and processes fast; done badly, it creates fragile point-to-point links that are hard to change.
Name four integration drivers.
Data exchange shares information from the system that owns it with systems that need copies, such as product data from the ERP to the shop. Business processes coordinate steps that span several systems, such as order fulfilment from payment to shipping, including failure handling. Legacy integration connects older systems that cannot easily be changed, using adapters, files or change data capture, often as part of modernisation. External services connect to systems outside the organisation, such as payment providers, logistics partners or SaaS products, which bring their own contracts, security and availability. Identifying the driver helps choose the right integration style and ownership.
What distinguishes process integration from data exchange?
Data exchange moves information from a source of truth to consumers; each consumer decides independently what to do with it, and there is no shared notion of a process. Process integration coordinates a sequence of steps across systems, such as reserve stock, take payment and then ship, where order matters, state must be tracked and failures need compensation or retries. Process integration therefore needs orchestration or choreography, correlation IDs, timeouts and monitoring of in-flight processes. Treating a process as simple data exchange is a common cause of lost orders and inconsistent states.
How can legacy systems be integrated without changing them?
When a legacy system cannot be modified, integrate around it. Adapters wrap its existing interfaces, such as database procedures, screens or APIs, and expose them in a modern form. Messaging bridges connect its existing message queues to newer platforms. File interfaces, such as scheduled exports and imports, remain simple and robust for batch flows. Change data capture reads the database's transaction log and publishes row changes as events without touching application code. These approaches let new systems interact with legacy ones safely and are often the first step of a Strangler Fig migration.
What special concerns arise with external services?
External services sit outside your control, so several concerns become prominent. Their availability and latency differ from yours, so you need timeouts, retries and fallbacks. Their contracts can change on their schedule, so you need version monitoring and an anti-corruption layer. Security is stricter: credentials, request signing, data classification and legal agreements. Results often arrive asynchronously through webhooks, which require signature verification, idempotent processing and reconciliation for missed calls. Many services also charge per call, so caching and batching affect cost. Rate limits and sandbox environments must be considered in testing.
What is an anti-corruption layer?
An anti-corruption layer is a translation component placed at the boundary with a system whose model you do not control, such as a legacy application or a SaaS product. It converts the external model, with its field names, codes and quirks, into your own domain model, and converts your requests back. Only the anti-corruption layer knows the external model, so the rest of your code stays clean and expressed in your domain language. When the external system changes or is replaced, only the translation layer changes. The term comes from domain-driven design.
What should an integration catalogue contain?
An integration catalogue should list, for each integration, the systems involved and the owning teams on both sides; the business driver and the integration style and technology, such as REST, Kafka topic or file transfer; the data exchanged and its classification for security and compliance; expected volumes and service levels, such as latency and availability; error handling, including dead-letter queues and retry policies; monitoring and alerts; and runbooks for common incidents. It should be searchable, kept current as part of every integration change, and generated from configuration or code where possible, so it stays trustworthy.
How would you start an integration strategy for a landscape of 40 applications?
Begin with an inventory of all existing integrations, their sources of truth and owners, often discovered from network flows, middleware configuration and interviews. Classify each by driver, style and requirements such as latency, volume and criticality. Identify the riskiest areas, such as fragile point-to-point links, shared databases, manual steps and integrations without owners. Then define target integration styles and platforms, for example APIs through a gateway, an event backbone and managed file transfer, with standards for contracts and security. Prioritise changes by business value and risk, and govern new integrations through a catalogue and design reviews.
Test your knowledge on this topic →Flashcards from this topic's 8 questions, filtered by level and type.