How to make a XMPP client in a container like tomc

2019-09-11 00:22发布

问题:

I need to login, receive and send some messages over XMMP with a servlet loaded on tomcat container.

I would like to know if there is any implementation already of this situation ?

thx for ur time :)

回答1:

I've found smack to be the best available java library for XMPP. It is however, far from perfect for server side development.

In particular you need to think about your clustering early as smack connections hold alot of state.

The api itself is very nice however, it's pretty trivial to connect and send messages and the documentation is decent. check it out http://www.igniterealtime.org/projects/smack/



回答2:

You can use Smack library or Mule ESB XMPP transport built on top of it. Whether it is a servlet or standalone application doesn't matter (at least when you are a client).