0

在我们的本地网络中,我们有一个现有的Web IDE 类型的应用程序,可以通过流行的Web 浏览器访问。
我想使用Jboss FUSE ESB作为/充当本地云/任何网络之间的隧道。
这样我们就可以通过Web 浏览器客户端与浏览器所在的网络无关地连接到应用程序。始终通过 ESB 向客户端浏览器发送请求。

我正在使用代理方法

  • 我在浏览器中输入一个 url,它只第一次将我重定向到使用 ESB 的应用程序。
  • 然后我开始以正常方式与应用程序交互。但不是通过 ESB。

使用 JBOSS-FUSE-ESB 是否可行,或者它是执行此任务的错误工具?

<camelContext trace="true" id="blueprintContext" xmlns="http://camel.apache.org/schema/blueprint">
<route id="REQUEST">
    <from uri="jetty:http://0.0.0.0:1805/myRemoteApp?matchOnUriPrefix=true" id="TO-APP">
        <description/>
    </from>
    <to uri="jetty:http://my.cpny.com:1804/myapp/mainServlet?bridgeEndpoint=true&amp;throwExceptionOnFailure=false" id="RealServer-IN"/>        
</route>

非常欢迎任何建议。

4

1 回答 1

2

听起来您应该发回一个 HTTP 重定向状态代码,其中包含 Web 浏览器应该使用的 URL,以便在不使用 ESB 的情况下直接与服务器交互。

您可以使用 Camel 消息上的标头设置 http 状态代码和重定向位置,例如在第一次调用之后。

<route id="REQUEST">
    <from uri="jetty:http://0.0.0.0:1805/myRemoteApp?matchOnUriPrefix=true" id="TO-APP">
        <description/>
    </from>
    <to uri="jetty:http://my.cpny.com:1804/myapp/mainServlet?bridgeEndpoint=true&amp;throwExceptionOnFailure=false" id="RealServer-IN"/>        
     .. // add logic here to compute the new url and set that as Location header. And then set a status code 30x for redirect
     <setHeader headerName="HttpStatusCode"><constant>300</constant></setHeader>
     <setHeader headerName="Location"><constant>http:blabla</constant></setHeader>
</route>
于 2015-04-22T04:57:58.937 回答