Hi Diptanu,
Thanks for the response.
I already had created a topic where i had all the queries in that. but didn't get any response on that so i created seperate topic for different queries.
let's talk about this query. you are suggesting that i should use consul service discovery feature. i am doing it for my current scenario but problem with that i need to write rest call code in my dependent project where i need the IP:Port of postgres and i also need to write logic to select from multiple ip:port as well if postgres is deployed on more than 1 node. currently i have written a facade layer where i am getting ip:port by sending servicename and tag as a parameter. in my application , where i used to get the ip:port from environment values now, i am calling the facade layer to get the top in the list ip:port of postgres service. but i don't want to write extra code for getting ip:port in application. instead i want to pass it as an env variable in nomad job. i thought that interpreted variables would help in this. but they were not getting resolved.
i was using ${NOMAD_HOST_PORT_"label"}
in postgres task i defined port map with label tcp
# Configure Docker driver with the image
config {
image = "postgres:9.5"
labels = {
group = "db-postgres"
}
port_map {
tcp = 5432
}
}
and i was giving it to my application in env block using ${NOMAD_HOST_PORT_tcp} but it was not getting resolved.