jax-rs client is not creating jax-rs cookie

Hi i have two separate docker container running. one container runs an application which has the following rest-resource

@GET
@Path("/jaxrsSaveCookie")
@Produces(MediaType.TEXT_PLAIN)
public Response jaxrsSaveCookie(@QueryParam("name") String name, @QueryParam("value") String value) {
logger.info("jaxrsSaveCookie [name: " + name + ", value: " + value + "]");

NewCookie cookie = new NewCookie(name, value, "/", "", "my cookie", NewCookie.DEFAULT_MAX_AGE, false);

return Response.ok("OK").cookie(cookie).build();
}

and the other container runs an application which tries to call this resource via jax-rs client

  • Docker not showing logs written in /dev/stdout
  • How to enter bash of an ubuntu docker container?
  • Docker CE on Mac OSX hanging on startup
  • mounting docker-machine VM folders in container with docker-compose
  • Execute chmod in Dockerfile on Raspberry pi /dev/spi*
  • How to connect postgresql container to django container?
  • public String getResponse(String urlString, MultivaluedHashMap<String, Object> headers) {
    if (headers == null)
        headers = new MultivaluedHashMap<>();
    
    Client client = ClientBuilder.newClient();
    client.property("CONNECTION_TIMEOUT", 5000).property("RECEIVE_TIMEOUT", 5000);
    
    WebTarget target = client.target(urlString);
    String response = target.request(MediaType.TEXT_PLAIN).headers(headers).get(String.class);
    return response;
    }
    

    When i call the rest-resource “jaxrsSaveCookie” from my browser directly the cookie is being created. But when i am trying to use my jax-rs client over the browser which makes a rest call to the second docker container with the resource “jaxrsSaveCookie” the cookies are not being created.

    Can somebody please help?

  • WSO2 loss APIs after changes in docker container
  • Switching Between Root and Non-Root Users in Docker
  • Pushing an image into private registry doesn't work if I deleted this image before via Registry API v2 call
  • Jenkins Amazon ECR Plugin login issue “Authorization Token has expired”
  • How to configure Let's encrypt certificates for nginx inside a docker image?
  • How-to install and run keen/dashboards
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.