Integration / Event Streaming
Event StreamingExternalIntegration Pattern

Integration Event Streaming (External)

David TirabassiUpdated

Problem

A backend workload must exchange streaming data in real time with external partners, both ingesting inbound events and publishing outbound feeds. Without a governed streaming boundary, external event flows bypass security controls or devolve into brittle point-to-point links that cannot authenticate parties or scale.

Solution

Establish an Event Streaming Platform with dedicated topics or streams for asynchronous data exchange. For inbound data ingestion from external producers, configure a secure ingress proxy within the Public Subnet (Perimeter) to receive data and forward it to internal platform topics. For outbound data publication to external consumers, provision secure egress endpoints or consumption mechanisms that allow external parties to subscribe to internal platform topics or queues via a managed egress gateway or dedicated event proxy, ensuring controlled and authenticated access.

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

Solution Flow

Data Ingestion Flow (External Producer to Internal ESP):

  1. 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.
  2. 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.
  3. 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.
  4. 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):

  1. Backend Workload: An internal microservice publishes data or events to a topic on the Event Streaming Platform.
  2. Event Streaming Platform (ESP): The ESP manages the published data and makes it available to authorized subscribers.
  3. 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.
  4. External Consumer: The authorized 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.

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.
  • 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.
  • Standardized protocols and contracts (AsyncAPI, CloudEvents) vs the upfront effort to document, version, and maintain those interface specifications.

Real-World Example

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. Route-optimization and delivery-estimation microservices consume these streams in real time. Enriched status updates — out-for-delivery, exception, and proof-of-delivery events — are published by backend workloads back to an ESP topic, then routed through an egress Event Proxy applying mTLS authentication and FQDN whitelisting, letting each e-commerce marketplace subscribe to its dedicated stream. 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.

Additional Details

  • Protocols & Formats: Use open streaming protocols (e.g., Kafka protocol, AMQP, MQTT over TLS, WebSocket). Data formats should be standardized (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, utilizing specifications such as AsyncAPI for event-driven architectures. Define clear schema for data objects exchanged.
  • Credential Management: Implement a robust 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.

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 unauthorized 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 & Authorization:
    • For system-to-system (B2B) integrations, authenticate external event producers and consumers using robust mechanisms such as OAuth 2.0 (Client Credentials Grant) or Mutual TLS (mTLS).
    • Utilize access control lists (ACLs) or role-based access control (RBAC) on the Event Streaming Platform to enforce fine-grained authorization 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.

Related Patterns