1

示例路线:

onException(Exception.class)
.process(new Processor() {
    @Override
    public void process(Exchange exchange) throws Exception {
        System.out.println("it works");
        }
    })
    .handled(true);
from("jetty://http://0.0.0.0:8888/test")
.idempotentConsumer(header("myid"), MemoryIdempotentRepository.memoryIdempotentRepository(1000000))
.skipDuplicate(false)
.filter(property(Exchange.DUPLICATE_MESSAGE).isEqualTo(true))
    .throwException(new DuplicateRequestException())
.end();

在没有 myid 参数的情况下向侦听器 URL 发送请求会引发 org.apache.camel.processor.idempotent.NoMessageIdException: No message ID could be found using expression: header(myid) on message exchange: Exchange[Message: [Body is instance of org .apache.camel.StreamCache]]

没有从 onException 传递。

4

1 回答 1

1

是的,这实际上是 Apache Camel 中的一个错误。我已经记录了一张票,以便在下一个版本中修复这个问题。

于 2014-11-01T14:28:19.250 回答