Interacting with an ServletApplication through Jboss-fuse-ESB accross multiple networks

140 Views Asked by At

In our local network we have an existing web IDE type application that is accessed via popular web browsers.
I would like to use Jboss FUSE ESB to be/act as a tunnel between the local and a the Cloud/any network.
So that we, via a web browser client, could connect to the application indifferently the network the browser is in. sending the req-res via the ESB an to the client browser at all times.

I'm using the proxy approach :

  • I type in a url into the browser and it redirects me to the application using the ESB for that first time only.
  • then I start interacting with the application in a normal way. but not through the ESB.

is this possible with JBOSS-FUSE-ESB, or is it the wrong tool for this task ?

<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>

any suggestions are very much welcome.

1

There are 1 best solutions below

3
Claus Ibsen On

Sounds like you should send back a HTTP redirect status code with the url that the web browser should use going forward to interact directly with the server without using the ESB.

You can set the http status code and redirect location using headers on the Camel message, such as after the 1st call.

<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>