Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Spring AMQP - JVM not closing after message is sent?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm relatively new to Spring and very new to RabbitMQ. I've been trying to learn the basics of Spring's AMQP integration, but I'm getting hung up on something.

All I'm trying to do is create a basic RabbitTemplate and send a simple String to the default exchange, with the routing key set to just a test queue I made. That all works fine - the message is sent, and the SimpleMessageListenerContainer consumes and processes the message just fine.

Everything (I believe) is being created within the Spring context, and it's all just started from a main method - what seems to be happening though is whatever thread that sends the message is not ending, and as a result the JVM will not close until I actually stop it (all from within Eclipse)

Here is my app configuration:



And here is my MessageHandler:



And finally the main App that launches the context:



Is this expected? Am I just missing some fundamental concept? Any help in understanding this behavior would be greatly appreciated!
 
Mahalaghda Gumbahldi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh and one other piece I forgot to mention - Until I close the JVM myself, 1 connection and 1 channel do remain open in the RabbitMQ admin page. So I'm guessing that has something to do with it - but I cannot figure out how to get that connection to close? I would think that the context closing would signal the connection to close as well, but as I said I am very new to all of this
 
Mahalaghda Gumbahldi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just figured out the issue - my app class wasn't being loaded into/from the context >_<
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic