Hi there,
not quite. If you use java serialization of X that contains Y things, then
Java serialization serializes the entire thing.
For example, if you serialized a List using java serialization, it also
will serialize the things inside the list - that's how it works.

Akka always wraps your serialized message in a binary (protobuf serialized
nowadays) envelope, the envelope contains your message,
serialized using whichever serializer was configured for it.

So with the List + Java example you'll end up with a java serialized list
of java serialized items, within an akka envelope.

Tips:
a) Don't send around raw lists anyway, define proper message types - it's
your message protocol, take good care of it.
b) Define a good serializer for your messages. You can start out with
akka-kryo-serialization, it's simple to set up, pretty fast etc.

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 6 September 2016 at 08:33:36, Viktor Klang (viktor.kl...@gmail.com)
wrote:

Akka encloses the binary data in an envelope to track message size. It is
recommended to send small messages for the same reason it is recommended to
to send huge packets through normal post boxes. :-)

--
Cheers,
√

On Sep 6, 2016 08:00, "Wei" <weix...@gmail.com> wrote:

> Hello,
>
> I am trying to write a custom serializer in akka. While deriving from the
> Serializer trait and implementing the fromBinary(byte, clazz) methods, I
> started to think of a questions: does the byte given to this method always
> one whole message? Could it be partial or multiple message in the byte? In
> other words, how does akka determine message boundary when getting the byte
> from the network stream?
>
> Thanks a lot.
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/
> current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups
"Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to