We’ve done a lot to set up team communications tools that help us work more productively. So far we have an intranet with a HTML shoutbox and an XMPP server for secure instant messaging and group chats, and we use the Notifications and Messaging frameworks so we can subscribe and get notifications of updates from just about anywhere. Our next challenge is to put all these pieces together and have notifications and messages passed around from anyone to anywhere.

The missing piece to do this and glue these pieces together is a messaging broker that can take incoming messages from multiple input channels, do some processing with them, and route the results to anywhere. We recently got this working. Meet the Messaging processor, an architecture capable of handling multiple channels and configurable processing queues. This is a high level block diagram of how it all fits together.

Note: Though the following screenshots are from live sites, this is still in the development stage and we are not releasing all the code (yet). Stay tuned for upcoming releases of all these modules.

The Ingredients

  • XMPP server and the XMPP Framework, with a few patches to allow persistent XMPP connections
  • A (100% PHP Drupal) chatbot that can connect periodically to the chat room and post read messages
  • A shoutbox module (integrated with our spaces architecture) that allows setting up shoutbox blocks for informal message blasts, tied to a specific team or site section
  • Messaging and Notifications frameworks, which are fully released as contributed modules
  • The new Messaging processor, which handles incoming messages, processing, and routing between channels

The Recipe

We start by setting up a shoutbox on our website and a chat room for the team to hang out in. These are the visible parts that team members can interact with, either posting a ‘shout’ using some AJAX UI or posting to the chat room.

Then we set up the ‘chatbot’ module, which can connect to the chat from time to time and say ‘Hi’ and whatever else you’d like it to.

Now we want the messages posted to the shoutbox (on the website) to show up in the chat room too, so we don’t have to check both at all times. We use incoming messages and messaging processors to do this. We see we have different ‘incoming methods’, depending on how messages enter the system.

For each method, we have one or more channels. For example for ‘shoutbox’, each different shoutbox is a channel and for ‘chatbot’ one channel is the group chat while another is the individual messages sent to the chatbot from your XMPP account.

Now we set up the actions (processors) to run for messages coming from each channel. In this example, we set up messages coming from the shoutbox to be redirected to the chat.

We also set it up so that messages posted to the ‘chatbot’ are be redirected to the shoutbox. So now, you can ping our chatbot on Pidgin or another XMPP client and “talk to him.” This allows us to post to the ‘shoutbox’ without even using the website, for example with your iPhone.

This is our set up so far. By enabling the Notifications module too, you also will be able to:

  • Subscribe to the shoutbox and get IM, SMS, and mail notifications of updates. For example, you can get a daily email with all the shouts from a certain group.
  • Get updates from the shoutbox or the chat room on system events like comments and node updates. Every notifications event can be now treated as an incoming message in any of these cases.

Those dots are for real. With this we can have everything cross-posted to anywhere and have subscriptions on anything. So if we want to get notices about node updates in the chat, all we have to do is:

The Dessert

Now that we have the main set up complete, what about something extra? For example, how about a “fortune” generator that spices up your chat room by posting some funny stuff from time time? Our chatbot module includes a fortune generator, using the Linux fortunes package.

We can set it up to produce a fortune every hour, post it to the chat, and save it as a new story.

Just don’t set it to run too often, as it can sink your team’s productivity ;-)

We're a team of engineers and designers working on big projects. We believe in open source and in building for lasting impact.

Learn more