Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-3161

Nested LRA doesn't start in the Spring Boot + JAX-RS application

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: LRA
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Start other services (steps from a quickstart):

      1. java -jar $NARAYANA_INSTALL_LOCATION/rts/lra/lra-coordinator-thorntail.jar -Dswarm.http.port=8080
      2. java -jar $NARAYANA_INSTALL_LOCATION/rts/lra/lra-coordinator-thorntail.jar -Dswarm.http.port=8081
      3. java -jar hotel-service/target/lra-test-swarm.jar -Dswarm.http.port=8082
      4. java -jar trip-controller/target/lra-test-swarm.jar -Dswarm.http.port=8084 -Dlra.http.port=8080

      After that, import project from the attachment. Start debugger on FlightApplication and add a breakpoint to the FlightParticipant.bookFlight(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId,...) (line 54) and somewhere to the ServerLRAFilter.filter(...)

      Execute a command for reservation a trip

      1. mvn -f trip-client/pom.xml exec:java -Dservice.http.host="localhost" -Dservice.http.port=8084

      You can see that lraId is the same as in the parent (trip-controller) even though the flight participant is annotated with LRA.Type.NESTED. And the ServerLRAFilter.filter(...) didn't be executed (the program didn't stop on the breakpoint).

      When you do the same steps for original flight service from the quickstart, the program is stopped in the breakpoint in the ServerLRAFilter.filter(...) and lraId in the FlightParticipant.bookFlight(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId,...) contains new lraId.

      Show
      Start other services (steps from a quickstart ): java -jar $NARAYANA_INSTALL_LOCATION/rts/lra/lra-coordinator-thorntail.jar -Dswarm.http.port=8080 java -jar $NARAYANA_INSTALL_LOCATION/rts/lra/lra-coordinator-thorntail.jar -Dswarm.http.port=8081 java -jar hotel-service/target/lra-test-swarm.jar -Dswarm.http.port=8082 java -jar trip-controller/target/lra-test-swarm.jar -Dswarm.http.port=8084 -Dlra.http.port=8080 After that, import project from the attachment. Start debugger on FlightApplication and add a breakpoint to the FlightParticipant.bookFlight(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId,...) (line 54) and somewhere to the ServerLRAFilter.filter(...) Execute a command for reservation a trip mvn -f trip-client/pom.xml exec:java -Dservice.http.host= "localhost" -Dservice.http.port=8084 You can see that lraId is the same as in the parent (trip-controller) even though the flight participant is annotated with LRA.Type.NESTED. And the ServerLRAFilter.filter(...) didn't be executed (the program didn't stop on the breakpoint). When you do the same steps for original flight service from the quickstart , the program is stopped in the breakpoint in the ServerLRAFilter.filter(...) and lraId in the FlightParticipant.bookFlight(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId,...) contains new lraId.

      Description

      For demonstrating purpose, I migrated flight service from narayana quickstart to the Spring Boot application and uploaded it to the attachment.

      When I stop debugger in the original swarm flight service (FlightParticipant line 64), the @HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId, is new for that service. When I stop debugger in the SpringBoot+JAX-RS, the lraId is the same as for a parent. It looks that the ServerLRAFilter doesn't start the new LRA.

      I add a breakpoint to the ServerLRAFilter.filter(...) to see when the filter is applied and create new LRA before the JAX-RS method. When I call original swarm flight service, the filter is used however when I call SpringBoot flight service, the filter is not used so it looks that the filter is not used at all in the SpringBoot+JAX-RS application.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mmusgrov Michael Musgrove
                  Reporter:
                  mkralik Matej Kralik
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated: