[jboss-jira] [JBoss JIRA] (JGRP-2480) ObjectMessage: better marshalling

Bela Ban (Jira) issues at jboss.org
Tue Jun 2 10:55:03 EDT 2020


     [ https://issues.redhat.com/browse/JGRP-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bela Ban updated JGRP-2480:
---------------------------
    Description: 
Currently, {{ObjectMessage}} accepts only objects of type {{SizeStreamable}} and wraps everything else into {{ObjectWrapper}} instances.

This means that primitive types (e.g. "{{7}}" or "{{hello world}}") will be wrapped, too. The disadvantage of {{ObjectWrapper}} is that it performs _eager marshalling_, creating an unwanted byte[] array before the message is actually marshalled. On the receiver side, another byte[] array will be created before the actual unmarshalling starts.

Solution: accept primitive types (e.g. {{int}}, {{Integer}}, {{String}}, {{AsciiString}}, {{byte[]}} etc) directly, without wrapping them into an {{ObjectWrapper}}.

  was:
Currently, {{ObjectMessage}} accepts only objects of type {{SizeStreamable}} and wraps everything else into {{ObjectWrapper}} instances.

This means that primitive types (e.g. "{{7}}" or "{{hello world}}") will be wrapped, too. The disadvantage of {{ObjectWrapper}} is that it performs _eager marshalling_, creating an (unwanted byte[] array before the message is actually marshalled. On the receiver side, another byte[] array will be created before the actual unmarshalling starts.

Solution: accept primitive types (e.g. {{int}}, {{Integer}}, {{String}}, {{AsciiString}}, {{byte[]}} etc) directly, without wrapping them into an {{ObjectWrapper}}.



> ObjectMessage: better marshalling
> ---------------------------------
>
>                 Key: JGRP-2480
>                 URL: https://issues.redhat.com/browse/JGRP-2480
>             Project: JGroups
>          Issue Type: Enhancement
>            Reporter: Bela Ban
>            Assignee: Bela Ban
>            Priority: Major
>             Fix For: 5.0.0.Beta2
>
>
> Currently, {{ObjectMessage}} accepts only objects of type {{SizeStreamable}} and wraps everything else into {{ObjectWrapper}} instances.
> This means that primitive types (e.g. "{{7}}" or "{{hello world}}") will be wrapped, too. The disadvantage of {{ObjectWrapper}} is that it performs _eager marshalling_, creating an unwanted byte[] array before the message is actually marshalled. On the receiver side, another byte[] array will be created before the actual unmarshalling starts.
> Solution: accept primitive types (e.g. {{int}}, {{Integer}}, {{String}}, {{AsciiString}}, {{byte[]}} etc) directly, without wrapping them into an {{ObjectWrapper}}.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jboss-jira mailing list