Connecting to Meteor DDP from Java with Docker con

2019-09-06 01:14发布

问题:

I am here just to share some experience with java DDP Client Meteor and Docker

Hello I am accessing to a meteor docker container from a J2EE docker container and it fails because there are some trouble at the connection with the server name (corresponding to "meteor" in my compose file) and the port "82".

In this case it doesn't take into account the port and it replaces it with a default value 80... so the connection fails...

回答1:

WHY ? because URI don't handle domain name without dots e.g. :

  • connect to meteor_1 port 3000
  • the uri is ws://meteor_1:3000/websocket
  • but int port = uri.getPort(); -> -1 and the ddp client fallback to 80 by default

I'll give a try this evening with a image name with a dot as it passes in java but I yet didn't test with the docker compose