Understanding IM
Instant messaging or IM as it is more commonly called is something that many users of the internet take for granted. It is the simple ability to send a message instantly to another user. Like SMS it doesn't sound like much but there is a lot going on behind the scenes.The first challenge facing someone developing an IM-based application is the concept that the event gateway itself is, in effect, an IM client. The server will log on to the IM network in the same way that any other user will log on. It will appear in your IM list as a user and to all outward respects, it is a normal user.The second challenge is how to build an application that makes sense to a user who is coming in from an IM client and to have that user interact with the rest of the application in a meaningful way.
Figure 32.1. This shows how the various pieces of the IM puzzle fit together.
[View full size image]

Understanding Presence
One of the key differences to note between and SMS application and an IM application is Presence. What does this mean? With IM, you can tell if someone is connected to the network or not, so before you send a user a message you can check to see if that user is there to receive it or not.At first this does not seem to be much but if you think of how we use IM today, this could radically change how ColdFusion applications interact with users. Let's take a simple helpdesk application as an example. In a traditional system a user would log a support ticket and the application would email the helpdesk staff group as a whole alerting them to the fact that there was a new ticket that needed to be address. Everyone in the support team would get that email, even if they weren't in the office to deal with it.In a presence aware application, sending out a blanket email as above would be a last resort. The application could query an IM server to determine which support engineers where online at present and IM them directly with a link to the support ticket so that it could be assigned almost instantly. If there were no support staff online, then the system could fall back to its existing email system (or maybe send an SMS message to the support engineer on call) and send an alert email.
Creating a Development Environment
Unlike the SMS gateway emulator in ColdFusion, when you are working with IM testing you need to connect your application to an IM Server.NOTEWhile writing this we used the Jive Messenger XMPP server (http://www.jivesoftware.org/) as our test server so we could totally control the environment. This is a relatively simple XMPP compliant IM server to install and configure and is available for Windows and Unix platforms.
XMPP Clients
To test your new system you will need to use an XMPP client to connect to the jabber network. There are a huge selection of clients out there, head to