Hi,

I’m using the class org.apache.camel.component.mock.MockEndPoint to test my 
Camel routes. I was wondering why each test case (actually the reset) takes 
more than 10sec, although the DEBUG log said “Waiting on the latch for: 0 
millis”. Turns out this is a wrong log output, and this happens if the 
resultWaitTime (= timeout parameter) is set to 0. In this case, a default wait 
time of 10sec is used, but log stills shows 0sec.

The affected method is:

protected void waitForCompleteLatch(long timeout) throws InterruptedException {
    // Wait for a default 10 seconds if resultWaitTime is not set
    long waitTime = timeout == 0 ? 10000L : timeout;

    // now let's wait for the results
    LOG.debug("Waiting on the latch for: {} millis", timeout);
    if (!latch.await(waitTime, TimeUnit.MILLISECONDS)) {
        LOG.warn("The latch did not reach 0 within the specified time");
    }
}

Here, waitTime should be used instead of timeout for the debug logging.

BR,
Manuel
Sollten Sie diese E-Mail unbeabsichtigt bzw. irrtümlich erhalten haben, so 
weisen wir Sie darauf hin, dass gemäß § 161 Abs 4 TKG 2021 der Inhalt sowie die 
Tatsache des Empfangs dieser E-Mail weder aufgezeichnet noch verwertet oder 
Unbefugten mitgeteilt werden dürfen. Wir ersuchen Sie, die Nachricht von Ihrem 
System zu löschen und sich mit uns in Verbindung zu setzen. If you have 
received this email accidentally or in error, we point out that, in accordance 
with § 161 para. 4 TKG 2021 (Telecommunications Act), the contents of this 
email and the fact of its receipt must not be recorded, exploited or 
communicated to unauthorized persons. We ask you to delete the message from 
your system and to contact us.

Allgemein | General

Manuel LANGER

im Auftrag von

[SPAR Business Services GmbH]<http://www.spar-ics.com>

SPAR Business Services GmbH
Information & Communication Services
Europastrasse 3, 5015 Salzburg, Austria
FN 68396 h


Mobile: +43 664 8833 8301
E-Mail: manuel.lan...@spar-ics.com<mailto:manuel.lan...@spar-ics.com>
Internet: http://www.spar.at<http://>

Reply via email to