Nuno Carvalho wrote:
Yes, I have some suggestions :-) One of them is that the send/receive
methods receive messages has Serializable objects. heven if they are
byte[], when I implement that primitives I'm forced to view this has an
Serializable object. This has 2 drwabacks: 1) Java Serialization is a
little bit heavy; 2) the messages became very big. Could these
primitives receive a reference to a byte[] ? If the programmer knows the
object contents, could serialize objects more efficiently. The interface
could offer primitives to serialize objects based on the basic types.
This is just an ideia that I will ilustrate with some code.
Hi Nuno,
I take the liberty to get back to you through the Hedera mailing list
since other users may have their word to say on this API-related topic.
In fact the optimization you talk about is contemplated in the
org.continuent.hedera.channel.ChannelMessage class. You should be able
to inherit from this class and override the getByteArray method. Any
message-specific optimizations can be implemented there.
Then it's up to the particular Hedera implementation to invoke
getByteArray rather than using plain Java serialization. You can see an
example in the send method of the
org.continuent.hedera.channel.JGroupsReliableGroupChannel class.
Regards,
Damián
_______________________________________________
Hedera mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/hedera