Getting started
Publish your first message.
In five short steps, start RabbitMQ, register a consumer, and publish an event. Choose C#, Java, or Kotlin at each step.
This walkthrough uses RabbitMQ so every infrastructure step is reproducible. Contracts, consumers, send, publish, request, retry, and fault concepts remain transport-neutral; only setup and transport configuration change for Azure Service Bus.
Java uses the MyServiceBus-first decorator style for a managed service graph. Kotlin uses native extensions over the same JVM runtime, removing the decorator and class-literal ceremony. Applications with an existing Spring, CDI, Dagger, Guice, or application-owned environment can still use the bus factory as their integration boundary. See the container and application-factory examples.
- 01
Start RabbitMQ in Docker
Run the tested RabbitMQ 4.1 broker locally with its management UI.
Shell Loading code…The broker listens on
localhost:5672. Open the management UI at localhost:15672 and sign in withguest/guest. Stop and remove the container withdocker stop myservicebus-rabbitmq. - 02
Install the RabbitMQ transport
The transport brings in the core runtime and abstractions.
Loading code…Using Maven? Add the same group, artifact, and version as a standard dependency.
- 03
Configure the bus
Register the consumer and let MyServiceBus create its receive endpoint.
Loading code… - 04
Define messages and a consumer
A consumer handles one message type through a consume context.
Loading code… - 05
Publish
Publishing fans the event out to every interested receive endpoint.
Loading code…