Hi All,<div><br></div><div>I'm new to RabbitMQ and planning to use RabbitMQ in our social application.</div><div>Would like to receive more advices on design approaches and best practices form you all. </div><div><br>
</div><div>The following is the basic requirements of our system:</div><div><br></div><div><meta charset="utf-8"><div>The whole application is called community. Inside community we have groups.</div><div>In each group, user can have discussion topics within the group.</div>
<div>User can share file/resource to community.</div></div><div>There is a wall page for user. Also there is a wall page for the group.</div><div><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1038.35">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 12.0px 0.0px; font: 14.0px Times; min-height: 18.0px}
p.p2 {margin: 0.0px 0.0px 12.0px 0.0px; font: 14.0px Times}
</style>
<p class="p1"><br></p><p class="p1"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1038.35">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 12.0px 0.0px; font: 14.0px Times; min-height: 18.0px}
p.p2 {margin: 0.0px 0.0px 12.0px 0.0px; font: 14.0px Times}
</style>
</p><p class="p1"><br></p>
<p class="p2">(EVENT-1 :: if user share a file/resource to community)</p>
<p class="p2">- update on wall of that user</p>
<p class="p2">- update on wall of all friends</p>
<p class="p2">- add to moderation queue</p>
<p class="p2"><b>TARGET</b>: self, friends; </p><p class="p2"><b>ACTION</b>: update wall, add to moderation</p><p class="p2"><br></p><p class="p2"><meta charset="utf-8"></p><p class="p2" style="margin-top: 0px; margin-right: 0px; margin-bottom: 12px; margin-left: 0px; font: normal normal normal 14px/normal Times; ">
(EVENT-2 :: if someone comments on shared file/resource of community)</p><p class="p2" style="margin-top: 0px; margin-right: 0px; margin-bottom: 12px; margin-left: 0px; font: normal normal normal 14px/normal Times; ">- update on wall of that user (primary actor)</p>
<p class="p2" style="margin-top: 0px; margin-right: 0px; margin-bottom: 12px; margin-left: 0px; font: normal normal normal 14px/normal Times; ">- update on wall of all other people (other actors) who also commented on the resource </p>
<meta charset="utf-8"><p class="p2" style="margin-top: 0px; margin-right: 0px; margin-bottom: 12px; margin-left: 0px; font: normal normal normal 14px/normal Times; ">- update on wall of all friends of primary actor</p><p class="p2" style="margin-top: 0px; margin-right: 0px; margin-bottom: 12px; margin-left: 0px; font: normal normal normal 14px/normal Times; ">
- notify to all other people (other actors) who also commented on the resource</p><meta charset="utf-8"><p class="p2" style="margin-top: 0px; margin-right: 0px; margin-bottom: 12px; margin-left: 0px; font: normal normal normal 14px/normal Times; ">
<b>TARGET</b>: primary actor, friends, other actors; </p><p class="p2" style="margin-top: 0px; margin-right: 0px; margin-bottom: 12px; margin-left: 0px; font: normal normal normal 14px/normal Times; "><b>ACTION</b>: update wall, notify</p>
<p class="p2" style="margin-top: 0px; margin-right: 0px; margin-bottom: 12px; margin-left: 0px; font: normal normal normal 14px/normal Times; "><br></p><div>(EVENT-3 :: admin delete particular file/resource from community)</div>
<div>- clean up work</div><div>- notify the owner</div><div><b>TARGET</b>: owner</div><div><b>ACTION</b>: clean up, notify</div><p></p><p></p>
<p class="p2"><br></p><p class="p2">(EVENT-4 :: if user post a conversation to certain discussion topic within the group)</p>
<p class="p2">- update to group wall</p>
<p class="p2">- update to group members' wall</p>
<p class="p2">- notify to all group members</p><p class="p2">- classify trending of the discussion</p><p class="p2"><b>TARGET</b>: group, group members</p><p class="p2"><b>ACTION</b>: update wall, notify, classify trending</p>
<p class="p2"><br></p><p class="p2"><br></p><p class="p2">This is my initial plan:</p><p class="p2">- planning to use <b>topic exchange</b> for that. </p><p class="p2">- use queues binding such as ( #.self , #.friends, #.group, #.groupmembers, #.otheractors )</p>
<p class="p2"><br></p><p class="p2">But my concern is:</p><p class="p2">- how do we mix together the <b>TARGET</b> and <b>ACTION</b> so that one routing key will cover all possible combination?</p><p class="p2">- do I require to send 2 messages with different routing keys to get the possible combination? (which I don't really want to since the publisher will have too much knowledge about the business rule)</p>
<p class="p2"><meta charset="utf-8">- Is it the right approach? Or should I just have either of ACTION or TARGET and have the consumer decide based on the event type?</p><p class="p2">- What is the recommended number of exchanges for such situation?</p>
<p class="p2">- Would be great if you could suggest the good naming practice for queue and exchange.</p><p class="p2"><br></p><p class="p2">OR if my approach is not appropriate, please kindly suggest the workaround and fixes so that I could learn. </p>
<p class="p2"><br></p><p class="p2">Thanks guys.</p><p class="p2">Alex</p><p class="p2"><br></p><p class="p2"><br></p><p class="p2"><br></p></div>