Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LRA participant: order service
@Path("/placeOrder")
@GET
@Produces(MediaType.APPLICATION_JSON)
@LRA(value = LRA.Type.REQUIRES_NEW)
public Response placeOrder(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId) {
//...
}
@Path("/cancelOrder")
@PUT
@Produces(MediaType.APPLICATION_JSON)
@Compensate
public Response cancelOrder(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId) throws NotFoundException {
//...
}
@PUT
@Path("/completeOrder")
@Produces(MediaType.APPLICATION_JSON)
@Complete
public Response completeOrder(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId) throws NotFoundException {
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment