Created
November 3, 2016 08:18
-
-
Save SzymonPobiega/10be5a9356b8cc203fceda2e114980db to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public class EndpointConfig : IConfigureThisEndpoint | |
{ | |
public void Customize(BusConfiguration busConfiguration) | |
{ | |
var container = new UnityContainer(); | |
busConfiguration.UseTransport<MsmqTransport>(); | |
busConfiguration.UseSerialization<JsonSerializer>(); | |
busConfiguration.EnableInstallers(); | |
busConfiguration.UsePersistence<InMemoryPersistence>(); | |
busConfiguration.UseContainer<UnityBuilder>( | |
customizations: customizations => | |
{ | |
customizations.UseExistingContainer(container); | |
}); | |
} | |
} | |
public class Sender : IWantToRunWhenBusStartsAndStops | |
{ | |
public IBus Bus { get; set; } | |
public void Start() | |
{ | |
Bus.SendLocal(new MyMessage()); | |
Bus.SendLocal(new MyMessage()); | |
Bus.SendLocal(new MyMessage()); | |
} | |
public void Stop() | |
{ | |
} | |
} | |
public class MyMessage : IMessage | |
{ | |
} | |
public class MyMessageHandler : IHandleMessages<MyMessage> | |
{ | |
public void Handle(MyMessage message) | |
{ | |
Console.WriteLine("Got message"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment