Grails JMSTemplate how to add MessageConverter to the Message Listener

436 views Asked by At

I am using Grails for a JMS application using JMSTemplate. I want to add a custom MessageConverter while receiving the message from the queue.

How do I add the MessageConverter name to the resources.groovy conf file?

I have the message listener set up as :

jms{
   'listener-container'('connection-factory': 'singletonJmsFactory',
                        'concurrency': 1,
                        'acknowledge': 'client') {
      listener(destination: "FINDLAW.WLDREFRESH.LDCACHEUPDATE",
               ref:' profileUpdateListenerService',
               method: 'onMessage')
      adapters(messageConverter: 'MessageConverter')
   }
}
1

There are 1 answers

0
Jan Bentzen On

This seems to work in Config.groovy

jms {
    containers {
        standard {

        }
    }
    adapters {
        standard {
            messageConverter = new MappingJackson2MessageConverter()
        }
    }
}

Not sure about resources.groovy. Grails jms docs here