pandaapo commented on PR #4702:
URL: https://github.com/apache/eventmesh/pull/4702#issuecomment-1873764679
> > Thank you for your explanation. Since the version before PR #4678 not
only ensure accuracy, but also make decoding logic clearer and simpler, would
it be better to revert to the previous version without adding extra decoding
complexity?
>
> It is also possible to roll back to the previous version. This is based on
the current transformation. We can see the opinions of others in the community.
The previous implementation was to implement decoding and encoding separately
using two decoders and two encoders. Now, decoding and encoding are implemented
through Codec, which is essentially no different from the previous
implementation. It is just the coding method and implementation. The previous
implementation was processed through Netty's own internal generic
implementation. The current PR is handled by the developer's customization.
Compared to the previous version before PR #4678, the logic in this PR still
adds some complexity, such as embedding the following decoding logic on the
basis of previous code, while the previous version was not affected by these
details of EventMesh custom protocol.
```
...
if (in.readableBytes() < prefixLength + 4 + 4) {
// Not enough data to read the package length and header length
return;
}
...
if (in.readableBytes() < packageLength - prefixLength) {
// Not enough data yet, reset the reader index and wait for more data
in.resetReaderIndex();
return;
}
...
```
I completely agree with what you said: we can see the opinions (modify like
this or revert) of others in the community.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]