I have the following scenario:
- a variable number ( greater than three ) of queues (depends on a configuration set in a file)
- some of these queues can either be fed with data or not (it depends on the producer that receives data through a network client: the client can be either connected or not during the same session)
- These queues are fed at different speeds; so, for example, Queue1 can have 10 objects at a given time whereas another queue Queue2 can have just 3 objects at the same given time
- the objects in these queues must be synchronized according to a property that is shared by all of them (an int property constantly increasing named "SSId")
- the synchronization must happen only for the queues that at a given moment are fed with data (unconnected queues have to be excluded)
- when the objects are synchronized they must be pushed to a corresponding output queue used by the related consumer: each producer is associated to a specific consumer
- following the previous step each consumer is able to process the enqueued object with the same property value for "SSId" at the same time;
- So, the final outcome should be a system where the consumers are able to process data (syncronized according to the already mentioned "SSId" property) at the same rate even when each producer generate it at different speeds/rates
To give a clearer idea there is a schema representing the flow described in the previous points:
Note that the new items with SSid greater than 100 are not pushed on the consumer queues as there are no corrisponding items in the other queues yet.
Could you suggest an approach for creating this kind of synchronization using either .NET TPL Dataflow or Rx.NET? Until now I've used TPL Dataflow for implementing simple sequential pipelines and I'd like a feedback on how to proceed with this scenario. Thanks in advance for any suggestion.