WSO2:当通过 docker 部署微集成器项目时,到端点的连接被拒绝或失败

WSO2: Connection refused or failed to Endpoint when micro-integrator project is deployed via docker

我使用 integration studio 创建了示例微集成器项目,它在 运行 嵌入式微集成器中运行良好。但是当通过 docker 部署时,端点似乎无法访问。

部署命令:

docker run -it -p 8290:8290 -p 8253:8253 --name micro-integrator oprabin/wso2mi:1.0.0 

部署没有问题,但是当通过邮递员触发集成项目时,出现以下日志。

[2022-03-20 04:01:01,129]  INFO {TimeoutHandler} - This engine will expire all callbacks after GLOBAL_TIMEOUT: 120 seconds, irrespective of the timeout action, after the specified or optional timeout
[2022-03-20 04:01:01,137]  WARN {ConnectCallback} - Connection refused or failed for : localhost/127.0.0.1:9090
[2022-03-20 04:01:01,142]  WARN {EndpointContext} - Endpoint : GrandOakEP with address http://localhost:9090/grandoaks/categories/{uri.var.category}/reserve will be marked SUSPENDED as it failed
[2022-03-20 04:01:01,143]  WARN {EndpointContext} - Suspending endpoint : GrandOakEP with address http://localhost:9090/grandoaks/categories/{uri.var.category}/reserve - current suspend duration is : 30000ms - Next retry after : Sun Mar 20 04:01:31 GMT 2022

端点没有问题并且已启动,运行 单独检查时。端点 URL 是:

http://localhost:9090/grandoaks/categories/{uri.var.category}/reserve

从错误日志来看,微型集成器似乎无法连接到 localhost:9090。此服务 (http://localhost:9090/grandoaks/categories/{uri.var.category}/reserve) 是否部署在它自己的微集成器中(docker 容器中的 MI 服务器) .如果此端点部署在主机中而不是 docker 容器中的 MI,您将无法使用 localhost 访问它。