FCM主题可以适合较大的用户群吗? [英] Can FCM topic is suitable for larger set of user?

查看:43
本文介绍了FCM主题可以适合较大的用户群吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对使用主题消息有些困惑,我的情况是根据通知触发一些作业.请帮助我更多地了解这一点.

I'm a little confused to use the topic messages, My scenario is to trigger some jobs bases on the notification. please help me understand more about this.

如果我们要处理大量用户,则可以使用FCM主题将通知发送给用户.我们可以仅将数据消息与主题消息一起使用吗?使用主题发送的邮件是否保证送达?我在FCM文档中看到``优化了主题消息以提高吞吐量而不是延迟.''通知的延迟时间长吗?

If we are dealing with a large set of users, the FCM topic can be used to send the notification to the user. Can we use just data messages with the topic messages? Are messages sent using topic guaranteed delivery? I have seen in the FCM document "Topic messages are optimized for throughput rather than latency." Does the notification has a long latency?

推荐答案

我们的帖子中有太多问题,但是我将尽我所能:

There are way too many questions in our post, but I'll address the ones I can:

FCM主题是否适合较大的用户群?

Can FCM topic is suitable for larger set of user?

是的.主题最适合将消息传递给您不想自己控制传递顺序的大量用户.确定向其发送消息的令牌称为扇出,当您使用主题时,让FCM为您处理此扇出.这减少了您必须存储的数据量和必须编写的代码,因此您牺牲了对过程的精细控制,以简化使用/实现.

Yes. Topics are best suited for delivering messages to large sets of users where you don't want to control the order of delivery yourself. Determining the tokens to which to send a message is known as fan-out, and when you use topics you let FCM take care of this fan-out for you. This reduces the amount of data you have to store and code you have to write, so you sacrifice fine grained control over the process for ease of use/implementation.

我们可以仅将数据消息与主题消息一起使用吗?

Can we use just data messages with the topic messages?

主题可用于传递FCM支持的任何类型的消息:通知消息,数据消息或组合消息.

Topics can be used to delivery any type of message FCM supports: notification messages, data messages, or combined messages.

使用主题发送的邮件是否保证送达?

Are messages sent using topic guaranteed delivery?

永远不能保证使用FCM传递消息.试图以其他方式告诉自己是一个神话.就是说,您Android手机上的大多数应用很可能会使用FCM来传递其通知和背景消息,因此您的应用不太可能比某些应用具有更严格的要求.

No message delivery with FCM is ever guaranteed. Trying to tell yourself otherwise is a myth. That said, most apps on your Android phone are likely yo use FCM for delivering their notification and background messages, so it's unlikely your app has more stringent requirements than some of those.

重要的是要意识到,当您使用主题时,有两个阶段.

Important to realize is that when you use topics, there are two phases.

  1. 主题扇出,将您的主题变成令牌的监听.
  2. 通过常规FCM基础结构交付这些令牌.

第二个与您直接发送给令牌的FCM消息具有相同的可用性.因此,区别在于扇出过程在共享的基础架构上运行.当然,在某些情况下,大邮件的散发会有所延迟,或者在所有项目中都有大量此类散发.

The second of this has the same availability as FCM messages that you send directly to tokens. So the difference is in the fan-out process, which runs on a shared infrastructure. There definitely are cases where there is a delay in fan-out for large messages, or if there's a big bulk of such fan-outs across all projects.

如果要完全控制此扇出性能,则应考虑自己构建它.如前所述,如果使用主题,则会牺牲(一些)灵活性和控制力,而倾向于(更)简单的实现.

If you want full control over this fan-out performance, you should consider building it yourself. As said before, if you use topics you sacrifice (some) flexibility and control in favor of a (much) simpler implementation.

通知的延迟时间长吗?

Does the notification has a long latency?

除了您在文档中引用的内容外,没有其他定义.当主题具有更多的订阅者时,它们是最佳的使用方式.如果您希望拥有大量的主题,而每个主题的订阅者相对较少,那么最好为此设置自己的扇出机制.

There's no definition of this beyond what you quote from the documentation. Topics are best for use when they have larger number of subscribers. If you expect to have a large number of topics each with relatively few subscribers, you might be better off setting up your own fan-out mechanism for that.

这篇关于FCM主题可以适合较大的用户群吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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