@Inject
private AlohaService alohaService;
@Inject
private LRAClientAPI lraClient;
@GET
@Path("/hello")
@LRA(value = LRA.Type.REQUIRED)
public List<String> hello() {
alohaService.aloha(lraClient.getCurrent())
}
@POST
@PUT("/complete")
@Complete
public Response completeWork(@HeaderParam(LRAClient.LRA_HTTP_HEADER) String lraId) {
String txId = LRAClient.getLRAId(lraId);
System.out.printf("ActivityController completing %s%n", txId);
return Response.ok().build();
}
@POST
@Path("/compensate")
@Compensate
public Response compensateWork(@HeaderParam(LRAClient.LRA_HTTP_HEADER) String lraId) {
String txId = LRAClient.getLRAId(lraId);
System.out.printf("ActivityController compensating %s%n", txId);
return Response.ok().build();
}