使用Docker容器从Java连接到流星DDP [英] Connecting to Meteor DDP from Java with Docker container

查看:236
本文介绍了使用Docker容器从Java连接到流星DDP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里只是为了分享java DDP客户端流星和Docker的一些经验



你好,我正在从J2EE docker容器访问流星码头容器,并且它失败因为在与服务器名称(对应于我的撰写文件中的流星)和端口82的连接上有一些麻烦。



在这种情况下,它不不考虑端口,并将其替换为默认值80 ...所以连接失败...

解决方案

为什么?
因为URI不处理没有点
的域名:




  • 连接到meteor_1 port 3000

  • uri是ws:// meteor_1:3000 / websocket

  • ,但是int port = uri.getPort(); - > -1,并且ddp客户端默认情况下回退到80



我今晚将尝试一个图像名称,点,因为它在java中传递,但是我没有使用docker进行测试。


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...

解决方案

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

这篇关于使用Docker容器从Java连接到流星DDP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆