zilla icon indicating copy to clipboard operation
zilla copied to clipboard

Simplify version based encoding in MqttServerFactory

Open bmaidics opened this issue 2 years ago • 0 comments

We should address all switch statements in MqttServerFactory for version 4 vs version 5 in the code each time an encoding decision is needed.

We can use an inner class MqttVersion enum with methods like doEncodePubcomp(...) where the v4 constant delegates to doEncodePubcompV4 and the v5 constant delegates to doEncodePubcompV5, while here we would just call version.doEncodePubcomp(...). Similar approach for other switch (version) statements

bmaidics avatar Feb 05 '24 13:02 bmaidics