I'm writing an application that listens to messages sent from remote systems and I'd like to configure the details of the hosts in a config file. It sounds simple but I'm stuck.
If it were listening from a single remote system then I can configure the details in a properties file like so:
Here's where I'm stuck. I want to be able to define an arbitrary number of servers in my config file and have the Java application iterate over them to create multiple listener connections. The config file may look something like this:
I'm using Spring Boot so by default it supports .properties and YAML configurations, but I'm open to do something else if it fits better.
Both good ideas. I think I'll take a deeper look into using an ini format, I've not programmed with one of those before. It looks like an MS format which might have something to do with it as I've not touched Windows for over a decade.
json would be ok if it were written by a computer, just as xml would also be but it's less friendly as a config file format intended to be written by a real person because the syntax is fussy to get right.