The Eventuous Gateway is a lightweight infrastructure component that connects a subscription on one transport to a producer on another. It reads events from a source (e.g. the KurrentDBDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Eventuous/eventuous/llms.txt
Use this file to discover all available pages before exploring further.
$all stream), optionally transforms or filters them, and publishes the results to a target (e.g. a Kafka topic or an Azure Service Bus queue). It is the standard pattern for building event-driven integration pipelines in Eventuous without writing bespoke polling loops.
Installation
Core concepts
| Type | Role |
|---|---|
IGatewayTransform<TProduceOptions> | Your code: maps one incoming event to zero or more outgoing messages |
RouteAndTransform<TProduceOptions> | Delegate form of the same contract |
GatewayMessage<TProduceOptions> | The output value: target stream + message + options |
GatewayHandler<TProduceOptions> | Internal IEventHandler that wires transform → producer |
GatewayProducer<TProduceOptions> | Wraps a producer, waits for it to be ready if it’s an IHostedProducer |
The transform interface
ImplementIGatewayTransform<TProduceOptions> to control routing and translation:
GatewayMessage<T> records to fan out a single incoming event to several targets.
GatewayMessage<TProduceOptions> is a simple record:
Implementing a gateway transform
The example below bridges KurrentDB to Kafka. Events of typeBookingRegistered are translated into an integration event and routed to the booking-events topic. All other event types are dropped.
Registering the gateway
UseAddGateway to wire the subscription, transform, and producer together in one call. The registration automatically handles:
- Registering the producer as a singleton and starting it as a hosted service (if it implements
IHostedProducer) - Building the consume pipeline
- Wrapping the producer in
GatewayProducer<T>so it waits until the broker connection is established before producing
With a class-based transform
With an inline delegate
Configuring the subscription
PassconfigureSubscription and configureBuilder to adjust subscription options and add additional handlers:
awaitProduce
When awaitProduce is true (the default), the gateway waits for the producer to confirm delivery before the subscription considers the event handled. Set it to false for fire-and-forget semantics, where the subscription acknowledges immediately and produce happens asynchronously.
How metadata flows
GatewayProducer<T> preserves correlation and causation IDs from the inbound context by injecting them into the ProducedMessage metadata before forwarding to the underlying producer. This means tracing identifiers propagate transparently across transport boundaries without any extra code in your transform.