On Fri, Jul 10, 2009 at 12:51 PM, Leen Toelen<[email protected]> wrote: > Hi, > thanks a lot for the very detailed feedback. I'll give it a try. >
The last bit, the warning. What kind of warning do you have in mind? BTW: Camel itself can also handle redelivery and do all sorts of tricks in relation to this. See general error handling with Camel here: http://camel.apache.org/error-handling-in-camel.html But since you use JMS it comes with build in error handling already. But imagine you do file based routing, then Camel can handle the redelivery attempts and do incremental delays. And in case of still failure you can route the message to another endpoint, or even another route of choice. And also eg send an email in case of failure or whatnot. > Regards, > Leen > > On Fri, Jul 10, 2009 at 12:42 PM, Claus Ibsen <[email protected]> wrote: > >> On Fri, Jul 10, 2009 at 11:19 AM, Leen Toelen<[email protected]> wrote: >> > Hi, >> > I would like to use an synchronous queueing mechanism, where the >> processing >> > (posting to an HTTP endpoint) is retried muliple times on failure. The >> retry >> > schedule schould be manageable so the retry timer increments and in the >> end >> > a warning is provided, much like most email servers work. The queue >> should >> > work reliably, and be as simple as possible (journal backend, no >> remoting, >> > no management). The activemq journal component comes close, but I don't >> know >> > if an endpoint can resubmit failed messages for later processing. >> > Does camel have such a component (or combination of components)? >> > >> Hi >> >> Welcome to the Camel community. >> >> You can use ActiveMQ for the queue and use persistent queues. Then >> your messages will not get lost. >> >> Then what is left is to route from the queue to the http endpoint. >> You can use Camel for this - in fact Camel is provided out of the box >> in ActiveMQ. >> >> A route could be as simple as this >> >> <route> >> <from uri="acitvemq:queue:foo"/> >> <to uri="http://someserver.com/somepath"/> >> <route> >> >> Then what you need as well is to have the redelivery support. For that >> we can use transaction and let ActiveMQ handle the redelivery policy. >> So the route needs to be configured for transaction, so we enable >> transacted=true on the activemq endpoint. >> >> <route> >> <from uri="acitvemq:queue:foo?transacted=true"/> >> <to uri="http://someserver.com/somepath"/> >> <route> >> >> Then you need to setup Spring JMS transaction manager to use transaction. >> Details here: >> http://camel.apache.org/transactional-client.html >> >> >> <bean id="jmsTransactionManager" >> class="org.springframework.jms.connection.JmsTransactionManager"> >> <property name="connectionFactory" ref="jmsConnectionFactory" /> >> </bean> >> >> <bean id="jmsConnectionFactory" >> class="org.apache.activemq.ActiveMQConnectionFactory"> >> <property name="brokerURL" value="vm://localhost"/> >> </bean> >> >> >> And last you need to configure the redelivery policy of AcitveMQ to >> your likening >> http://activemq.apache.org/redelivery-policy.html >> >> >> As its ActiveMQ handling to "failed" message it will move it to a dead >> letter queue inside activemq. >> A little detail here: >> http://activemq.apache.org/message-redelivery-and-dlq-handling.html >> >> >> >> > Regards, >> > Leen Toelen >> > >> >> >> >> -- >> Claus Ibsen >> Apache Camel Committer >> >> Open Source Integration: http://fusesource.com >> Blog: http://davsclaus.blogspot.com/ >> Twitter: http://twitter.com/davsclaus >> > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
