masesgroup / KNet

KNet is a comprehensive .NET suite for Apache Kafka™ providing all features: Producer, Consumer, Admin, Streams, Connect, backends (ZooKeeper and Kafka)
https://knet.masesgroup.com/
Apache License 2.0
38 stars 6 forks source link

SerDes creates too many listener instances #448

Closed masesdevelopers closed 4 months ago

masesdevelopers commented 4 months ago

Describe the bug Allocation of https://github.com/masesgroup/KNet/blob/16b0b133224961e348885dd607ed31130fc5fa33/src/net/KNet/Specific/Serialization/SerDes.cs#L54 creates too many listener instances

To Reproduce Steps to reproduce the behavior:

  1. Execute any test program which instantiate the following class https://github.com/masesgroup/KNet/blob/16b0b133224961e348885dd607ed31130fc5fa33/src/net/KNet/Specific/Serialization/SerDes.cs#L54
  2. On each instantiation the registered listeners in JCOBridge raise

Expected behavior Since the following https://github.com/masesgroup/KNet/blob/16b0b133224961e348885dd607ed31130fc5fa33/src/net/KNet/Specific/Serialization/SerDes.cs#L60 https://github.com/masesgroup/KNet/blob/16b0b133224961e348885dd607ed31130fc5fa33/src/net/KNet/Specific/Serialization/SerDes.cs#L61 https://github.com/masesgroup/KNet/blob/16b0b133224961e348885dd607ed31130fc5fa33/src/net/KNet/Specific/Serialization/SerDes.cs#L62 are used to send to the JVM references to serializer interfaces, no listeners shall be activated because .NET shall not react on event.

Screenshots

Desktop (please complete the following information):

Additional context N/A

masesdevelopers commented 4 months ago

The problem is strictly related to listeners and comes from many things:

To avoid the problem the code shall be updated to: