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

  • Accessing a MySql database from external IP (Docker containers)
  • Docker-compose volumes doesn't copy any files
  • How to re-bind docker volume after removing data-only container?
  • Configure Dockerfile to set AWS configurations
  • Docker container - how to configure so it gets a viable IP address when running in vagrant?
  • having issues while connecting tomcat to mysql in a docker 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?

  • Cannot remove docker images without tags/<none> tags
  • How do I find the network ip using docker and travis?
  • How to pass arguments to a Dockerfile?
  • MongoDB Docker Container on AWS ECS using EFS
  • Dockerizing an SSH Daemon Service using my own key
  • Docker swarm on 'dind' images and networking problems
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.