Skip to content

Conversation

pull[bot]
Copy link

@pull pull bot commented Aug 16, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

> System.InvalidCastException: 'Unable to cast object of type 'AsyncStateMachineBox`1[System.IDisposable,Steeltoe.Connectors.RabbitMQ.RabbitMQServiceCollectionExtensions+<CreateConnectionAsync>d__5]' to type 'RabbitMQ.Client.IConnection'.'

This happened because the connect callback returned a `Task<IConnection>`, whereas the connector is registered in the service container with `IConnection`. There are two solutions:

1. Change the service registration from `ConnectorFactory<RabbitMQOptions, IConnection>` to `ConnectorFactory<RabbitMQOptions, Task<IConnection>>`, such that the call to `connectorFactory.Get().GetConnection()` needs to be awaited.
2. Stick with the current API and synchronously wait for the task to complete before returning it.

This PR implements solution 2, because that doesn't require breaking the public API.
I'm also unsure whether it's safe when the task is awaited concurrently.
…d list (#1567)

* Escape comma in Config Server environment setting, to fix crash in URL masking

* Additional hardening against special characters in Config Server URL

* Fixed: allow colon to appear in password

* Throw early when Config Server URL(s) is/are invalid

* Code cleanup
@pull pull bot locked and limited conversation to collaborators Aug 16, 2025
@pull pull bot added the ⤵️ pull label Aug 16, 2025
@pull pull bot merged commit 32752a3 into thompson-tomo:main Aug 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant