Reputation: 34183
I'm running NSB 3.2.8 self-hosted in an MVC4 app, this is my config:
Configure.With()
.DefiningMessagesAs(t => t.Namespace != null && namespaces.Contains(t.Namespace))
.CastleWindsorBuilder(container)
.XmlSerializer()
.Log4Net()
.MsmqTransport()
.IsTransactional(true)
.IsolationLevel(IsolationLevel.ReadUncommitted)
.PurgeOnStartup(false)
.UnicastBus()
.ImpersonateSender(false)
.CreateBus()
.Start();
I can add a dependency to IBus
in my controllers and send messages into the queue with Bus.SendLocal()
but the queue is not being read from and there is no log4net log file being created.
Upvotes: 0
Views: 631
Reputation: 18615
You don't mention what queue you expect it to read from. Since an MVC-hosted app does not have an IConfigureThisEndpoint
class to infer the endpoint name, you should use .DefineEndpointName("MyEndpoint")
right after Configure.With()
to do so - this will set the name for the input queue, if applicable.
The other issue that I see is that after .UnicastBus()
you would need to call .LoadMessageHandlers()
to declare your intent to process messages in the MVC app. Many times a web application will be a send-only endpoint, and so there is no need to create an input queue or process any messages from it. Calling this method will scan your types for message handlers, and begin reading from the queue.
Upvotes: 5
Reputation: 3414
I think you need to use Configure.WithWeb()
Also, how do you define the name of your endpoint?
Upvotes: 0