Plugins You can find out about all the publicly available Grails plugins.

Jabber plugin

  • Tags: xmpp, jabber
  • Latest: 2.0
  • Last Updated: 26 February 2015
  • Grails version: 1.1.1 > *
  • Authors: null
0 vote
compile "org.grails.plugins:jabber:2.0"




grails install-plugin jabber


The Jabber plugin is a tiny Grails plugin for interacting with Jabber services (such as Google talk). You can send messages to Jabber from all your controllers and services, and you can optionally registered a listener in one of your service classes to be notified of incoming messages.

There is a little configuration required in your /conf/Config.groovy file. Add the following section and point it to your jabber server of choice:

chat {
        serviceName = "local.decaf"
        host = "localhost"
        port = 5222
        username = "glen"
        password = "password"

If you are using it with Google Talk, you will want your settings to be something like:

chat {
    serviceName = ""
    host = ""
    port = 5222
    username = "[email protected]"
    password = "your_password"

Once that’s in, you can happily invoke sendJabberMessage(userId, content) from any of your controllers or services:

sendJabberMessage("[email protected]", "Just a tester....")

If you’d like to listen for incoming Jabber messages, you need to add an ‘expose’ list similar to the JMS and Remoting plugin (which I used as the sample template for my plugin) to one of your service classes.

class DemoService {

static expose = [ 'jabber' ]

def onJabberMessage = {msg ->

println "Eeek a message.. From ${msg.from} with body ${msg.body}"

} }

And you’re off and running!