[rabbitmq-discuss] dotnet client background thread

joefitzgerald joeyfitz at gmail.com
Fri Dec 16 15:30:57 GMT 2011


It's even easier than that if you're using Spring.NET. Any object that
implements IDisposable is disposed automatically by the Spring.NET
container when the container is destroyed. The container is destroyed
when the application shuts down, and I think they use the ProcessExit
event to make that happen.

Reference: http://www.springframework.net/doc-latest/reference/html/objects.html#objects-factory-lifecycle-disposableobject

Cheers,
Joe

On Dec 16, 7:53 am, Brian Lalor <bla... at bravo5.org> wrote:
> On Dec 16, 2011, at 9:43 AM, Tony Garnock-Jones wrote:
>
> > Stepping back from the immediate problem, the "real" solution is to have the JVM and .NET virtual machines grow up and behave like proper systems, complete with lifecycle events. Then, AMQP connections have a chance to clean up and disconnect on their own, without special action on the part of the programmer and without unduly delaying or preventing VM shutdown.
>
> If you use Spring, you get events like these.  With Spring for Java, you can use the destroy-method attribute of the  <bean />  element to invoke a method when the context is shutting down.  I haven't used Spring with .Net, but I'd be surprised if there weren't a similar mechanism there.
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


More information about the rabbitmq-discuss mailing list