Question

I'm debugging a console app that processes a data file and fires events using a service bus. On startup, the program starts the bus:

ObjectFactory.GetInstance<IStartableServiceBus>().Start();

Then for each record in the file, it fires something like this:

serviceBus.Send(new MyCustomEvent(id));

Lately, the console has failed with the following exception:

InvalidOperationException: Cannot send a message before transport is started
at Rhino.ServiceBus.Msmq.MsmqTransport.Send(Endpoint destination, Object[] msgs)
at Rhino.ServiceBus.Impl.DefaultServiceBus.Send(Endpoint endpoint, Object[] messages)
at Rhino.ServiceBus.Impl.DefaultServiceBus.Send(Object[] messages)
at MyProgram.Processor.Process(Record record) in c:\Projects\MyProgram\Source\MyProgram\Processor.cs:line 183

When I debug it, the error is throwing the second time Send is called. I get no other exceptions, but something seems to be closing my service bus.

Any idea how I can figure out what's closing the bus?

Was it helpful?

Solution

It ended up being a bug in StructureMap, so upgrading to the latest version fixed the problem.

See more here: https://groups.google.com/forum/#!topic/rhino-tools-dev/rGl41fivpxc

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top