You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a scenario with Pekko actors where I am implementing a NATS consumer actor that fetches batches of events from a NATS Object Store every 10 seconds. Each batch can contain millions of events, with a total size of around 100 MB.
After fetching, the consumer actor needs to send the events to a processor actor for handling. I see two approaches:
Sending each event individually (processorActor ! event)
Sending the entire batch as a single message (processorActor ! eventsArray)
I’m concerned about:
Actor mailbox memory usage and backpressure
Serialization limits (e.g., maximum-frame-size)
Processing throughput
Hot shards / distribution if using cluster sharding
My questions:
What is the recommended pattern for safely sending millions of events from a NATS consumer actor to a processor actor in Pekko?
Should I batch messages (e.g., 1k–10k events per message), or is sending the whole batch (~100 MB) ever acceptable?
Any best practices for cluster sharding or distributing load for high-volume message processing?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I have a scenario with Pekko actors where I am implementing a NATS consumer actor that fetches batches of events from a NATS Object Store every 10 seconds. Each batch can contain millions of events, with a total size of around 100 MB.
After fetching, the consumer actor needs to send the events to a processor actor for handling. I see two approaches:
(processorActor ! event)(processorActor ! eventsArray)I’m concerned about:
My questions:
Thanks in advance for your guidance!
Beta Was this translation helpful? Give feedback.
All reactions