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

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

问题描述

我想知道 Google FCM 推送通知中的消息限制是什么?我正在尝试使用 FCM 实现示例推送通知,但不了解他们步骤中提到的消息限制.也没有找到关于它的文档.

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?

推荐答案

节流 by https://stuff.mit.edu 解释得很好:

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

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

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.

例如,您向单个设备发送 1000 条消息(假设所有消息都已成功发送),GCM 有可能会限制您的消息,以便只有少数消息会真正推送,或者每条消息都会被传递但不能同时连接到设备.

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天全站免登陆