INNER CODE UNIT · C#
Program
christopherread/Obvs · Obvs.ActiveMQ.Test.Service/Program.cs:30
class Program
{
static void Main(string[] args)
{
IServiceBus serviceBus = ServiceBus.Configure()
.WithActiveMQEndpoints<IMyServiceMessage>()
.Named("MyService")
.UsingQueueFor<ICommand>()
.ConnectToBroker("tcp://192.168.99.100:32780") // local docker port for 61616
.WithCredentials("TESTUSER", "testpassword")
.SerializedAsJson()
.AsServer()
.Create();
serviceBus.Commands.Subscribe(async c =>
{
Console.WriteLine("Received command " + c);
await serviceBus.PublishAsync(new MyEvent());