-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
I was using a single instance bean of chatClient and starting with the second call to the stream method i got an exception "java.lang.IllegalStateException: Unicast Sinks.Many allows only a single Subscriber". I am not sure if this is a bug or intended behaviour.
I'm new to Flux, but i think this happens because the Flux is always created from the same Sink instance in AbstractBedrockApi.internalInvocationStream()
I'm proxying controller calls sp i've added web request scope @scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.TARGET_CLASS) to the BedrockAnthropicChatClient bean, that fixed my use case.