users@jersey.java.net

[Jersey] Re: Issues with JerseyTest and multiple requests to the asynchronous resource method

From: Oleksandr Bodriagov (Polystar) <"Oleksandr>
Date: Wed, 13 Aug 2014 14:01:14 +0000

A tiny correction, the asynchronous resource method looks like this ( forgot the System.out.println statement):


@Path("/testquery")

publicclass TestResource {


    @GET

    @Path("/{id}")

    @Produces(MediaType.APPLICATION_JSON)

    public void asyncGetData(@Suspendedfinal AsyncResponse asyncResponse,

            @PathParam("id") final String requestId) {


       System.out.println("Server: processing the request");

        // does nothing except answering GONE

        asyncResponse.resume(Response.status(Response.Status.GONE).build());

    }

}


//Alex