On 04/19/15 13:38, Erol Merdanović wrote:
Hi
I have created a simple NotificationActor which receives 2 types of
message: EmailMessage and MobileTextMessage. Main goal of the actor is
to call the external services and send an email or text message.
Everything works, but now I want to handle attachments. Attachments
can be up to 5MB. I'm aware of the message size limits. Does is make
sense to send messages to actor which contain attachments as bytes? Or
should I have some kind of persistent storage and then just use actor
to read and send messages?
sending large messages using akka remoting is considered an
anti-pattern, because system messages (deathwatch, heartbeats) travel
over the same channel. if these system messages get delayed, it can
trigger the failure detector
(http://doc.akka.io/docs/akka/2.3.9/scala/cluster-usage.html#Failure_Detector)
and cause a node to be quarantined. in general, akka remoting is a good
channel for "control plane" messages, but not necessarily for "data
plane" messages.
ask you mentioned, using an external data store is one option: instead
of sending the attachment in the message, you can send a 'reference' to
the attachment. in this case, you would also have to decide what to do
with the attachments after they have been processed. another solution
would be to use a separate transport such as TCP using akka-streams, or
HTTP using akka-http or spray, to send the attachment to the remote node.
-Michael
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.