Skip to content

examples: Counting add argparse to get broker info #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

naughtont3
Copy link

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"
        }
    ]
}

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 <[email protected]>
@Lance-Drane
Copy link
Collaborator

Lance-Drane commented May 21, 2025

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:

  1. do you mind adding the logic to all of the examples?
  2. Instead of putting in a configuration file for each example, it may be more useful to have a few example configuration files in the examples/ directory. I was thinking just an MQTT and an AMQP config file.

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 service field)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants