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

Springwolf Cloud Stream - Duplicate key issue if publisher and subscriber have a same topic #415

Closed
SheheryarAamir opened this issue Oct 23, 2023 · 1 comment · Fixed by #416
Labels
bug Something isn't working staged for release

Comments

@SheheryarAamir
Copy link
Contributor

Describe the bug
Springwolf Cloud Stream - Duplicate key issue if publisher and subscriber have a same topic.

for instance we have below spring configuration for Publish and Subscribe. In this case class CloudStreamFunctionChannelsScanner scan method will throw duplicate exception. as its trying to map topic as a key and in below case topic name is same topic_A. ideally it should merge ChannelItem and setPublish for publisher and setSubscribe for subscriber.

# Binding configuration for publisher
spring.cloud.stream.bindings.createEvent-out-0.destination=topic_A

# Binding configuration for subscriber
spring.cloud.stream.bindings.consumeEvent-in-0.destination=topic_A

Dependencies and versions used
For example, springwolf-cloud-stream-plugin version 0.15.1.

Stack trace and error logs
Duplicate key topic_A (attempted merging values ChannelItem(ref=null, description=null, servers=null, subscribe=Operation(operationId=topic_A_subscribe_createEvent, summary=null, description=Auto-generated description, security=null, tags=null, externalDocs=null, bindings={googlepubsub=ExtendableObject(extensionFields=null)}, traits=null, message=Message(schemaFormat=application/vnd.oai.openapi+json;version=3.0.0, messageId=null, name=org.springframework.messaging.Message, title=Message, description=null, payload=PayloadReference($ref=#/components/schemas/Message), headers=HeaderReference($ref=#/components/schemas/HeadersNotDocumented), bindings={googlepubsub=ExtendableObject(extensionFields=null)})), publish=null, parameters=null, bindings={googlepubsub=ExtendableObject(extensionFields=null)}) and ChannelItem(ref=null, description=null, servers=null, subscribe=null, publish=Operation(operationId=topic_A_publish_consumeEvent, summary=null, description=Auto-generated description, security=null, tags=null, externalDocs=null, bindings={googlepubsub=ExtendableObject(extensionFields=null)}, traits=null, message=Message(schemaFormat=application/vnd.oai.openapi+json;version=3.0.0, messageId=null, name=org.springframework.messaging.Message, title=Message, description=null, payload=PayloadReference($ref=#/components/schemas/Message), headers=HeaderReference($ref=#/components/schemas/HeadersNotDocumented), bindings={googlepubsub=ExtendableObject(extensionFields=null)})), parameters=null, bindings={googlepubsub=ExtendableObject(extensionFields=null)}))

@timonback
Copy link
Member

Thank you @SheheryarAamir for the issue and proposed solution. We liked it and merged it right away.

The change will be part of the next release - most likely build today or next Friday.

If you want to try and verify it in your application, use the current SNAPSHOT build as described in our README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working staged for release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants