I have several situations where I have a route that is processing messages
off a queue, but after processing the message remains in flight, such that
if the application is restarted that message gets processed again. Is there
any way of of forcing an acknowledgement back to the queue to make sure that
the message is removed.

If i subsequently send messages down the existing inflight message is
replaced by the next one, but that one remains inflight.

One example is when an exception occurs in a route and it hits an error
handler that retries a few times and them places the message on an error
queue for processing. But that message remains in flight on the original
queue such that it is processed again on restart.

I am using camel 28. here is the exception handler.

onException(ConnectException.class).routeId("Receive - Connection
Exception").handled(true)
        .useExponentialBackOff()
        .backOffMultiplier(2).maximumRedeliveries(5).logStackTrace(false)
        .redeliveryDelay(1000)
        .to(RouteConstants.CONNECTION_EXCEPTION_QUEUE); 

This is the route def

RouteDefinition def = from(RECEIVING_QUEUE_PREFIX + app.getName()); // Pull
from each application's queue

def.routeId(getRouteName(app))
                .log(LoggingLevel.DEBUG, "Calling receive web service " +
app.getMessageServiceUrl() + " for ${header.guid}")
                .process(new WebServiceProcessor())
                .setHeader(DATE_BEFORE_SEND, bean(applicationService,
"getCurrentSystemTime"))
                        .to(cxfEndpoint) // Send to application's configured 
endpoint
                        .to(MESSAGE_REPLY_QUEUE).end();

The exception is thrown when tries to connect to cxf end point and handled
by the exception hander, but the message is not acknowledged so remains
inflight.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Messages-remaining-inflight-after-processing-tp4878148p4878148.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to