Created
December 4, 2012 11:31
-
-
Save mynkow/4202891 to your computer and use it in GitHub Desktop.
Simo
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
PrepareQueues.Prepare("msmq://localhost/first", QueueType.Standard); | |
PrepareQueues.Prepare("msmq://localhost/second", QueueType.Standard); | |
var container = new WindsorContainer(new XmlInterpreter()); | |
container.Register(Component.For<IBusConfigurationAware>().ImplementedBy<MsmqTransportConfigurationAware>()); | |
var facility = new RhinoServiceBusFacility(); | |
container.AddFacility("rhino.esb", facility); | |
var customerHost = new DefaultHost(); | |
customerHost.Start<CustomBootStrapper>(); | |
var bus = customerHost.Container.Resolve<IServiceBus>(); | |
bus.Send(new Msg()); | |
} | |
} | |
public class CustomBootStrapper : AbstractBootStrapper | |
{ | |
protected override bool IsTypeAcceptableForThisBootStrapper(System.Type t) | |
{ | |
return t.Namespace == "RSB"; | |
} | |
} | |
public class Msg | |
{ | |
} | |
<?xml version="1.0"?> | |
<configuration> | |
<configSections> | |
<section name="castle" | |
type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor" /> | |
</configSections> | |
<castle> | |
<facilities> | |
<facility id="rhino.esb" > | |
<bus endpoint="msmq://localhost/first" /> | |
<messages> | |
<add name="RSB" | |
endpoint="msmq://192.168.1.33/second"/> | |
</messages> | |
</facility> | |
</facilities> | |
</castle> | |
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment