Results 1 to 2 of 2

Thread: amqp thread prevents app from shutting down

  1. #1
    Join Date
    Jun 2011
    Posts
    26

    Default amqp thread prevents app from shutting down

    Amqp functionality is working perfectly in my application except when I wish to shut it down. I configure amqp entirely in xml and do not see how to stop the thread that it is working on. I know its the amqp thread because of the name:

    Thread[AMQP Connection 127.0.1.1:5672](Running)

    If while in debug I right click and terminate the thread the application shuts down, other wise I must manually stop in eclipse.

    I do no see anything in the docs or forum about shutting this down.

    What am I missing?

    Thanks,
    Bobby

  2. #2

    Default

    How are you loading the context? If you are doing so programmatically as a stand alone app for example:
    Code:
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "spring-conf.xml" );
    Make sure you register a shutdown hook so when the JVM goes down it allows Spring to destroy its beans.
    Code:
    context.registerShutdownHook();
    Alternatively, you can also close it manually when you are done with it:
    Code:
    context.close();
    I hope it helps.


    nicolas.loriente

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •