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
ChainedTransactionManager
configured with aJmsTransactionManager
and aDataSourceTransactionManager
(the attached test case replaces the DataSourceTransactionManager with a stub which fails) - a transacted route
- a
RedeliveryPolicyMap
configured on theActiveMQConnectionFactory
- the
RedeliveryPolicyMap
has 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
RedeliveryPolicyMap
is configured the route fails cleanly and quickly - if a
RedeliveryPolicyMap
is 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
defaultEntry
on 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, tools, and much more.