Created
November 15, 2019 07:09
-
-
Save xstefank/f5cc9c906676bb7dd451fb2fd9acdc6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Path("reused-participant") | |
public class ReusedParticipant2 { | |
@GET | |
@Path("reused-endpoint") | |
// no LRA annotation! | |
public Object reusedEndpoint(@HeaderParam("flow-type") String flowType) { | |
if (flowType.equals("first-flow")) { | |
selfRestInvoke("first-flow"); | |
} else if (flowType.equals("second-flow")) { | |
selfRestInvoke("second-flow"); | |
} | |
} | |
@GET | |
@Path("first-flow") | |
@LRA(LRA.Type.MANDATORY) | |
public Object firstFlow(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) URI lraId) { | |
// ... | |
} | |
@GET | |
@Path("second-flow") | |
@LRA(value = LRA.Type.REQUIRES_NEW, end = false) | |
public Object secondFlow(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) URI lraId) { | |
// ... | |
} | |
// reuse callbacks | |
@PUT | |
@Path("compensate") | |
@Compensate | |
public Response compensate() { | |
// ... | |
} | |
@PUT | |
@Path("complete") | |
@Complete | |
public Response complete() { | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment