Skip to content

Instantly share code, notes, and snippets.

@phatboyg
Created February 27, 2010 23:51
Show Gist options
  • Save phatboyg/317064 to your computer and use it in GitHub Desktop.
Save phatboyg/317064 to your computer and use it in GitHub Desktop.
// 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