NullPointerException is thrown if a RedeliveryPolicyMap is configured without a default RedeliveryPolicy
Issue
- We are currently running Fuse 6.1.0 R2P6, although the issue has been confirmed against ActiveMQ 5.11.0 (which is contained in Fuse 6.2.0).
-We have- a
ChainedTransactionManagerconfigured with aJmsTransactionManagerand aDataSourceTransactionManager(the attached test case replaces the DataSourceTransactionManager with a stub which fails) - a transacted route
- a
RedeliveryPolicyMapconfigured on theActiveMQConnectionFactory - the
RedeliveryPolicyMaphas no "defaultEntry" set
- a
If the associated database is unavailable when a message is received on the JMS queue a NullPointerException is logged and the route takes twice as long to fail (compared with the other situations below).
- Other situations
- if no
RedeliveryPolicyMapis configured the route fails cleanly and quickly - if a
RedeliveryPolicyMapis configured and a "defaultEntry" is set the route fails cleanly and quickly
- if no
The NullPointerException is thrown from:
- activemq-client-5.9.0.redhat-610379
- org.apache.activemq.ActiveMQMessageConsumer#rollback()
- Line 1199, where org.apache.activemq.ActiveMQMessageConsumer#redeliveryPolicy is null
- We have a workaround; set the
defaultEntryon the configured RedeliveryPolicyMap. This ticket is more about A-MQ improvement either- complaining early and loudly about bad configuration or
- appropriately handling the case when a null RedeliveryPolicy is encountered
Environment
- Red Hat JBoss Fuse
- 6.x
- Apache ActiveMQ
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
