GCM / FCM推送通知中的消息限制 [英] Message throttling in GCM / FCM push notification

查看:399
本文介绍了GCM / FCM推送通知中的消息限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道谷歌FCM推送通知中的消息调节功能吗?我正在尝试使用FCM实现示例推送通知,但不明白在其步骤中提到的消息限制。还没有关于它的文件。



https://aerogear.org/docs/unifiedpush/aerogear-push-android/guides/#google-setup



有人可以澄清一下这个术语吗?

通过 Throttling rel =nofollow> https://stuff.mit.edu 可以很好地解释它:


为防止滥用例如向设备发送大量消息)并优化设备的整体网络效率和电池使用寿命,GCM使用令牌桶方案实现消息的节流。消息按每个应用程序和每个折叠键(包括不可折叠消息)进行限制。每个应用程序折叠键都被授予一些初始令牌,并且在此之后定期授予新的令牌。每个令牌对发送到设备的单个消息有效。如果应用程序崩溃密钥耗尽其可用令牌的供应,则新消息将缓存在未决队列中,直到在定期授予时新的令牌可用时为止。因此,在定期授权间隔之间进行调节可能会增加短时间内发送大量消息的应用程序合拢键的消息传递等待时间。出于网络和电池效率的原因,如果应用程序折叠键的待处理队列中的消息由GCM为属于非限制类别的消息搭载,则可能会在下一次定期授予时间之前发送。


简单来说,我想您可以简单地看到像漏斗这样的限制,防止消息溢出(通常用于下游消息传递),调整消息的流入以避免泛滥。例如,您发送1000条消息到单个设备(我们还要说所有消息都已成功发送), GCM有可能会限制您的消息,以便只有少数消息可以通过或者每个消息将被传递,但不会同时传递给设备。


I would like to know what is called Message throttling in Google FCM push notification? I am trying to implement a sample push notification using FCM, but didn't understand about message throttling mentioned in their steps. There is no documentation also found about it.

https://aerogear.org/docs/unifiedpush/aerogear-push-android/guides/#google-setup

Could someone clarify about this term?

解决方案

This documentation of Throttling by https://stuff.mit.edu explains it really well:

To prevent abuse (such as sending a flood of messages to a device) and to optimize for the overall network efficiency and battery life of devices, GCM implements throttling of messages using a token bucket scheme. Messages are throttled on a per application and per collapse key basis (including non-collapsible messages). Each application collapse key is granted some initial tokens, and new tokens are granted periodically therefter. Each token is valid for a single message sent to the device. If an application collapse key exhausts its supply of available tokens, new messages are buffered in a pending queue until new tokens become available at the time of the periodic grant. Thus throttling in between periodic grant intervals may add to the latency of message delivery for an application collapse key that sends a large number of messages within a short period of time. Messages in the pending queue of an application collapse key may be delivered before the time of the next periodic grant, if they are piggybacked with messages belonging to a non-throttled category by GCM for network and battery efficiency reasons.

On a simpler note, I guess you can simply see throttling like a funnel that prevents an overflow of messages (normally for downstream messaging), regulating the in-flow of messages to avoid flooding.

For example, you send 1000 messages to a single device (let's also say that all is sent successfully), there's a chance that GCM will throttle your messages so that only a few would actually push through OR each message will be delivered but not simultaneously to the device.

这篇关于GCM / FCM推送通知中的消息限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆