EventBus vs Stream, when to choose streams over the eventbus

瀏覽次數:164 次
跳到第一則未讀訊息

Vijay Veeraraghavan

未讀,
2015年7月14日 凌晨4:10:462015/7/14
收件者:reactor-...@googlegroups.com
I am using the Reactor's Eventbus in one of my project. The application uses it to process the tweets and other event from the Twitter stream, before persisting it to the database. The below is the way it was implemented,
  1. A thread opens a streaming connection, reads the tweets, messages and other events stream, queues it into the Redis.
  2. The (Redis) queue message consumer reads messages one-by-one and publishes it to appropriate topic on the eventbus, (roughly based on the tweet, messages and other types of notifications)
  3. The subsequent processes are split into many events (topics) with every event working on the received data separately (some in parallel, some in sequence) and forwards to the next topic. A message passes through (before being persisted to db) roughly 3-4 events based on various conditions.
  4. Once the data is processed the final (leaf) event persists the processed data to the provided database.

Recently reading some documents and looking into some videos of the project reactor, it was suggested good to choose stream over the eventbus, when the eventbus chain has more than ~2. But, sadly, the document/video didn't elaborate much on this topic. I would like to know what are the parameters choosing the eventbus over streams or the vice-versa? Can the above requirement be modified to work with streams (allowing parallelism)? If so how? (Just give me some rough picture).

For a general background of what I would like to achieve, sometime ago, I tried to implement this requirement using the Apache Storm but due to the project dead line I left it for the Reactor.

-V
回覆所有人
回覆作者
轉寄
0 則新訊息