Conceptual Architectural question: Jumping a session between servlet containers

Discussion in 'Apache' started by Legio.XIII.Gemina, Aug 25, 2010.

  1. #1
    I've been asking a few questions around regarding a specific case of this, but I had a feeling that the questions were not to the point...thought this hits the nail a little squarer on the head, and I'll give our concrete example...hopefully someone can point me towards the right direction:

    Let's say we have WebSphere Commerce Server (WCS) serving e-commerce requests. Apache sits in front of the WCS and proxies e-com requests off to this server, receives and replies the response back to the caller. To go a touch further, let's say that there is a "foo.jsp" running on WCS whose contents are 'bar' Caller types http://www.brand1.com/foo.jsp into their browser. An Apache virtual host services all requests for brand1.com and proxies all jsp requests to WCS. Apache calls WCS' RequestServlet, that RS picks foo.jsp, replies to Apache and the user's browser displays "bar."

    So...setting aside previous architectural decisions/corporate political structure/optimal courses of action...and with the caveat that I know that what I am requesting is a mother of all hack jobs....I'm trying to put SOME servlet engine(for instance, Tomcat6) between WCS and Apache that can allow direct access for a developer to edit foo.jsp without requiring the dev to deploy it to WCS.

    The concept that I have in mind (that I cannot prove) is this:

    Let's say that foo.jsp in WCS has contents "bar" and foo.jsp in Tomcat has contents "barbar"

    Apache's virtual host writes Tomcat's location into an HTTPRequestHeader (Let's say, "onBehalfOf" with a value of "192.168.1.2:8080" ...The WCS RequestServlet is retooled to first check for a value in this header. It remembers if it was set and proceeds with servicing the initial request. However, when it comes time to fill the response stream with "bar", it instead delegates to 192.168.1.2:8080 and Tomcat continues processing and replies to Apache with "barbar" .

    ...The above "foo.jsp" is obviously a contrived example, so to complicate it just a smidge: ...assuming that foo.jsp on WCS called a "foo" EJB and accessed a "foo" table in the database to query value "bar", how would I get "bar" out of WCS, through Tomcat, and back to Apache? I'm thinking that somehow the session information would have to jump between WCS and Tomcat, but I have no idea if that is even possible.

    ...We've been thinking that refactoring to deploy the WCS war file to a local Tomcat or Glassfish and exposing the EJBs as web services would be the more viable solution, but the manpower and capital is not there for that thorough of a refactor at the moment.

    Has anyone ever tried something like this?
     
    Legio.XIII.Gemina, Aug 25, 2010 IP