Hello Nikolay, I can't remember the real reasons why it was done this way (Perhaps, there were no reasons except that A and B are different protocols and these protocols were implemented independently.), but I can fantasize a little on this topic: TCP Communication supports protocol versioning, please take a look at DirectMessageReader/DirectMessageWriter.
/** * @param msgFactory Message factory. * @param protoVer Protocol version. (This protocol version is set via node attributes.) */ public DirectMessageReader(final MessageFactory msgFactory, final byte protoVer) The Discovery protocol does not provide this capability, so it allows for various optimizations to be implemented. For instance, when sending discovery messages from a router node (server node) to thick clients connected to the router, it is assumed the message is marshaled only once, and we can send it to all client nodes. In the case of using DirectMessageWriter, we have to marshal a message every time. And I think there is more than one such case. Yes, I understand we can improve/fix such cases; my point is to highlight that we need to take into account such hidden gems :) Perhaps, in the context of Apache Ignite, all that stuff does not play a big role due to the fact that RollingUpgrade is not supported. However, I see that you have published a new IEP [1], which is a great idea! Perhaps we will have a chance to fix/re-implement old and awkward parts of the Apache Ignite. [1] https://cwiki.apache.org/confluence/display/IGNITE/IEP-132+Rolling+Upgrade Thanks, S. пн, 25 нояб. 2024 г. в 17:27, Nikolay Izhikov <nizhi...@apache.org>: > Hello, Igniters. > > Planning to work on Ignite serialization and study current codebase. > > I wonder - why we use different approaches to serialize communication and > discovery messages? > > - MessageWriter/MessageReader pluggable implementations for Communication > SPI > - java serialization (jdk marshaller) for Discovery SPI. > > Is there any reason don’t use MessageReader/MessageWriter approach for > discovery?