We're creating an activity feed system, one of the processing logic is to implement 'fan-out-on-write'. We used to use Apache Storm, I'm thinking using spring-integration should be able to achieve same parallelism.
The use case is, UserA has 1,000 followers, when UserA has a new activity, notify all followers.
My current thinking is like below:
<int:splitter ref="activitySplitter" method="fanOutToFollowers" input-channel="activity" output-channel="activitySplitted"/>
<int:channel id="activitySplitted">
<int:dispatcher task-executor="executor"/>
</int:channel>
<int:service-activator input-channel="activitySplitted" ref="activityHandler" method="handleMessage"/>
The splitter will split {activity}
to [{activity, follower1}...{activity, follower1000}]
, and send to a executor channel, the service activator will store the data.
Is there any better suggestion? Thanks!