0

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.

yokodev
  • 1,266
  • 2
  • 14
  • 28

1 Answers1

2

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>
Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65
  • so its not possible to keep using the ESB after the first redirect Right ? – yokodev Apr 22 '15 at 17:40
  • I don't know how the app is gonna tell camel what URL(response) is/are , because now the req-res is only the app and the webBrowser ESB is not in the picture anymore – yokodev Apr 22 '15 at 17:44
  • Right now after first redirect(security token generation,etc...)the url stays the same,then almost everything is ajax. – yokodev Apr 22 '15 at 17:45