Skip to content
Discussion options

You must be logged in to vote

Hi @ziomill, in the current version of the spec, the passing of user data is not supported in terms of the defined protocol.

However, you can achieve this in this manner:

@Path("/lra")
public class MyLRAResource {

    private Map<URI, String> lraData = new HashMap<>();

    @GET
    @Path("/doInLRA")
    @LRA
    public Response doInLRA(@HeaderParam(LRA.LRA_HTTP_CONTEXT_HEADER) URI lraId) {
        lraData.put(lraId, "my data");
        return Response.ok().build();
    }

    @PUT
    @Compensate
    public Response compensateLRA(@HeaderParam(LRA.LRA_HTTP_CONTEXT_HEADER) URI lraId) {
        System.out.println(lraData.get(lraId));
        return Response.ok().build();
    }
}

Or use da…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ziomill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants