【发布时间】:2015-10-28 16:34:00
【问题描述】:
我正在运行一个 Apache Camel 实例,以便将请求代理到另一台服务器(取决于 URI)。 Camel 运行的服务器通过许多不同的域(例如 app1.server.com、app2.server.com)进行响应。
通过使用 jetty 和 http4,我可以通过以下方式代理请求:
from("jetty://http://app.server.com:8080/app1?matchOnUriPrefix=true").to("http4://app1host:8080?bridgeEndpoint=true&throwExceptionOnFailure=false");
from("jetty://http://app.server.com:8080/app2?matchOnUriPrefix=true").to("http4://app2host:8080?bridgeEndpoint=true&throwExceptionOnFailure=false");
有什么方法可以根据域名创建路由吗?像这样的:
from("jetty://http://app1.server.com:8080?matchOnUriPrefix=true").to("http4://app1host:8080?bridgeEndpoint=true&throwExceptionOnFailure=false");
from("jetty://http://app2.server.com:8080?matchOnUriPrefix=true").to("http4://app2host:8080?bridgeEndpoint=true&throwExceptionOnFailure=false");
非常感谢。
【问题讨论】:
标签: java apache-camel esb