segunda-feira, 17 de agosto de 2009

Grails 1.2M2, JMS and ActiveMQ plugins

UPDATE: As I initially suspected, this wasn't a Grails problem: There's been some bean renaming in the last versions of JMS plugin that caused the incompatibility with the ActiveMQ plugin. Both plugins have released new versions (JMS 0.5-RC2 and ActiveMQ 0.1) that are now compatible once again.


Recently I tried to use JMS and ActiveMQ with Grails 1.2-M2 and found some bumps while trying to make it all work together. Well, after some experimentation, I found the missing pieces of the puzzle: Both jmsConnectionFactory and defaultJmsTemplate beans are missing. It seems that the plugins are no longer fully integrated as they used to be...

Without any further investigation I've simply configured them in the resources.groovy file, like this:


beans = {
jmsConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) {
brokerURL = 'vm://localhost'
}

defaultJmsTemplate(org.springframework.jms.core.JmsTemplate) {
connectionFactory = ref("jmsConnectionFactory")
}
}


... and all worked as expected. Maybe it's something that I'm doing wrong, but for now that I need a quick prototype, it's working perfect.

Feel free to leave any suggestion in the comments.