[
https://issues.apache.org/jira/browse/IGNITE-27930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Anton Vinogradov resolved IGNITE-27930.
---------------------------------------
Resolution: Won't Fix
I looked at what it would take, and I think the two byte arrays have to stay.
Closing as Won't Fix; please reopen if you disagree.
{{bodyBytes}} and {{topicBytes}} carry two things the generated marshalling
cannot express.
*The class loader.* The body and the topic are user classes, and they are
unmarshalled with the peer-deployment class loader. That loader is resolved
inside the listener, from fields of the message itself plus the sender node id
- see {{GridIoManager.GridUserMessageListener#onMessage}}, the
{{ctx.deploy().getGlobalDeployment(...)}} call. The generic inbound pass has
none of this, so a {{@Marshalled}} field would be deserialized there with the
wrong loader.
*Laziness gated on the topic.* Every {{IgniteMessaging}} listener is registered
on the shared {{TOPIC_COMM_USER}}, so each one unmarshals the topic, compares
it with its own and returns early when they differ. The body is deserialized
only after a match, and then cached on the message for the remaining listeners.
With {{@Marshalled}} the body would be deserialized for every incoming message
even when no listener's topic matches - a slowdown, and deserialization of an
arbitrary user class with no consumer waiting for it.
This also matches the rule written down in IGNITE-28939: fields that really
hold user classes stay blobs, and the message topic is named there explicitly.
What can still be done here, if someone wants it: the pair of fields could be
described with {{@Marshalled}} once the code generator learns a deferred,
per-field unmarshal driven by the consumer. That is a code generator feature,
not a change to this message, so it deserves its own ticket.
> Get rid of external serialization in GridIoUserMessage
> ------------------------------------------------------
>
> Key: IGNITE-27930
> URL: https://issues.apache.org/jira/browse/IGNITE-27930
> Project: Ignite
> Issue Type: Task
> Reporter: Dmitry Werner
> Assignee: Anton Vinogradov
> Priority: Major
> Labels: IEP-132, ise, wire-format
> Fix For: 2.19
>
>
> All byte[] should be deleted. Serialization should be based on original
> fields serialization.
> They should become messages or supported by the codegen framework.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)