R
Railway•13mo ago
TheWolfKing

Private networking

Hi! I have 2 Spring Boot apps and try to make them communicate over private networking. Could you please help What I am doing wrong? My api-gateway can't connect over private network. api-gateway project id: 08a6b80c-da39-486f-8ba0-ae1777316271 app I try to connect to: bdbdf463-b88a-4345-aa66-c8186c5e9b74
No description
No description
No description
12 Replies
Percy
Percy•13mo ago
Project ID: 08a6b80c-da39-486f-8ba0-ae1777316271,bdbdf463-b88a-4345-aa66-c8186c5e9b74
TheWolfKing
TheWolfKingOP•13mo ago
@Brody Thanks for the answer. But it didn't really help me tbh. I'm a bit noob in those questions. I would really appreacciate if you could be more detailed. Thanks in advance
Brody
Brody•13mo ago
you need to run your app on host :: how to do that for spring, would be something you'd need to consult springs docs for
TheWolfKing
TheWolfKingOP•13mo ago
@Brody Figured it out. Thanks a lot. For any spring bootes: set server.address=:: in env variables for all services and it will work
Brody
Brody•13mo ago
no problem, and thanks for reporting back the method!
TheWolfKing
TheWolfKingOP•13mo ago
Ah, I got played so bad 😂 I didn't notice envs in my Postman. Basically, I was calling service itself, not via api-gateway. So issue still persists (
Brody
Brody•13mo ago
postman is a desktop app, you can't call the private domain from your computer
TheWolfKing
TheWolfKingOP•13mo ago
@Brody I know. With Postman I call my api-gateway with public url, api-gateway itself should route to other service via private network
Brody
Brody•13mo ago
are you running both of these apps on the host ::?
TheWolfKing
TheWolfKingOP•13mo ago
Yes, I do Do I need to specify port when connecting? Ok. I found that if we specify port after the internal link which application is running on when it is deployed solves the issue. But now I have another question is that what if I want to run 3-4 instances of the app. Each of them has it's own port after deploy. How can we solve this issue OK. Figured out everything. Thanks for the support @Brody . Is there any guides section on the server? I can contribute with guide for spring boot-ers)
Brody
Brody•13mo ago
I would absolutely love if you could add another code example to this page for spring boot https://docs.railway.app/troubleshoot/fixing-common-errors https://github.com/railwayapp/docs/edit/main/src/docs/troubleshoot/fixing-common-errors.md I think what would be most helpful is if you showed how to get spring boot to listen on the host :: and the auto generated PORT variable (I know the rest of the code examples listen on 0.0.0.0, they will have to be updated)
Want results from more Discord servers?
Add your server