Last active
September 14, 2019 02:21
-
-
Save paulparkinson/9518d1b71c7d8c97fc529bc02d668f0a to your computer and use it in GitHub Desktop.
LRA participant: inventory service
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("/reserveInventoryForOrder") | |
@GET | |
@Produces(MediaType.APPLICATION_JSON) | |
@LRA(value = LRA.Type.MANDATORY, end = false) | |
public Response reserveInventoryForOrder(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId) { | |
//... | |
if(inventoryExists) return Response.ok().entity("inventorysuccess").build(); | |
else return Response.ok().entity("inventoryfailure").build(); | |
} | |
@Path("/completeOrder") | |
@PUT | |
@Produces(MediaType.APPLICATION_JSON) | |
@Complete | |
public Response completeOrder(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId) throws NotFoundException { | |
//... | |
} | |
@Path("/cancelOrder") | |
@PUT | |
@Produces(MediaType.APPLICATION_JSON) | |
@Compensate | |
public Response cancelOrder(@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