Accessibility

Table of Contents

Chatting Through IM Gateways in ColdFusion MX 7

Introducing the Instant Messaging Event Gateway

One of the most exciting new features available in ColdFusion MX 7 Enterprise is event gateways. Event gateways offer ColdFusion developers fantastic new possibilities by allowing ColdFusion applications to interface with practically any Internet-enabled system, even if that system doesn’t communicate through HTTP. There’s a whole world of other protocols and now ColdFusion developers have access to more or less all of them through the event gateway architecture. The event gateways themselves are written in Java so if Java can communicate with something, now ColdFusion can as well.

ColdFusion MX 7 Enterprise ships with several event gateways. The gateway that seems to have garnered the most attention is the Short Messaging Service (SMS) gateway, which enables cell phone text messaging capabilities in ColdFusion applications. Although the potential for SMS-enabled ColdFusion applications is huge, if you’re like I am, you probably use instant messaging far more than you do your cell phone. IM junkies rejoice: ColdFusion MX 7 Enterprise ships with IM gateways for Extensible Messaging and Presence Protocol (XMPP) and Lotus Sametime.

In this tutorial I demonstrate using the XMPP gateway with an open-source Jabber server called Jive Messenger Server. (If you use Sametime, the vast majority of the ColdFusion code presented here will work with Sametime as well.) Jabber is an implementation of the free, open source, XML-based XMPP IM protocol. That’s a lot of acronyms! The main point is that Jabber is freely available, easy to install, and works great with CFMX 7’s XMPP gateway. Visit www.jabber.org for more information about XMPP and Jabber.

Installing Jive Messenger Server

Step one in the journey to giving the ColdFusion server IM ability is installing a Jabber server. For this, you use Jive Messenger Server and a Jabber client; if you haven’t already installed a Jabber client, I recommend Exodus. I’ve also had good luck with Pandion. As an aside, even though I’m typically a Macintosh user, I’ll use Windows software in this article to reach the widest audience. Macintosh fans simply need to install a Macintosh-based Jabber server and client.

The Jive Messenger installation process is straightforward.

  1. Download Jive Messenger Server.
  2. Double-click the installation EXE file.
  3. Select Launch Admin when the installation finishes. This will open a browser to http://127.0.0.1:9090 and a configuration wizard (Figure 1). If you have Windows XP Service Pack 2 and you are running the SP2 firewall, you may see a message warning you about traffic over port 9090. Click on Unblock to continue. This port needs to be open in order to access the Jive Messenger administrator.
  4. During the installation process, specify that the Server Name setting is 127.0.0.1 (Jive defaults to using your computer’s name.)
  5. You can select the Standard Database Connection option to use an external database such as MySQL to store your user data, which I did just so I could peek into the database and see what was going on. But you can also select Embedded Database if you just want to get started quickly. If you choose to use an external database, refer to the Jive Messenger documentation for installation details.
  6. Enter an admin password and write it down for future reference. Enter the administrator’s e-mail address (a valid e-mail address). Click Finish.

Now go into the administrator interface for Jive Messenger Server.

  1. Go to: http://127.0.0.1:9090.
  2. Log on using the information you provided during the installation.
  3. Select the Registration and Login option under the Server Settings section.
  4. Enable the Inband Account Registration and Anonymous Login so that you can create a new account on the server directly from the Jabber client. This will make the rest of the tutorial simple. Click Save Settings.
  5. Make sure to leave Jive Messenger running in the background as you continue the tutorial.

    The Jive Messenger Administrator

    Figure 1. The Jive Messenger Administrator

    (+) View larger

Believe it or not, once your Jabber server is running, the hard part is already out of the way.