Wink
  1. Wink
  2. WINK-252

Wink doesn't support session affinity option on WebSphere Application Server with Cluster configuration

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Server
    • Labels:
      None
    • Environment:

      Websphere Application Server V7

      Description

      In WebSphere Application Server with Cluster configuration, Wink doesn't support session affinity option (which means Wink didn't initialize an HTTP session object when it received an HTTP request from Client). Therefore, the request will be dispatched to one server and then the other server alternately. For RESTful service with session enabled, this may be a problem. Wink team may consider to provide to enable session affinity as a possible option.

      What is session affinity? http://publib.boulder.ibm.com/infocenter/wasinfo/v4r0/index.jsp?topic=/com.ibm.websphere.v4.doc/wasa_content/040401010702.html

        Activity

        Lori Ruffing created issue -
        Hide
        Nick Gallardo added a comment -

        Hi Lori,

        I see what you're saying and understand your expectation here. My concern with this scenario is that it's asking Wink to create a session for every request regardless of whether or not the client or service choose to participate in such.

        There is a way to handle this today. Within the endpoint implementation, if you call:

        HttpSession.getSession() from within the endpoint impl, then that will give you the functionality you're looking for. The session is accessible from the HttpServletRequest that can be injected as a parameter on the resource method.

        Here's a link to the javadoc for the servlet that describes the behavior.

        http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html#getSession%28%29

        Are you able to change your application to use this API for enabling session affinity?

        Best,

        -Nick

        Show
        Nick Gallardo added a comment - Hi Lori, I see what you're saying and understand your expectation here. My concern with this scenario is that it's asking Wink to create a session for every request regardless of whether or not the client or service choose to participate in such. There is a way to handle this today. Within the endpoint implementation, if you call: HttpSession.getSession() from within the endpoint impl, then that will give you the functionality you're looking for. The session is accessible from the HttpServletRequest that can be injected as a parameter on the resource method. Here's a link to the javadoc for the servlet that describes the behavior. http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html#getSession%28%29 Are you able to change your application to use this API for enabling session affinity? Best, -Nick
        Hide
        Dave Lin added a comment -

        Hi Nick,

        Now we enable the HTTP session by servlet filter like:

        <filter>
        <display-name>RestSessionFilter</display-name>
        <filter-name>RestSessionFilter</filter-name>
        <filter-class>com.ibm.hats.rest.RestSessionFilter</filter-class>
        </filter>
        <filter-mapping>
        <filter-name>RestSessionFilter</filter-name>
        <url-pattern>/rest/*</url-pattern>
        </filter-mapping>

        We suggest to put this as a possible option feature of Wink sample servlet (org.apache.wink.server.internal.servlet.RestServlet), or have a document about it. the SOAP Web services can be configured to enable HTTP session easliy in Websphere Application Server. Let me know your opinion. Thanks!

        Dave

        Show
        Dave Lin added a comment - Hi Nick, Now we enable the HTTP session by servlet filter like: <filter> <display-name>RestSessionFilter</display-name> <filter-name>RestSessionFilter</filter-name> <filter-class>com.ibm.hats.rest.RestSessionFilter</filter-class> </filter> <filter-mapping> <filter-name>RestSessionFilter</filter-name> <url-pattern>/rest/*</url-pattern> </filter-mapping> We suggest to put this as a possible option feature of Wink sample servlet (org.apache.wink.server.internal.servlet.RestServlet), or have a document about it. the SOAP Web services can be configured to enable HTTP session easliy in Websphere Application Server. Let me know your opinion. Thanks! Dave
        Hide
        Lila Aravopoulos added a comment -

        Hi Nick, do you have any update in reply to Dave's comment? I manage our external defects for HATS and following up on this one. Thank you. Lila

        Show
        Lila Aravopoulos added a comment - Hi Nick, do you have any update in reply to Dave's comment? I manage our external defects for HATS and following up on this one. Thank you. Lila
        Hide
        Jude Hung added a comment -

        Hi Nick, do you have any further update for this Improvement? Thanks!

        Show
        Jude Hung added a comment - Hi Nick, do you have any further update for this Improvement? Thanks!
        Hide
        Bruce Ke added a comment -

        Nick, can you help to response Dave's question, or let us know the latest status of this, or future plan? We need this information to make decision how to handle HATS related defect. Thanks.

        Show
        Bruce Ke added a comment - Nick, can you help to response Dave's question, or let us know the latest status of this, or future plan? We need this information to make decision how to handle HATS related defect. Thanks.

          People

          • Assignee:
            Unassigned
            Reporter:
            Lori Ruffing
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development