# MassTransit (/integrations/masstransit)



[MassTransit](https://masstransit.io) is the open-source distributed-application framework for .NET. **MassTransit.KubeMQ** is a MassTransit *transport* that runs the bus over KubeMQ via gRPC: you register it the same way you would RabbitMQ or Azure Service Bus, and your existing consumers, sagas, and message contracts work unchanged on KubeMQ.

Because the transport plugs in below the MassTransit abstractions, adopting KubeMQ is a configuration change rather than a rewrite. Message contracts, `IConsumer<T>` implementations, sagas, the middleware pipeline, serialization, retry/redelivery policies, the EF Core outbox, OpenTelemetry, and DI registration (`AddConsumer<T>`, `AddSaga<T>`) all behave identically — only where messages physically travel changes.

New to the idea? See [what is an integration](/integrations#what-an-integration-is) for how SDK-level integrations differ from the server-side [connectors](/connectors).

## Why MassTransit + KubeMQ [#why-masstransit--kubemq]

* **Drop-in transport swap** — change `UsingRabbitMq`, `UsingAzureServiceBus`, or `UsingAmazonSqs` to `UsingKubeMQ`; contracts and consumers stay the same.
* **Native request/response** — KubeMQ's CQ pattern provides built-in request-reply with no temporary reply queues (unlike RabbitMQ/SQS, which simulate it).
* **Fire-and-forget or durable-replayable publish** — `Publish<T>()` maps to KubeMQ Events for fan-out, or to EventsStore for persistent, replayable pub/sub.
* **Built-in priority queues and consumer groups** — weighted priority channels and competing consumers without extra infrastructure.
* **Full observability** — W3C trace context is propagated via tags, and the bus integrates with ASP.NET Core health checks and a `MassTransit.KubeMQ` metrics meter.

## Install [#install]

```bash title="terminal"
dotnet add package MassTransit.KubeMQ
```

The transport targets `net8.0` and requires MassTransit `>= 8.5.0`.

## Supported versions [#supported-versions]

| Requirement   | Supported versions                         |
| ------------- | ------------------------------------------ |
| Language      | C# / .NET (`net8.0` target)                |
| Runtime       | .NET SDK `8.0+`                            |
| MassTransit   | `>= 8.5.0`                                 |
| KubeMQ broker | Reachable over native gRPC on port `50000` |
| Package       | `MassTransit.KubeMQ` `1.0.0`               |

<Callout type="info">
  The transport is a **native gRPC client** that connects to KubeMQ on port `50000`. It is not an HTTP connector, so there is no `CONNECTORS*_ENABLE` flag to set — exposing the gRPC port is all that is needed. KubeMQ channels are created automatically on first use; there is no exchange, binding, virtual host, or topic-subscription topology to provision.
</Callout>

## Architecture [#architecture]

Your application talks to MassTransit abstractions as usual. The transport layers KubeMQ onto an InMemory base bus (for the `IBusControl` lifecycle) plus a **KubeMQ rider** that owns the connections and receive transports. The rider bridges those abstractions to the broker over gRPC on port `50000`, where KubeMQ dispatches to its four native subsystems.

<Mermaid
  chart="`
graph LR
APP[&#x22;MassTransit application<br/>(IConsumer&lt;T&gt; · IPublishEndpoint · IRequestClient&lt;T&gt;)&#x22;]
RIDER{{&#x22;MassTransit.KubeMQ<br/>transport (rider)&#x22;}}
BROKER[&#x22;KubeMQ broker&#x22;]
Q[&#x22;Queues&#x22;]
E[&#x22;Events&#x22;]
ES[&#x22;EventsStore&#x22;]
CQ[&#x22;Commands / Queries&#x22;]

APP -- &#x22;Send · Publish · Request&#x22; --> RIDER
RIDER -- &#x22;gRPC :50000&#x22; --> BROKER
BROKER --> Q
BROKER --> E
BROKER --> ES
BROKER --> CQ

class APP external
class RIDER aiway
class BROKER,Q,E,ES,CQ broker
`"
/>

*The KubeMQ rider maps MassTransit's transport-agnostic operations onto native KubeMQ Queues, Events, EventsStore, and CQ over gRPC.*

## Pattern mapping [#pattern-mapping]

MassTransit's transport-agnostic verbs map to KubeMQ's native messaging patterns. The mapping determines delivery semantics and which KubeMQ subsystem backs each message.

| MassTransit verb      | KubeMQ pattern        | Delivery                                          | Capability page                                                         |
| --------------------- | --------------------- | ------------------------------------------------- | ----------------------------------------------------------------------- |
| **Send**              | Queues                | Point-to-point (exactly one consumer)             | [Queues](/integrations/masstransit/how-to/queues)                       |
| **Publish**           | Events                | Fan-out (all active subscribers, fire-and-forget) | [Events](/integrations/masstransit/how-to/events)                       |
| **Publish** (durable) | EventsStore           | Fan-out with persistence and replay               | [Events Store](/integrations/masstransit/how-to/events-store)           |
| **Request/Response**  | Commands/Queries (CQ) | Native request-reply                              | [Commands & Queries](/integrations/masstransit/how-to/commands-queries) |

## Capabilities [#capabilities]

<Cards>
  <Card title="Events (Publish)" href="/integrations/masstransit/how-to/events" description="Fire-and-forget fan-out backed by KubeMQ Events, with consumer groups and volatile-delivery semantics." />

  <Card title="Queues (Send)" href="/integrations/masstransit/how-to/queues" description="Durable point-to-point delivery: delayed send, TTL, batch consumers, priority queues, and competing consumers." />

  <Card title="Commands & Queries (Request/Response)" href="/integrations/masstransit/how-to/commands-queries" description="Native request-reply over KubeMQ CQ — no temporary reply queues — with CqMode selection and timeouts." />

  <Card title="Events Store (Durable Publish)" href="/integrations/masstransit/how-to/events-store" description="Persistent, replayable fan-out where late subscribers catch up from a configurable start position." />
</Cards>

## Next steps [#next-steps]

<Cards>
  <Card title="Getting started" href="/integrations/masstransit/tutorials/getting-started" description="Send and receive your first message over the KubeMQ transport in minutes." />

  <Card title="Concepts" href="/integrations/masstransit/concepts" description="How the rider, channel naming, header mapping, CQ modes, and the connection lifecycle work." />

  <Card title="Guides" href="/integrations/masstransit/how-to/configuration" description="Configuration, error handling and DLQ, observability, and migrating from another transport." />

  <Card title="Reference" href="/integrations/masstransit/reference/configuration" description="Transport options, configurator API, EventsStore positions, channel naming, and error codes." />
</Cards>

New to KubeMQ? Start with the [KubeMQ Getting Started guide](/deploy) for the core messaging concepts.
