Best way to control how often to show errors in the log in message consumer MDB

Solution In Progress - Updated -

Issue

Is there any best way to control how often to show errors in the log thrown from my message consumer MDB application?

We have message consumer MDBs running inside JBoss-EAP-6.2. Whenever there are db related errors happened when calling datasource.getConnection(), MDB will return message back to the queue by calling MessageDrivenContext.setRollbackOnly() for the next redelivery; in the meanwhile, we log this situation, the message looks like: "Can not get db connection, send message back to the queue". Ideally, we want to see this kind of error once/a few times while waiting for db/connection is back since message traffic is huge, that will be horrible if every time to log when message gets consumed under db connection not available.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.