私はフラット ファイルを持っています。このファイルでは、各行をキャプチャして、POJO. を使用CamelしBindy、活用していSplitter EIPます。何らかの理由で、アンマーシャリングが完了した後にPOJO(を使用して) を検査できません。Processor助言がありますか?
以下の両方の変換の直後にExchange内部をデバッグしようとしています。コードが呼び出されない (ブレークポイントに到達しない)ProcessBindy
これが私のコードです:
from("file://inbox")
.setHeader(Exchange.FILE_NAME,simple("${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}"))
.wireTap("file://ORIGINAL_BACKUP")
.process(converterProcessor)
.split(body(String.class).tokenize(System.lineSeparator()))
.choice()
.when(new Predicate() {
public boolean matches(Exchange exchange) {
if(exchange.getIn().getBody().toString().startsWith("HEADER1")) return true;
return false;
}
})
.unmarshal()
.bindy(BindyType.Fixed, MessageHeaderGroup_HEADER1.class).process(new Processor() {
public void process(Exchange exchange) throws Exception {
System.out.println("Object: "+ exchange.getIn().getBody());
}
}).to("direct:mhg")
.when(new Predicate() {
public boolean matches(Exchange exchange) {
if(exchange.getIn().getBody().toString().startsWith("HEADER2")) return true;
return false;
}
})
.unmarshal()
.bindy(BindyType.Fixed, TransactionHeaderGroup_HEADER2.class).process(new Processor() {
public void process(Exchange exchange) throws Exception {
System.out.println("Object: "+ exchange.getIn().getBody());
}
}).to("direct:trg")
.otherwise().to("file://outbox");
私はかなり新しいCamelです。choice()使用を終了しようとしましendChoice()たが、役に立ちませんでした。Filter EIP(可能な変換を 1 つだけ使用するために) を使用する場合、ステップでBindyを調べることができます。しかし、私がに切り替えると、できません。ご提案いただきありがとうございます。ExchangeProcesschoice()Predicate