search

Home  >  Q&A  >  body text

java - session synchronization problem in dubbo

The scenario is as follows. The service module and the web module in dubbo are two services. If you want to get the session in the service module, how do you get it? The web module can easily get the session because it has HttpServletRequest, but what does the service module need to do to get the session? ? After looking at spring session, the principle is to use redis to store the session, but after searching for a long time, I finally couldn’t find a specific method on how to obtain the session in the service of the service module

伊谢尔伦伊谢尔伦2752 days ago798

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-06-12 09:21:17

    See if this helps: http://www.roncoo.com/course/...

    reply
    0
  • 某草草

    某草草2017-06-12 09:21:17

    You can get the request

    HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();

    reply
    0
  • 为情所困

    为情所困2017-06-12 09:21:17

    This generally serializes the Session object and stores it in the cache. In addition, it can perform single sign-on business on a separate layer and provide an API for querying the Session (digression: this belongs to Session storage in the microservice architecture) Regarding the design of synchronization, I don’t know if the technical manager didn’t explain it clearly to you)

    reply
    0
  • Cancelreply