Camel は初めてで、Tomcat サーバーで単純なルートを実行しています。ルートは次のように構築されます。
Processor generateWebResponse = new MySpecialProcessor();
from("servlet:///url?matchOnUriPrefix=true").process(generateWebResponse);
次のような単純な単体テストを試しました。
Exchange lAuthRequest = createExchangeWithBody("[json body!]");
template.send("servlet:///url", lAuthRequest);
assertEquals("baseline body", lAuthRequest.getOut().getBody());
しかし、サーブレット エンドポイントを作成できないことを示す例外が発生します。例外メッセージは次のとおりです。
org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[servlet:///url]. Reason: java.lang.UnsupportedOperationException: You cannot create producer with servlet endpoint, please consider to use http or http4 endpoint.
これは新しい開発なので、良いデザイン以外に多くの制約はありません。ルートの変更が必要な提案を受け入れます。また、慣用的ではない上記のことをしている場合は、提案された改善点で質問を修正して喜んでいます。