Hi
I've encountered a scenerio I'm unable to implement using Apache Camel.
I want to have a component that polls messages from JMS queue and
processes
them in some way. The problem is, there may be some problems, errors,
exceptions,
and the processing fails. That's why I need to leave the message in the
queue, so
the broker can retry it in some later time.
I've used servicemix-jms, since I'm deploying the thing on Servicemix
(3.3), to
achieve this. My config looks like this:
#v+
<jms:endpoint service="ts:WorkflowConsumerService"
endpoint="default"
targetService="ts:WorkflowConsumerCamelService"
targetEndpoint="default"
role="consumer"
processorName="jca"
connectionFactory="#connectionFactory"
resourceAdapter="#ra"
activationSpec="#activationSpec"
bootstrapContext="#bootstrapContext"
synchronous="true"
rollbackOnError="true"
wsdlResource="classpath:LeadManagement.wsdl"
defaultMep="http://www.w3.org/2004/08/wsdl/in-only"/>
<bean name="connectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>activemq/connectionFactory</value>
</property>
</bean>
<bean name="ra"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>activemq/resourceAdapter</value>
</property>
</bean>
<bean id="activationSpec"
class="org.apache.activemq.ra.ActiveMQActivationSpec">
<property name="destination" value="example/C"/>
<property name="destinationType" value="javax.jms.Queue"/>
<property name="maximumRedeliveries" value="10"/>
<property name="initialRedeliveryDelay" value="10000"/>
</bean>
<jee:jndi-lookup id="bootstrapContext"
jndi-name="java:comp/env/smx/BootstrapContext">
</jee:jndi-lookup>
#v-
As you can see, I'm using activationSpec to configure redeliveries. I'd
like to know if this
is possible to achieve using pure camel config? To this moment I've
only achieved retrying when
the processing fails - I simply set connection to the broker as
transacted. But I don't
know how to force the time between redeliveries and other things.
Regards
Marcin