Announcement Announcement Module
Collapse
No announcement yet.
Request scope and service-to-service requests Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Request scope and service-to-service requests

    The Spring reference mannual states that "the Spring container will create a brand new instance of the [...] bean [...] for each and every HTTP request."

    From what perspective is the manual talking about here, the service or the consumer?

    Will the container create new instances of "request"-scoped beans when I invoke another service from within the current request (as in Consumer->Service 1->Service 2)?

  • #2

    Will the container create new instances of "request"-scoped beans when I invoke another service from within the current request (as in Consumer->Service 1->Service 2)?
    No. The request is the request as in web request (request and session scoped beans only work in web environments). So there will be a new instance for the request which is alive and shared during the lifetime of that request.

    Comment


    • #3
      Thank you for confirming that, Marten. I appreciate your clarification!

      Comment

      Working...
      X