Skip to content
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

[receiver/solace]: Update broker config #36387

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wildum
Copy link
Contributor

@wildum wildum commented Nov 15, 2024

Description

The broker field is a list of strings but only the first element is considered. This is misleading because users might think that the component supports connecting to several brokers but only the first broker is used in the code.

This PR is updating the doc and adding validation steps to make sure that only one broker is configured. This is a breaking change in theory because users who have several brokers configured will get an error on start-up but since it is not supported, it's unlikely that it breaks anyone.

Testing

The tests were updated.

Documentation

The examples in the doc were updated.

@atoulme
Copy link
Contributor

atoulme commented Nov 16, 2024

Could you find a way to avoid a breaking change here? Maybe set the broker field to any and introspect if it's a slice, in which case you'd raise a warning to move it to string.

@wildum
Copy link
Contributor Author

wildum commented Nov 18, 2024

Could you find a way to avoid a breaking change here? Maybe set the broker field to any and introspect if it's a slice, in which case you'd raise a warning to move it to string.

The problem with "any" is that a string is set as the default value. This will make the unmarshalling fail because it will use reflection to override the default broker string and will throw a decode error: 'broker' expected type 'string', got unconvertible type '[]interface {}', value: '[myHost:5671]'.

But with this, I found out that the decoder accepts a string for a slice field. Maybe we could keep the broker as a slice but document it in the readme as a string and throw an error if the slice has more than 1 element in it. What do you think?

Copy link
Contributor

github-actions bot commented Dec 3, 2024

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Dec 3, 2024
@wildum wildum force-pushed the update-broker-config branch from 58cd508 to 4423fca Compare December 10, 2024 12:09
@wildum wildum force-pushed the update-broker-config branch from 4423fca to 41676ec Compare December 10, 2024 12:12
@wildum
Copy link
Contributor Author

wildum commented Dec 10, 2024

@atoulme @djaglowski I also made the changes on this one, lmk if you want to move forward with it or if you don't want to change

@github-actions github-actions bot removed the Stale label Dec 11, 2024
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Dec 26, 2024
Copy link
Contributor

github-actions bot commented Jan 9, 2025

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Jan 9, 2025
@atoulme atoulme reopened this Jan 9, 2025
@github-actions github-actions bot removed the Stale label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants