(Quick Reference)

2 Plugging In A JMS Provider

Version: 2.0.0.RC2

Table of Contents

2 Plugging In A JMS Provider

The plugin does not include a JMS provider so you must install and configure your own.

All you need to provide is one or more javax.jms.ConnectionFactory beans and the plugin takes care of the rest.

The plugin looks for a connection factory bean named jmsConnectionFactory.

2.1 ActiveMQ Example

Getting ActiveMQ up and running as your provider is very simple. All that is required is adding a runtime dependency on the activemq-spring library in build.gradle.

// ...

dependencies {

// … compile 'org.grails.plugins:jms:2.0.0.M1' runtime 'org.apache.activemq:activemq-spring:5.11.1' }

The runtime will recognize that activemq-spring is available and will auto configure the jmsConnectionFactory in the Spring application context. The org.springframework.boot.autoconfigure.jms.activemq.ActiveMQConnectionFactoryConfiguration class is what is actually configuring the jmsConnectionFactory bean. If the default factory settings are not sufficient the factory may be configured with any of the properties defined in the org.springframework.boot.autoconfigure.jms.activemq.ActiveMQProperties class by defining corresponding properties in application.yml with corresponding property names defined under spring.activmeq as shown below.

spring:
    activemq:
        brokerUrl: vm://localhost
        pooled: true