-
Oct 24th, 2012, 07:49 PM
#1
losing amqp messages when db connection is lost
I'm using Spring Integration 2.1.4, Hibernate 3.6, and RabbitMQ. If my consumer starts with a valid connection to the Rabbit server, but fails to build a db connection pool for Hibernate, the service activator (implementing org.springframework.integration.core.MessageHandle r) will continue to pull messages off the queue and then discard them all. The Hibernate exception never reaches the handleMessage method so I cannot catch it. The Hibernate exception is thrown up via a proxy. Ideally, I'd like to catch a specific Hibernate exception and then call System.exit(1). How can I know I've lost my connection or failed to build the pool, and then kill the jvm? Imagine a scenario where I started my mq consumer with valid credentials to the Rabbit server but bad credentials to the database. Currently my mq consumer discards all the mq messages faster than I can blink. I cannot allow that on my production servers. What am I doing wrong? My handleMessage method is annotated with @Transactional and I'm using a HibernateTransactionManager. My amqp inbound channel adapter is transacted, acknowledge-mode is auto, and tx-size is 1. -Ben
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
-
Forum Rules