0 Replies Latest reply on Oct 10, 2012 4:27 PM by aconite

    HTTP Session Propagation with EJB Request for logging

    aconite Newbie

      I have a distributed application with a Tomcat 6.x frontend and JBoss 7.1.x backed. JBoss is running in standalone mode and Tomcat is running in a seprate VM. For better log correlation I want each log log statement to contain the servlet session ID. Therfore I store session ID in log4J MDC  on frontend and want to propagete this information with each EJB request to backend. This should be done implicitly without changeing the existing EJB interfaces. So I would like to store sessionID in in a "EJB request context" on the client side and read it in an interceptor from the server side.


      Solution would look like this:


      1) ServletFilter: Store "sessionID"  in log4J MDC

      2) EJBClientInterceptor:  Read "sessionID" from log4J MDC and pack to EJB Request

      3) EJBServerInterceptor: Unpack "sessionID" from EJB Request and store in log4J MDC



      1)   Does such an "EJB Request Context" exist?

      2)   Does "EJBClientInterceptor" exist I'm only aware of EJBInterceptors on the server side?

      3)   Is there a better approach to do this?