Integration Event Streaming (External)
Context
External partners run their own systems and exchange business events with your backend workloads in real time, in both directions. Their traffic reaches you over the public internet and enters through your perimeter network.
Problem
Partners and third-party systems that your organisation does not run need to publish events to your backend workloads and subscribe to your outbound feeds, in real time. Their traffic crosses the public internet into your perimeter, so each producer and consumer has to pass a WAF and authenticate (OAuth 2.0 client credentials or mutual TLS) before it can reach an internal topic. When no governed path exists, partner event flows bypass these controls or turn into brittle point-to-point links that cannot authenticate each party or scale.
Forces
- Partners need your events within seconds, but they cannot be allowed to connect to your internal brokers.
- Every inbound and outbound message must be screened and authenticated at the perimeter, but each extra hop adds latency.
- Integrators need durable streams they can replay after downtime, but retention costs storage and needs governance to avoid breaking changes.
- Many partners publish and subscribe on their own schedules, but each new party adds credentials, ACLs and schema versions to manage.
- Some partners need end-to-end payload confidentiality, but the perimeter proxy terminates TLS before it forwards events.
Solution
Run an Event Streaming Platform inside your network, with dedicated topics or streams for each asynchronous exchange. External producers connect to an ingress event proxy in the Public Subnet (Perimeter), which forwards their events to internal topics. External consumers subscribe to internal topics or queues through an egress event proxy or a managed egress gateway in the same perimeter, and only authenticated parties can publish or subscribe.
Solution Flow
Data Ingestion Flow (External Producer to Internal ESP):
- External Producer: A third-party system or partner publishes streaming data (e.g., messages, events) over a secure channel (e.g., TLS-enabled TCP or HTTPS) to the designated ingress endpoint.
- Web Application Firewall (WAF) / Event Proxy Ingress: The traffic first hits a public-facing Web Application Firewall (WAF) for initial security screening. Subsequently, a secure Event Proxy (Ingress) in the Public Subnet (Perimeter) receives the authenticated data stream, terminates TLS, and forwards it to the internal Event Streaming Platform.
- Event Streaming Platform (ESP): The internal ESP ingests the data into a configured topic or stream. Access control (ACLs, RBAC) is enforced at this layer.
- Backend Workload: Internal microservices or data processing pipelines subscribe to the ESP topic to consume, process, and act upon the ingested streaming data in real-time.
Data Publication Flow (Internal ESP to External Consumer):
- Backend Workload: An internal microservice publishes data or events to a topic on the Event Streaming Platform.
- Event Streaming Platform (ESP): The ESP manages the published data and makes it available to authorised subscribers.
- Event Proxy Egress / Managed NAT: For external consumption, the ESP or a dedicated internal service routes the data stream to an Event Proxy (Egress) or a Managed NAT/Egress Gateway in the Public Subnet (Perimeter). This egress point applies security policies (e.g., authentication, FQDN whitelisting) and performs any necessary network address translation.
- External Consumer: The authorised external system subscribes to the designated secure egress endpoint (e.g., through a stream API, managed queue, or dedicated endpoint) to receive the streaming data.
Cloud Paradigm
- Event-Driven Architecture (EDA)
- Asynchronous Messaging & Stream Processing
- Edge Security (Ingress/Egress control for event streams)
- Managed Service Consumption (for Event Streaming Platforms)
- Zero Trust Principles
Security Controls
- Perimeter Security: All external connections (inbound or outbound) must traverse a dedicated secure proxy or gateway deployed within the Public Subnet (Perimeter). Protect this gateway with a Web Application Firewall (WAF) to filter malicious traffic and prevent unauthorised access attempts.
- Transport Security: Mandate strict Transport Layer Security (TLS 1.2 or higher) for all data streams, ensuring end-to-end encryption for both inbound data ingestion and outbound data publication.
- Authentication & Authorisation:
- For system-to-system (B2B) integrations, authenticate external event producers and consumers using mechanisms such as OAuth 2.0 (Client Credentials Grant) or Mutual TLS (mTLS).
- Use access control lists (ACLs) or role-based access control (RBAC) on the Event Streaming Platform to enforce fine-grained authorisation for topic access (publish/subscribe).
- Traffic Management: Implement flow control mechanisms on the event proxy or Event Streaming Platform, such as rate limiting, throttling, and connection quotas, to prevent resource exhaustion from high-volume external traffic.
- Outbound Controls: When internal workloads publish data to external subscribers or systems, route all outbound streaming traffic through a managed Egress Gateway or dedicated event proxy. Configure strict egress filtering (IP whitelisting, FQDN whitelisting) and, if required, perform Data Loss Prevention (DLP) inspection on outbound streams.
- Data Integrity: Implement mechanisms to ensure data integrity, such as message signing or checksums, where applicable for critical data streams.
Builds on
Catalogue patterns this one applies. The names link to their catalogues; the notes on how they are used here are ours.
- Publish-Subscribe Channel (opens in a new tab) (Enterprise Integration Patterns): Several partners subscribe to the same outbound topic and each reads it independently, at its own pace.
- Event Message (opens in a new tab) (Enterprise Integration Patterns): What crosses the boundary is a record that something happened, such as a scan or a status change, not a request to act.
- Gateway Offloading (opens in a new tab) (Azure Architecture Center): The perimeter event proxy takes on TLS termination, partner authentication and, where it is set there, rate limiting, so external producers and consumers never connect to the platform directly.
When to Use
- You need continuous, real-time streaming exchange with external producers or consumers rather than request/response or batch file transfer.
- Both inbound ingestion and outbound publication must traverse a trust boundary with authenticated, controlled access at the perimeter.
- Multiple external partners subscribe to or publish onto the same event streams and require decoupled, independently-scaled consumption.
- Event ordering, replay, and durable retention matter, so consumers can catch up after downtime without data loss.
- You want to expose internal domain events externally via a governed contract (AsyncAPI/CloudEvents) without granting direct access to internal ESP brokers.
When NOT to Use
- The interaction is synchronous request/response. A managed API gateway or REST/gRPC pattern fits better: Integration API Management (External).
- Data volumes are low or infrequent; a simpler webhook or scheduled file transfer avoids ESP operational overhead.
- The external system only needs bulk historical extracts, where a batch ETL or data-share pattern is more economical.
- A single trusted partner communicates internally over a private link, making the public ingress/egress proxy layer unnecessary.
- Strict end-to-end payload confidentiality forbids TLS termination at a perimeter proxy, requiring a direct brokered or private-endpoint approach instead.
Trade-offs
- Real-time, decoupled cross-boundary streaming vs the operational burden of running an ESP plus ingress and egress proxies.
- Strong perimeter security via WAF, TLS termination, and authenticated proxies vs added latency and hops on every message.
- Durable, replayable event streams for external integrators vs the storage cost and stream governance discipline required to prevent breaking changes.
- Independent scaling of external producers and consumers vs the complexity of managing credentials, ACLs, and schema versioning across many parties.
- Standardised protocols and contracts (AsyncAPI, CloudEvents) vs the upfront effort to document, version, and maintain those interface specifications.
Implied decisions
- Choose how each partner authenticates: OAuth 2.0 client credentials or mutual TLS.
- Decide which partners' payloads may be decrypted at the perimeter proxy, and send any that may not through a direct brokered or private-endpoint path.
- Choose the protocols and formats partners must use (for example Kafka protocol, AMQP or MQTT; JSON, Avro or Protobuf) and publish them as an AsyncAPI contract with CloudEvents metadata.
- Set how long each topic retains events for replay, which also sets its storage cost.
- Agree topic naming and versioning rules, so a schema change cannot break an external integrator.
- Set rate limits, throttling and connection quotas per partner at the proxy or on the platform.
Additional Details
- Protocols & Formats: Use open streaming protocols (e.g., Kafka protocol, AMQP, MQTT over TLS, WebSocket). Data formats should be standardised (e.g., JSON, Avro, Protobuf) and adhere to common data models or industry standards. Event metadata should conform to specifications like CloudEvents.
- Documentation & Specification: Publish detailed interface documentation for external producers and consumers, using specifications such as AsyncAPI for event-driven architectures. Define clear schema for data objects exchanged.
- Credential Management: Implement a mechanism for securely managing credentials (e.g., API keys, OAuth client secrets, mTLS certificates) for all external parties interacting with the Event Streaming Platform.
- Observability: Enable comprehensive logging, metrics (message throughput, latency, error rates), and distributed tracing (e.g., OpenTelemetry) across the entire streaming pipeline, including the event proxies and the Event Streaming Platform, to monitor cross-boundary data flows and quickly diagnose issues.
- Stream Governance: Implement strict topic/stream naming conventions, versioning strategies, and lifecycle management for event streams to maintain consistency and avoid breaking changes for external integrators. Treat ESP configurations as code (IaC/GitOps) for repeatable deployments.
Illustrative Scenario
A hypothetical scenario showing how the pattern applies. Not a client case study.
A global parcel carrier streams shipment tracking events across its partner network using this pattern. Retail shippers and customs brokers publish scan and manifest events over TLS to a public ingress endpoint, where a WAF screens traffic before a secure Event Proxy terminates TLS and forwards messages onto internal Kafka-protocol topics with RBAC enforced. Each shipper authenticates with OAuth 2.0 client credentials, and the proxy applies a rate limit per partner, so one shipper's end-of-day burst cannot starve the others. Route-optimisation and delivery-estimation microservices consume these streams in real time. Backend workloads publish enriched status updates (out-for-delivery, exception and proof-of-delivery events) back to an ESP topic. An egress Event Proxy then applies mTLS authentication and FQDN allow-listing, and each e-commerce marketplace subscribes to the same status stream through it and reads at its own pace. When a marketplace's consumer is offline overnight, it replays the retained events in the morning and catches up without losing a scan. AsyncAPI specifications and Avro schemas govern every payload, while OpenTelemetry tracing measures throughput and latency across the perimeter so operators can catch backlogs before customer-facing tracking pages lag.
Use and cite this
Free to use and adapt under CC BY 4.0. Credit: David Tirabassi, IT Architecture Patterns.
Attribution: Source: David Tirabassi, IT Architecture Patterns (https://www.itarchitecturepatterns.net/patterns/int-esp-external), licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).