Skip to content

Instantly share code, notes, and snippets.

@paulparkinson
Last active September 14, 2019 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulparkinson/80b77398749c665d54e8f4988080fd28 to your computer and use it in GitHub Desktop.
Save paulparkinson/80b77398749c665d54e8f4988080fd28 to your computer and use it in GitHub Desktop.
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