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 ;-)
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.
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:
...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.
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)?
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.