服务器端的优秀XMPP Java库? [英] Good XMPP Java Libraries for server side?

查看:218
本文介绍了服务器端的优秀XMPP Java库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望用Java实现一个简单的XMPP服务器。

I was hoping to implement a simple XMPP server in Java.

我需要的是一个可以解析和理解来自客户端的xmpp请求的库。我看过Smack(下面提到)和JSO。 Smack似乎只是客户端,所以虽然它可能有助于解析数据包,但它不知道如何响应客户端。 JSO是否保持它看起来很旧。唯一有希望的途径是拆开Openfire,这是一个完整的商业(OSS)XMPP服务器。

What I need is a library which can parse and understand xmpp requests from a client. I have looked at Smack (mentioned below) and JSO. Smack appears to be client only so while it might help parsing packets it doesn't know how to respond to clients. Is JSO maintained it looks very old. The only promising avenue is to pull apart Openfire which is an entire commercial (OSS) XMPP server.

我只是希望在Netty之上提供几行代码或者Mina,所以我可以开始处理一些消息。

I was just hoping for a few lines of code on top of Netty or Mina, so I could get started processing some messages off the wire.

Joe -

我想要做的事情的答案有点长 - 我会尽量保持简短。

Well the answer to what I am trying to do is somewhat long - I'll try to keep it short.

有两件事,只是松散相关:

There are two things, that are only loosely related:

1)我想写一个XMPP服务器因为我想为两个客户编写自定义协议进行通信。基本上我在想一个联网的iPhone应用程序 - 但我不想依赖低级二进制协议,因为使用类似XMPP的东西意味着应用程序可以从基于本地wifi的应用程序快速成长到基于互联网的应用程序...

1) I wanted to write an XMPP server because I imagine writing a custom protocol for two clients to communicate. Basically I am thinking of a networked iPhone app - but I didn't want to rely on low-level binary protocols because using something like XMPP means the app can "grow up" very quickly from a local wifi based app to an internet based one...

交换的消息应该是相对较低的延迟,所以严格来说二进制协议是最好的,但我觉得如果XMPP没有'可能值得探索'引入了太多的开销,以至于我可以使用它,然后在以后获得它的可扩展性和灵活性。

The msgs exchanged should be relatively low latency, so strictly speaking a binary protocol would be best, but I felt that it might be worth exploring if XMPP didn't introduce too much overhead such that I could use it and then reap benefits of it's extensability and flexability later.

2)我为Terracotta工作 - 所以我有这种疯狂的弯曲集群一切。一旦我开始考虑编写一些自定义服务器代码,我想我想集群它。 Terracotta使Java POJO的扩展变得微不足道,所以我的想法是构建一个超级简单的XMPP服务器作为Terracotta的演示应用程序。基本上每个用户都将通过TCP连接连接到服务器,这将用户注册到散列映射。每个用户都有一个LinkedBlockingQueue,其中一个侦听器线程从队列中获取消息。然后,任何想要向任何其他用户(例如任何旧聊天应用程序)发送消息的连接用户只需通过该连接向该用户发出XMPP消息(通常)。服务器选择它,在地图中查找相应的用户对象并将消息放入队列。由于队列是群集的,因此无论目标用户是连接到同一物理服务器还是不同的物理服务器,都会传递消息,正在侦听的线程会将其拾取并将其发送回目标用户的tcp连接。

2) I work for Terracotta - so I have this crazy bent to cluster everything. As soon as I started thinking about writing some custom server code, I figured I wanted to cluster it. Terracotta makes scaling out Java POJOs trivial, so my thought was to build a super simple XMPP server as a demonstration app for Terracotta. Basically each user would connect to the server over a TCP connection, which would register the user into a hashmap. Each user would have a LinkedBlockingQueue with a listener thread taking message from the queue. Then any connected user that wants to send a message to any other user (e.g. any old chat application) simply issues an XMPP message (as usual) to that user over the connection. The server picks it up, looks up the corresponding user object in a map and places the message onto the queue. Since the queue is clustered, regardless of wether the destination user is connected to the same physical server, or a different physical server, the message is delivered and the thread that is listening picks it up and sends it back down the destination user's tcp connection.

所以 - 我不害怕总结。但这就是我想要做的。我想我可以为Openfire编写一个插件来完成#1,但我认为它会处理大量的管道,因此很难做到#2(特别是因为我希望能够适应的代码非常少简单的10-20kb Maven项目。)

So - not too short of a summary I'm afraid. But that's what I want to do. I suppose I could just write a plugin for Openfire to accomplish #1 but I think it takes care of a lot of plumbing so it's harder to do #2 (especially since I was hoping for a very small amount of code that could fit into a simple 10-20kb Maven project).

推荐答案

http://xmpp.org/xmpp-software/libraries/ 有一个XMPP软件库列表。这是过时的快照:

http://xmpp.org/xmpp-software/libraries/ has a list of software libraries for XMPP. Here is an outdated snapshot of it:

ActionScript

  • as3xmpp

C

  • iksemel
  • libstrophe
  • Loudmouth

C ++

  • gloox
  • Iris
  • oajabber

C# / .NET / Mono

  • agsXMPP SDK
  • jabber-net

Erlang

  • Jabberlang

Flash

  • XIFF

Haskell

  • hsxmpp

Java

  • Echomine Feridian
  • Jabber Stream Objects (JSO)
  • Smack

JavaScript

  • strophe.js
  • xmpp4js

Lisp

Objective-C

  • xmppframework

Perl

  • AnyEvent::XMPP

PHP

  • Lightr
  • xmpphp

Python

  • jabber.py
  • pyxmpp
  • SleekXMPP
  • Twisted Words
  • xmpp-psn
  • xmpppy

Ruby

  • XMPP4R

Tcl

  • JabberLib

这篇关于服务器端的优秀XMPP Java库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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