Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When starting, app hangs if there are messages in the queue #61

Closed
lukeschafer opened this issue Mar 20, 2014 · 6 comments
Closed

When starting, app hangs if there are messages in the queue #61

lukeschafer opened this issue Mar 20, 2014 · 6 comments

Comments

@lukeschafer
Copy link
Contributor

So far, this has been exhibited running in IIS with commands already in a queue. The handler is never run but the app hangs on startup.

@lukeschafer
Copy link
Contributor Author

more info

2014-03-19 10:32:46.854 +10:00 [Debug] Constructing bus...
2014-03-19 10:32:46.879 +10:00 [Debug] Creating message pumps and subscriptions.
2014-03-19 10:32:46.892 +10:00 [Debug] Creating command message pumps
2014-03-19 10:32:46.893 +10:00 [Debug] Creating message pump for command type "ConvertToPDFCommand"
2014-03-19 10:32:46.904 +10:00 [Debug] Creating request message pumps
2014-03-19 10:32:46.907 +10:00 [Debug] Creating multicast request message pumps
2014-03-19 10:32:46.909 +10:00 [Debug] Creating multicast event message pumps
2014-03-19 10:32:46.912 +10:00 [Debug] Creating competing event message pumps
2014-03-19 10:32:46.912 +10:00 [Debug] Message pumps and subscriptions are all created.
2014-03-19 10:32:46.914 +10:00 [Debug] Bus built. Job done!
2014-03-19 10:32:46.925 +10:00 [Debug] Bus starting...
2014-03-19 10:32:46.937 +10:00 [Debug] Message pump for "inputqueue.order.endpoint.MACHINENAME" starting...
2014-03-19 10:32:46.937 +10:00 [Debug] Message pump for "q.pdf.messages.converttopdfcommand" starting...
2014-03-19 10:32:46.959 +10:00 [Debug] Fetching existing queues...
2014-03-19 10:32:48.302 +10:00 [Debug] Message pump for "inputqueue.order.endpoint.MACHINENAME" started
2014-03-19 10:32:48.348 +10:00 [Debug] Dispatching message: "Microsoft.ServiceBus.Messaging.BrokeredMessage{MessageId:1d3cd07401ba48fc9f2db2acb879854a}" from null

@lukeschafer
Copy link
Contributor Author

OK, so what I've determined so far (and enough to implement a work-around):

We're using Nancy+Autofac. Configuration happens in the bootstrapper, but doesn't activate. The first handler has a bus dependency so nimbus was activating during a nancy request. Not sure what was at play there, but I found that by resolving IBus straight after the container initialisation caused everything to work just fine.

@gertjvr
Copy link
Contributor

gertjvr commented Mar 20, 2014

Something I have done with autofac is register the bus as follow

builder.RegisterNimbus(handlerTypesProvider);
builder.Register(componentContext => new BusBuilder()
                     .Configure()
                     .WithConnectionString(connectionString)
                     .WithNames("MyApp", Environment.MachineName)
                     .WithTypesFrom(handlerTypesProvider)
                     .WithAutofacDefaults(componentContext)
                     .Build())
       .As<IBus>()
       .AsSelf()
       .SingleInstance();

and on service / application start call container.Resolve<Bus>().Start() this has another nice affect doing any convention tests (can all message types resolve from the container) doesn't start the bus.

@lukeschafer
Copy link
Contributor Author

Yeah cheers. Our solution was pretty much similar :)

@DamianMac
Copy link
Contributor

@lukeschafer Were you calling Start or Autoactivate on the bus as part of your container configuration like we do here ? If you did that and it's not starting automatically that's a worry.

@lukeschafer
Copy link
Contributor Author

Yeah we were using auto activate.
On 29/03/2014 11:13 AM, "Damian Maclennan" notifications@github.com wrote:

@lukeschafer https://github.com/lukeschafer Were you calling Start or
Autoactivate on the bus as part of your container configuration like we
do herehttp://nimbusapi.github.io/doc/Configuring-Nimbus-With-Autofac.html? If you did that and it's not starting automatically that's a worry.

Reply to this email directly or view it on GitHubhttps://github.com//issues/61#issuecomment-38982506
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants