examples: Counting add argparse to get broker info#27
examples: Counting add argparse to get broker info#27naughtont3 wants to merge 1 commit intoINTERSECT-SDK:mainfrom
Conversation
Adds ability to pass a file with broker configuration
so do not have to hardcode details in file.
Configuration file (JSON format):
```
{
"brokers": [
{
"username": "intersect_username",
"password": "intersect_password",
"port": 1883,
"host": "127.0.0.1",
"protocol": "mqtt3.1.1"
}
]
}
```
Signed-off-by: Thomas Naughton <naughtont@ornl.gov>
|
Thanks, I like the way this is implemented; people can still run the examples without having to specify a config file, but have the option of utilizing a config file if they want to. I think that enough developers are using these examples during development (especially if developing a "core INTERSECT service") that this functionality will help them. A couple of things:
Incidentally it's usually "best practice" to have the INTERSECT hierarchy represented in your configuration file, especially if you're wanting to test out multiple versions of your application (in which case you'd need the hierarchy to look a little different for each). It's also worth noting that the INTERSECT-SDK 0.9.0 update intends to considerably simplify the configuration format and have a lot of the configuration managed by the upcoming registry-service. The high-level explanation of the service is at https://github.com/INTERSECT-SDK/registry-service?tab=readme-ov-file#how-users-interact-with-this-service . This will change the entire config structure to: {
"registry_service_url": "https://intersect-registry-service.example.com",
"service": "nionswift-microscope",
"apiKey": "XXX-EXAMPLE-XXX"
}(Clients will also not need to include the |
Adds ability to pass a file with broker configuration so do not have to hardcode details in file.
Configuration file (JSON format):