camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michele <michele.mazzi...@finconsgroup.com>
Subject Redelivery Policy set on Camel is ignored
Date Fri, 06 Nov 2015 06:47:20 GMT
Hi,

I'm enabling transaction in JMS Queue consuming route, and trying to
configure RedeliveryPolicy in Spring/Camel file as you can see below:

<bean id="myRedeliveryPolicyConfig"
class="org.apache.camel.processor.RedeliveryPolicy">
     <property name="maximumRedeliveries" value="3"/>
     <property name="redeliveryDelay" value="60000"/>
     <property name="retryAttemptedLogLevel" value="WARN" />
  </bean>
  <bean id="exceptionHandler"
class="org.apache.camel.spring.spi.TransactionErrorHandlerBuilder">
  <property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig" />
    </bean>
 
  <camelContext id="ActiveMQContext"
xmlns="http://camel.apache.org/schema/spring">
  <route id="FileToJMS">
  <from uri="file:${uriToFile}" />
  <to uri="activemq:queue:incomingTickets" />
  </route>
 
  <route errorHandlerRef="exceptionHandler" id="normalize-message-data">
  <from uri="activemq:incomingTickets" />
  <transacted />
  <log message="Received: ${body}" />
  <rollback />

     <to uri="mock:result" />
  </route>
  </camelContext>
 
I invoke rollback to check if messages are redelivered to a client.
But redelivery policy configuration is ignored because all redeliveries are
immediate (Underline log warn)

*First attempt*
*12:37:23,471 | WARN  | incomingTickets] | TransactionErrorHandler    *     
| 198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Transaction
rollback (0x64f41c09) redelivered(false) for (MessageId:
ID:FGBAL201530-51469-1446720227638-11:4:3:1:1 on ExchangeId:
ID-FGBAL201530-51470-1446720230674-5-3) caught:
org.apache.camel.RollbackExchangeException: Intended rollback.
Exchange[JmsMessage[JmsMessageID:
ID:FGBAL201530-51469-1446720227638-11:4:3:1:1]]
12:37:23,471 | WARN  | incomingTickets] | EndpointMessageListener          |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Execution of JMS
message listener failed. Caused by: [org.apache.camel.RuntimeCamelException
- org.apache.camel.RollbackExchangeException: Intended rollback.
Exchange[JmsMessage[JmsMessageID:
ID:FGBAL201530-51469-1446720227638-11:4:3:1:1]]]
12:37:23,511 | INFO  | incomingTickets] | normalize-message-data           |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Received: Azienda
7 by Rest API,example4@example.com
12:37:23,521 | WARN  | incomingTickets] | TransactionErrorHandler          |
203 - org.apache.camel.camel-spring - 2.15.1.redhat-620133 | Rollback
(MessageId: ID:FGBAL201530-51469-1446720227638-11:4:3:1:1 on ExchangeId:
ID-FGBAL201530-51470-1446720230674-5-4) due: Intended rollback.
Exchange[JmsMessage[JmsMessageID:
ID:FGBAL201530-51469-1446720227638-11:4:3:1:1]]
12:37:23,521 | WARN  | incomingTickets] | TransactionErrorHandler          |
203 - org.apache.camel.camel-spring - 2.15.1.redhat-620133 | Rollback
(MessageId: ID:FGBAL201530-51469-1446720227638-11:4:3:1:1 on ExchangeId:
ID-FGBAL201530-51470-1446720230674-5-4) due: Intended rollback.
Exchange[JmsMessage[JmsMessageID:
ID:FGBAL201530-51469-1446720227638-11:4:3:1:1]]

*Second attempt*
*12:37:23,521 | WARN  | incomingTickets] | TransactionErrorHandler*         
| 198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Transaction
rollback (0x64f41c09) redelivered(true) for (MessageId:
ID:FGBAL201530-51469-1446720227638-11:4:3:1:1 on ExchangeId:
ID-FGBAL201530-51470-1446720230674-5-4) caught:
org.apache.camel.RollbackExchangeException: Intended rollback.
Exchange[JmsMessage[JmsMessageID:
ID:FGBAL201530-51469-1446720227638-11:4:3:1:1]]
12:37:23,521 | WARN  | incomingTickets] | EndpointMessageListener          |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Execution of JMS
message listener failed. Caused by: [org.apache.camel.RuntimeCamelException
- org.apache.camel.RollbackExchangeException: Intended rollback.
Exchange[JmsMessage[JmsMessageID:
ID:FGBAL201530-51469-1446720227638-11:4:3:1:1]]]
12:37:23,581 | INFO  | incomingTickets] | normalize-message-data           |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Received: Azienda
7 by Rest API,example4@example.com
12:37:23,581 | WARN  | incomingTickets] | TransactionErrorHandler          |
203 - org.apache.camel.camel-spring - 2.15.1.redhat-620133 | Rollback
(MessageId: ID:FGBAL201530-51469-1446720227638-11:4:3:1:1 on ExchangeId:
ID-FGBAL201530-51470-1446720230674-5-5) due: Intended rollback.
Exchange[JmsMessage[JmsMessageID:
ID:FGBAL201530-51469-1446720227638-11:4:3:1:1]]
12:37:23,581 | WARN  | incomingTickets] | TransactionErrorHandler          |
203 - org.apache.camel.camel-spring - 2.15.1.redhat-620133 | Rollback
(MessageId: ID:FGBAL201530-51469-1446720227638-11:4:3:1:1 on ExchangeId:
ID-FGBAL201530-51470-1446720230674-5-5) due: Intended rollback.
Exchange[JmsMessage[JmsMessageID:
ID:FGBAL201530-51469-1446720227638-11:4:3:1:1]]
 
and so on.
What do I do to achieve a redelivery with interval of one minute and max
redeliveries 3? I wrong a configuration?
 
Environment:
JBoss Fuse 6.2 on Java 1.8
 
Thank you in advance
 
Regards
Michele



--
View this message in context: http://camel.465427.n5.nabble.com/Redelivery-Policy-set-on-Camel-is-ignored-tp5773409.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message