Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.1.1
-
Fix Version/s: 2.1.1
-
Component/s: Transport: JMS
-
Labels:None
-
Environment:
OS/X
-
User impact:Medium
-
Configuration:
-
Log Output:
-
Similar Issues:None
Description
I have the following AbstractPolicyTemplate and RetryPolicy implementations:
public class SimpleRetryPolicyTemplate extends AbstractPolicyTemplate {
public RetryPolicy createRetryInstance() { return new SimpleRetryPolicy(); }
protected static class SimpleRetryPolicy implements RetryPolicy {
public PolicyStatus applyPolicy(Throwable throwable) {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
return PolicyStatus.policyOk();
}
}
}
When configured on an ActiveMQ connector as follows:
<jms:activemq-connector name="jmsConnector" specification="1.1" brokerURL="${jms.url}">
The retry policy works on Mule startup - if the ActiveMQ server is down, the connector will attempt to reconnect every 5 seconds. If I bring the ActiveMQ server down, however, the exception entered in "Log Output" is thrown. The "Configuring Retry Policies" documentation (http://mule.mulesource.org/display/MULE2USER/Configuring+Retry+Policies) seems to indicate this should work. I haven't (yet) tested with other transport.s
Sorry, I failed to add the full configuration. Here it is:
<jms:activemq-connector name="jmsConnector" specification="1.1" brokerURL="${jms.url}">
<spring:property name="retryPolicyTemplate">
<spring:bean class="SimpleRetryPolicyTemplate"/>
</spring:property>
</jms:activemq-connector>