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

Tolerate trailing semicolon in RabbitMQ connection string #875

Conversation

igor-toporet
Copy link
Contributor

@igor-toporet igor-toporet commented May 13, 2024

Usually, database connection strings contain a trailing semicolon after the last "key=value;" pair.

I'm proposing this change to respect the principle of least astonishment and keep RabbitMQ connection strings consistent with other connection strings in the application configuration. I spent some time today figuring out what's wrong; I hope it'll save other people's time in the future, too.


An alternative fix would be to change JasperFx.CoreStringExtensions.ToDelimitedArray to use StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries as it doesn't seem that any usage in JasperFx repositories is interested in empty entries after splitting a delimited string. (See https://github.com/search?q=org%3AJasperFx+ToDelimitedArray&type=code)

Trimming entries won't be needed, too, on the line 244

array[i] = array[i].Trim();


UPDATE: JasperFx/JasperFx.Core#10

@igor-toporet igor-toporet force-pushed the feature/it/trailing-semicolon-in-rabbit-conn-str branch from 78d3bcf to bacd099 Compare May 13, 2024 23:20
@igor-toporet
Copy link
Contributor Author

I'm not sure the build failure is related to my changes.

@igor-toporet
Copy link
Contributor Author

The test failure does not reproduce locally. It could be a flaky test (suite).

@jeremydmiller
Copy link
Member

@igor-toporet You could have just done a TrimEnd(';') first

@igor-toporet
Copy link
Contributor Author

@igor-toporet You could have just done a TrimEnd(';') first

🤦 indeed 😄 sometimes obvious solution doesn't come to mind.

Should I close the PR?

@jeremydmiller jeremydmiller merged commit 933b606 into JasperFx:main May 14, 2024
1 check failed
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.

None yet

2 participants