Created
January 12, 2018 17:34
-
-
Save hbulens/4c8d3964db21286214c9468b0712383f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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