【问题标题】:Interacting with an ServletApplication through Jboss-fuse-ESB accross multiple networks通过 Jboss-fuse-ESB 跨多个网络与 Servlet 应用程序交互
【发布时间】:2015-04-21 15:10:08
【问题描述】:

在我们的本地网络中,我们有一个现有的Web IDE 类型应用程序,可通过流行的Web 浏览器访问。
我想使用 Jboss FUSE ESBbe/act 作为 localCloud/any 之间的隧道强大> 网络。
这样我们就可以通过 Web 浏览器客户端 连接到应用程序,而不管浏览器所在的网络是什么。始终通过 ESB 将req-res 发送到客户端浏览器。

我正在使用proxy approach

  • 我在浏览器中输入了一个 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>

非常欢迎任何建议。

【问题讨论】:

    标签: apache-camel integration esb jbossfuse jboss-esb


    【解决方案1】:

    听起来您应该发回一个 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>
    

    【讨论】:

    • 所以在第一次重定向后不可能继续使用 ESB 对吧?
    • 我不知道应用程序将如何告诉骆驼什么 URL(响应) 是/是,因为现在 req-res 只是应用程序,webBrowser ESB 不再出现在图片中
    • 现在在第一次重定向(安全令牌生成等)之后,url 保持不变,然后几乎所有东西都是 ajax。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-23
    • 2013-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多