Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System;
using NServiceBus;
namespace hbulens.ServiceBus.Subscriber
{
class Program
{
static void Main(string[] args)
{
BusConfiguration busConfiguration = new BusConfiguration();
busConfiguration.EndpointName("hbulens.ServiceBus.Subscriber"); busConfiguration.UseSerialization<JsonSerializer>();
busConfiguration.EnableInstallers();
busConfiguration.UsePersistence<InMemoryPersistence>();
using (IBus bus = Bus.Create(busConfiguration).Start())
{
Console.WriteLine("Press any key to exit"); Console.ReadKey();
}
}
}
}
using System;
using NServiceBus;
using hbulens.ServiceBus.Messages;
namespace hbulens.ServiceBus.Subscriber
{
public class OrderCreatedHandler : IHandleMessages<OrderMessage>
{
void IHandleMessages<OrderMessage>.Handle(OrderMessage message)
{
Console.WriteLine(@"Handling: OrderPlaced for Order Id: {0}", message.Id);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.