通过通用代码将通知推送到各种设备 [英] Push notifications to various devices through a common code

查看:23
本文介绍了通过通用代码将通知推送到各种设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,即我必须将消息推送给使用 android 或 iphone 设备的各种用户.我知道将推送通知发送到 android 或 iphone 应用程序的各个过程.

I have a requirement which is that I have to push the messages to various users who are using android or iphone devices.I know the individual process to send the push notification to android or iphone application.

现在我的工作是我需要在java中进行服务器端实现,以便可以将消息发送到android和iphone设备.使用android和iphone设备的用户数量很大,比如10000人.

Now my work is that I need to do the server side implementation in java so that messages can be sent to android and iphone devices.The number of users using the andrioid and iphone devices is large say 10000 people.

那么实现这个要求应该是什么方法.我应该用什么方法将多播消息发送到 android 和 iphone 设备?我正在考虑使用线程说有 10000 个用户,我已经创建了 10 个线程,因此 10 个线程中的每个线程将处理 1000(=10000/10) 个用户的推送通知.

So to implement this requirement What should be the approach. What should be my approach to send the multicast messages to android and iphone devices? I am thinking of using the threads say there are 10000 users and I have made 10 threads so each thread out of 10 thread will handle push notifications for 1000(=10000/10) users.

任何其他suugestion..

Any other suugestion..

我应该使用 JMS,如果是,那么使用 JMS 的方法应该是什么.

Should I use JMS and if yes then what should be the approach using JMS.

请建议我非常紧急.

提前致谢.

推荐答案

我目前正在做的是:

  1. 接收想要发送推送通知的输入
  2. 将其发送到 ActiveMQ 队列
  3. 侦听器接收该消息,然后让另一个类构建要发送给用户的消息
  4. 然后根据第 3 步将新消息发送到另一个 ActiveMQ 队列
  5. 侦听器收到该消息,然后根据设备类型让另一个类向用户设备发出消息

我走这条路线的原因是步骤 1、3、5 可以在 applicationContext.xml 中更改它们的 concurrency.

The reason I went this route was steps 1,3,5 could have their concurrency changed in the applicationContext.xml.

这篇关于通过通用代码将通知推送到各种设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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