System.ArgumentException: 'An item with the same key has already been added. Key: <my-topic-name>'
See original GitHub issueHi, I’m trying to stream messages from multiple topics to a single topic, e.g. “archive”.
But I’m getting this exception.
System.ArgumentException: 'An item with the same key has already been added. Key: <my-topic-name>'
at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException[T](T key)
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at Streamiz.Kafka.Net.Processors.Internal.InternalTopologyBuilder.BuildTopology(ISet`1 nodeGroup, TaskId taskId)
at Streamiz.Kafka.Net.Processors.Internal.InternalTopologyBuilder.BuildTopology(Nullable`1 id)
at Streamiz.Kafka.Net.KafkaStream..ctor(Topology topology, IStreamConfig configuration, IKafkaSupplier kafkaSupplier)
at MyCompany.MyApp.MyService.CreateKafkaStream() in <obfuscated>.cs:line NN
Am I doing something unintended? Reading from multiple topics and writing to a single topic.
Thanks!
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
An item with the same key has already been added
An item with the same key has already been added. And the exception details: [ArgumentException: An item with the same key has already...
Read more >Error "An item with the same key has already been added"
This scenario typically occurs if an operating system image is being used to deploy cluster nodes and that image was not correctly prepared...
Read more >An item with the same key has already been added c# MVC
So start by looking at the error message: An item with the same key has already been added.
Read more >An Item With the Same Key Has Already Been Added
An item with the same key has already been added error happens when the model has the same property twice. Click here to...
Read more >An item with the same key has already been added Error
The error reads: "An item with the same key has already been added." It does not matter if I include the database name...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, I am away from keyboard. But here’s the essence of the topology.
From topic A depending on the contents of the message I branch into two branches, map the messages differently in each branches and ultimately send to topics B and C. From B map again and send to D. From C also map (differently) and send to D again. So the topic D needs to be a terminal destination for both branches.
But a stream with this topology can’t be instantiated. Maybe, a topology must be a directed acyclic graph (DAG)?
Meantime, I managed to work it around with separate streams/topologies. A to B&C, B to D, C to D.
Thanks for looking into this!
Thank you for fixing it!