Created
February 27, 2010 23:51
-
-
Save phatboyg/317064 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
// message sender coder | |
IServiceBus bus = ObjectFactory.GetInstance<IServiceBus>(); | |
var message = new MyCommand { Text = "How's it going?" }; | |
ObjectFactory.GetInstance<IEndpointFactory>().GetEndpoint("msmq://localhost/test_server").Send(message, x => x.SendResponseTo(bus)); | |
/// - snip | |
Main(...) | |
{ | |
MsmqEndpointConfigurator.Defaults(x => x.CreateMissingQueues = true); | |
IServiceBus bus = ObjectFactory.GetInstance<IServiceBus>(); | |
bus.Subscribe<MyCommand>(message => {}); | |
Console.WriteLine("Hit enter to exit."); | |
Console.ReadLine(); | |
} | |
public class MyCommand | |
{ | |
public string Text { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment