webserviceとjmsキューに基づいてCamelの動的ルーティングマネージャで作業しています。私はこの次のアーキテクチャを持っている:ここではキャメルとの動的ルーティングはメッセージを転送しません
endpoint:cxf -> jms:queue -> dynamic routing to a jms:queue -> processing
は私のルートの定義です:
@Override
public void configure() throws Exception {
routeDefinition = from(fromEndpoint).routeId(name)
.dynamicRouter(method(DynamicRoutingManager.class, "getRoute")).process(exchange -> {
final List<?> soaList = exchange.getIn().getBody(List.class);
final String type = (String) soaList.get(0);
final String documentNumber = (String) soaList.get(1);
final String productionStepNumber = (String) soaList.get(2);
final String message = (String) soaList.get(3);
final String messageToSend = "Route ID=" + name + ", from=" + fromEndpoint + ", type=" + type
+ ", document number=" + documentNumber + ", production step number" + productionStepNumber
+ ", message=" + message;
LOG.debug("==> message={}", messageToSend);
exchange.getOut().setBody(messageToSend);
}); // .to(DLQ);
}
とここに私のダイナミックルーティングマネージャ(私はそれをシンプルに保つ):
public String getRoute(String body, @Header(Exchange.SLIP_ENDPOINT) String previous) {
LOG.debug("========> BODY={}", body);
return "jms:topic:urgent_doc1_prod1";
}
ルートjms:topic:urgent_doc1_prod1
実行時と実行時に定義されます(ログ内のビュー)
実際はwhです私はそのような要求を送信する途中、私は私のメッセージは、2番目のJMSにforwaredされていないと思う原因...私はタイムアウトエラーを取得
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://cxf.apache.org/wsse/handler/helloworld">
<soapenv:Header/>
<soapenv:Body>
<hel:message>
<!--Optional:-->
<type>urgent</type>
<!--Optional:-->
<document_number>1</document_number>
<!--Optional:-->
<production_step_number>1</production_step_number>
<!--Optional:-->
<message>un message</message>
</hel:message>
</soapenv:Body>
</soapenv:Envelope>
(下記参照):キューので、任意の処理を行うことができます...
私は間違っていますか?
あなたの答えはありがたいですが、動作しません。メッセージは 'jms:topic:urgent_doc1_prod1'にエンキューされますが、デキューされずにDLQで終了します。 – ggwtf
質問はありません。あなたはJMS上で何らかの要求/応答をしていますが、続行する前にCamelが応答メッセージを待つようにします。 –
私は、実行時にユーザーインターフェイスで動的ルートを作成し、動的部分を使用して、これらの動的ルートを介してメッセージを(要求で定義されたオプションに従って)転送します。最後に、処理中のメッセージ(最初のリクエストの内容を含む)を送信したいだけです。 – ggwtf