You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Valdis Andersons <va...@vhi.ie> on 2018/09/06 17:23:24 UTC

Early reply received with correlationID

Hi All,

Not sure if this is of any concern but looks kind of strange given the comments in the camel-rabbitmq component code itself.

When looking in some production logs today I spotted a load of these sort of messages:

-  Early reply received with correlationID [Camel-ID-vmsys-1536138014401-0-20030]

Then 5 seconds later:

-  Reply received for unknown correlationID [Camel-ID-vmsys-1536138014401-0-20030]. The message will be ignored

This appears to be happening with every timed out exchange on an InOut capable route. The second message is clear to me, the correlation ID got removed from the correlation map after the timeout and now the exchange has finally made it to the producer but the producer doesn't know what to do with it anymore.
The first message on the other hand looks very bizarre, given that the only occurrence of this is the ReplyManagerSupport class in Camel itself:

https://github.com/apache/camel/blob/master/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/reply/ReplyManagerSupport.java

/**
     * <b>IMPORTANT:</b> This logic is only being used due to high performance in-memory only
     * testing using InOut over JMS. Its unlikely to happen in a real life situation with communication
     * to a remote broker, which always will be slower to send back reply, before Camel had a chance
     * to update it's internal correlation map.
     */
    protected ReplyHandler waitForProvisionCorrelationToBeUpdated(String correlationID, byte[] message) {
        // race condition, when using messageID as correlationID then we store a provisional correlation id
        // at first, which gets updated with the JMSMessageID after the message has been sent. And in the unlikely
        // event that the reply comes back really really fast, and the correlation map hasn't yet been updated
        // from the provisional id to the JMSMessageID. If so we have to wait a bit and lookup again.
        if (log.isWarnEnabled()) {
            log.warn("Early reply received with correlationID [{}] -> {}", correlationID, message);
        }
......

Should I be concerned about this logic being invoked? I'm not invoking it explicitly, Camel is, and it looks really strange that an 'early reply' is received for a timed out exchange. Anyone able to clarify what is actually going on here?


Thanks,
Valdis