I need suggessions and your thoughts on this topic.
I have a requirement to connect my local node js server as a client in spring boot admin server. My spring boot admin server is hosted on a cloud platform
I have tried to do like this;
const express = require('express');
const sbaActuator = require('spring-boot-admin-actuator');
const app = express();
const options = {
config: {
logFileAddr: '',
ipAddr: 'locahost',
port: 8081
},
};
app.use(sbaActuator(options));
const postData = JSON.stringify({
name: name,
managementUrl: "",
healthUrl: "http://localhost:" + 8081 + "/actuator/health",
serviceUrl: "",
metadata: {
"preferIp": "true"
}
});
fetch('<spring-admin-url>', {
method: 'POST',
body: postData,
headers: {
'Content-type': 'application/json; charset=UTF-8'
}
})
.then((response) => response.json())
.then((json) => console.log(json));
}
app.listen(8081, function () {
console.log('listening on port 8081')
});
This is working fine when i include local url of the spring boot admin service but if I include hosted url it is not identify the health url. It gets timeout exception. I tried using my public ip address rather than localhost for the health url. But it is also gets timeout.
Im getting this error
Did not observe any item or terminal signal within 9000ms
If I understand correctly you want to register a locally running service on a admin server that is running somewhere in the cloud. Then the admin server cannot reach your local service.
There are services available to expose locally running services to the internet like "ngrok". Maybe have a look at these.