我需要使用 java web 技术开发一个通用的推送通知服务器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9799361/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-16 07:46:49  来源:igfitidea点击:

I need to develop a common push notification server using java web technologies

javajakarta-ee

提问by achukrishnan

I need to develop a common push notification server using java web technology for mobile devices(android,ios and windows phone,etc.. ).i mean that i need to push notifications to mobile devices from this server ,how it is possible ? i need some ideas ..so please help to accomplish this task...

我需要使用 java web 技术为移动设备(android、ios 和 windows 手机等)开发一个通用的推送通知服务器。我的意思是我需要从这个服务器向移动设备推送通知,这怎么可能?我需要一些想法......所以请帮助完成这项任务......

Thank you .

谢谢你 。

回答by Parth

This can be designed in different ways,

这可以以不同的方式设计,

  1. JMS based, where Event will generate an message and send it mobile. (This is preffered as its event based approach)
  2. CRON job based, where job is running and on some condition is generate message to mobile. (This would be continuously running a job)
  3. A DB trigger, which checks the DB and same as above point (Not so good as per today's design concepts)
  1. 基于 JMS,其中 Event 将生成一条消息并将其发送到移动设备。(这是首选作为其基于事件的方法)
  2. 基于 CRON 作业,作业正在运行,并且在某些情况下会向移动设备生成消息。(这将持续运行一项工作)
  3. 一个数据库触发器,它检查数据库和上面的点一样(不像今天的设计概念那么好)

Elaborate more what exactly you need, if this is not answering your issue.

如果这不能回答您的问题,请详细说明您需要什么。

Thanks.

谢谢。

回答by Didar Burmaganov

Push notifications can be done using Comet servlets or smth like that. I've used XMPP (Chat system) for such tasks. So your server and clients communicate through chat system (Openfire). Looks like this: CLIENT APP---->OPENFIRE<-----SERVER APP

推送通知可以使用 Comet servlets 或类似的方法来完成。我已经将 XMPP(聊天系统)用于此类任务。因此,您的服务器和客户端通过聊天系统 (Openfire) 进行通信。看起来像这样:CLIENT APP---->OPENFIRE<-----SERVER APP

Your server sends message to client and on client side you handle that message and make some actions!

您的服务器向客户端发送消息,在客户端处理该消息并执行一些操作!

回答by mfirry

How about pusher? I've used this service with java-libpusherand it seemed quite straightforward. Also check publisher libraries

如何推进?我已经将这个服务与java-libpusher 一起使用,它看起来很简单。还要检查出版商库

回答by Samarth Bhargava

If you want to have push notifications for web/mobile web, you can implement it in Java using cometd.

如果您想为网络/移动网络推送通知,您可以使用Cometd在 Java 中实现它。

If you want to push to Apple or Android devices, following links can get you started:

如果您想推送到 Apple 或 Android 设备,以下链接可以帮助您入门:

  1. http://blog.serverdensity.com/2010/10/07/android-push-notifications-tutorial/
  2. http://blog.serverdensity.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/
  1. http://blog.serverdensity.com/2010/10/07/android-push-notifications-tutorial/
  2. http://blog.serverdensity.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/

回答by quicksilver

I'm a bit late on this, but Google Cloud Messaging is a good solution for anyone else who might need a push service. You can check it out here : https://developer.android.com/google/gcm/index.html

我在这方面有点晚了,但对于可能需要推送服务的其他人来说,Google Cloud Messaging 是一个很好的解决方案。你可以在这里查看:https: //developer.android.com/google/gcm/index.html