<div dir="ltr">Continuing on this discussion,<div><br></div><div>I remember we have met with Summers around this idea to identify what we can expect from GCM Topics when considering how UPS works internally with message queues.</div><div><br></div><div>The ideal implementation as Summers suggested is to try pushing via a GCM Topic and if push can&#39;t be performed this way, fall back to device-token based push.</div><div><br></div><div><br></div><div>In terms of UPS/JMS, I believe we should split GCM traffic into two queues:</div><div><br></div><div><ul><li>GCMTokenBatchQueue<br></li><li>GCMTopicQueue</li></ul></div><div>You can use this diagram to get better idea:</div><div><a href="https://docs.google.com/drawings/d/13IsJWPSJNYXtst-UVxQYmzH36C_EXQMYYr_jcu7nFmE/edit" target="_blank">https://docs.google.com/drawings/d/13IsJWPSJNYXtst-UVxQYmzH36C_EXQMYYr_jcu7nFmE/edit</a><br></div><div><br></div><div><br></div><div>Then the algorithm can be drawn as:</div><div><br></div><div>1. TokenLoader will identify categories/topics it can use to optimize GCM message dispatching - it will push appropriate GCMTopicQueue events and potentially send also GCMTokenBatchQueue events for devices that are not covered by GCM topics</div><div><br></div><div>2. TokenLoader should also perform DB count for each category/topic, and if it should go beyond 1 million tokens limit, it falls back to use device tokens</div><div><br></div><div>3. if for any reason the push to GCM topic fails we can still expand device tokens - in that case the only implementation detail is that we don&#39;t know whether device tokens are all loaded until all topic-based messages are processed</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 28, 2015 at 4:40 PM, Summers Pittman <span dir="ltr">&lt;<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Jul 28, 2015 at 10:20 AM, Sebastien Blanc <span dir="ltr">&lt;<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yo !<div>I have not enough info on the GCM Topic stuff but reading your message it sounds that we should leverage this &quot;transparently&quot; for the user , meaning it just uses the UPS categories and under the hood we use the GCM topics stuff. </div><div>Like you said we have to handle the fall over if they are more than 1 million user but since we use JMS batches with counting that should not be too hard (but Lukas should be able to give us more info on that) </div></div></blockquote></span><div>Awesome.  I&#39;ll run ahead with my ideas then and let people hash out their merits in the PR. </div><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>  </div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Jul 27, 2015 at 5:22 PM, Summers Pittman <span dir="ltr">&lt;<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">So I&#39;ve got a few ideas for how to implement this, but I hope some people more experienced with the platform can give some feedback before.<div><br></div><div>Quick Background:</div><div>In UPS right now we have a concept of categories.  A single UPS message can be broadcast to a bunch of devices which are subscribed to this category.  Google now supports this for GCM on Chrome, iOS, and Android so UPS can send a single message to GCM and GCM will broadcast that to up to a million devices.</div><div>End Quick Background</div><div><br></div><div>So first, how do we switch between sending a message to each device in a category to sending a topic message to GCM?  </div><div><br></div><div>In TokenLoader.java#L113 we are using the clientInstallationService to build a string of deviceTokens based on the variant and message criteria.  Is there any reason we can&#39;t create a &quot;topicToken&quot; which will be recognized later by GCMPushNotificationSender?  Another benefit to making this change here is that if we have over a million subscribers to the category we can just default to the default messaging.</div><div><br></div><div>There is also an open issue of whether or not we will update the clients to filter based on what category a message was sent to.  To do this we will have to include the category information in the message when we send it to devices going forward.  In GCM a topic message includes this information.  This means that if we have over a million subscriptions in the topic we will need to fall back to using the category information anyway.</div><div><br></div><div>Continuing on from the thread of falling back, it is possible for a topic message to fail to send because there are too many subscribers.  How would UPS handle regenerating the messages as deviceToken instead of topicToken messages?</div><div><br></div><div>Of course if someone has a better idea than &quot;topicTokens&quot; I&#39;m all ears.</div><div><br></div></div>
<br></div></div>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></div><br></div>
<br>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></span></div><br></div></div>
<br>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></div><br></div></div>