What's the most simple xmpp server for transfer of simple IMs?

Hi All,

Iā€™ve searched and searched, but all answers seem to skirt what Iā€™m afterā€¦

I want to create an extremely basic (but extensible) XMPP server for transfer of messages between two xmpp clients.

Form what I can gather I need Tinder API ā€¦ plus something to route the messages, is this correct?

I check out the Openfire code, but itā€™s massive, and far too much for meā€¦ it would take me weeks to find my way around it.

Iā€™m an intermediate Java dev and just need something simple to build on. Can anyone point me in the right direction please?

Many thanks

it would take me weeks to find my way around it.

You really want to build an XMPP server from scratch? I appreciate the idea and I donā€™t want to get you demotivated, but I estimate it will take you months and I think itā€™s a lot harder than you might think.

Itā€™s not only about sending messages from A to B and ā€œsomething to route themā€.

You need to understand the concepts around java.nio (working with ServerSocketChannel or AsynchronousServerSocketChannel) which isnā€™t trivial (donā€™t use ServerSocket!).

Then you need to understand TLS and Javaā€™s SSLEngine, which isnā€™t trivial either.(You can also use a NIO framework, but I donā€™t know if itā€™s easier, because you would have to learn the framework as well).

Then you have to understand SASL (javax.security.sasl) to implement authentication.

If you are familiar with all those things, itā€™s very valuable knowledge, but most developers arenā€™t.

Then you have to read and re-read and re-read the XMPP specifications to get things right and implement all of the mandatory core features, which are required before sending the first message (Connection management, TLS negotitation, SASL authentication, Resource Binding, Stream features, error handling, routing, etc.).

These are really only the basic requirements for a minimal XMPP serverā€¦ as you can see, a lot to understand and a lot to implement.

And donā€™t use Tinder, it wonā€™t help you much for the tasks above and even when youā€™re done with them, I wouldnā€™t recommend it.

Wow, what a reply!

So useful and completeā€¦ But sort of crushing too I guess thatā€™s why Iā€™ve just not come across any slim, Minimal xmpp servers then.

Hopefully youā€™ll be kind enough to advise me of a general direction to look. You seem extremely knowledgeable about the subject.

The end result Iā€™m looking for is:

An open source, fully sourced (I.e.not using a hosted service), Instant Messaging set-up (client and server) that I can extend to add some functionality to server and client that allows me to add additional services (e.g. Client asks server for weather reports, which appear in the chat client).

I need to stick to java as Iā€™m tryingto get good at it (and hence not attempt to learn a new language each week!)

Your help and advice wouldbbe truly appreciatedā€¦ Many thanks so far.

You seem extremely knowledgeable about the subject.

I once had the same crazy idea as you :wink:

Do you want a real XMPP server or just use some custom protocol for private purposes to communicate between client and server?

In any case a basic requirement for any IM server is to implement the connection management. This is independant from the later application protocol. You can use Javaā€™s built-in tools (i.e. java.nio.channels.ServerSocketChannel) for that or use a framework (which is usually only an abstraction above Java NIO). (e.g. Openfire uses Apache MINA).

If you are ā€œtrying to get good at Javaā€, Iā€™d try to first learn/understand Java NIO before learning a framework.

When you are done with a simple client-server setup, which exchanges simple messages (bytes), e.g. an echo server, which replies with the clientā€™s text, you can think of the protocol you want to use. For XMPP read through Extensible Messaging and Presence Protocol (XMPP): Core and try to implement 4.2. Opening a Stream and 4.3. Stream Negotiation.

Then move your way forward: TLS negotiation, SASL negotiation (authentication) and Resource Binding.

Oh and I forgot in my last post to mention that you also need database skills (i.e. JDBC or better JPA) to store your users, rosters, etcā€¦, but thatā€™s in a later step.

that I can extend to add some functionality to server and client that allows me to add additional services (e.g. Client asks server for weather reports, which appear in the chat client).

XMPP seems best for this requirement.

Thanks CSH,

Iā€™ve been doing a bit more searching into what Components are, and how OpenFire might implement them (thereā€™s a Whack example about returning weather information).

Iā€™m wondering whether this actually might be a short way (alongside the long journey!)) to implements what I needā€¦ As in post above:

LHXS:

ā€¦that I can extend to add some functionality to server and client that allows me to add additional services (e.g. Client asks server for weather reports, which appear in the chat client).

Does this sound the way in which Components work in Wildfireā€¦ and perhaps I should be looking at that? - or was your (very sensible) description the only way to get it done?

Many thanks again

A component is just like an external plugin, which communicates via XMPP with the server instead of the direct Java API (and therefore could run on a different machine).

A client could send messages to this plugin/component. But you could as well write an internal Openfire plugin then (I find it more robust, because it runs embedded in Openfire and uses Openfireā€™s API directly).

I donā€™t know what you need and want. I had the impression you want to write a simple XMPP server, not just a plugin/component for Openfire.

Thanks v.much

OK, Iā€™ve spent quite a while messing around with Openfire and I think I might be able to achieve it with OpenFire (either as a plugin or a component).

Iā€™ve been trying to get hold of the Whack source, but the SVN doesnā€™t seem to be working, and the download doesnā€™t work either!

I donā€™t suppose you have access to the Whack source (with the Ant Build file do you)?

Best

You can find all the sources on GitHub (not sure about the Ant though) https://github.com/igniterealtime

Thanks very much CSH.

I think to achieve my end goal without the incredible amount of work you outlined, I can do this with a plugin, so Iā€™ve started the question in that area.

Thanks for the advice, you may have helped me dodge a bullet.

If I do go down the roll-your-own route, Iā€™ll check back here.

Thanks