In the end, I switched to using the resource adapter provided by activemq, which is in the lib / optional directory.
In case anyone is interested, here are the steps I followed to get it to work.
asadmin create-resource-adapter-config --property ServerUrl=failover\:(tcp\://localhost\:61616,tcp\://localhost\:61617) activemqra
asadmin deploy --name activemqra <path to activemq-rar-5.4.2.rar>
Then to create the resources:
asadmin create-connector-connection-pool
asadmin create-connector-resource
asadmin create-admin-object
To connect mdb, I had to add this to sun-ejb-jar.xml
<mdb-resource-adapter>
<resource-adapter-mid>activemqra</resource-adapter-mid>
<activation-config>
<activation-config-property>
<activation-config-property-name>DestinationType
</activation-config-property-name>
<activation-config-property-value>javax.jms.Queue
</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>destination
</activation-config-property-name>
<activation-config-property-value>MyQueue
</activation-config-property-value>
</activation-config-property>
</activation-config>
</mdb-resource-adapter>
To associate this with spring JMSTemplate:
<bean id="ConFac" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>jms/MyQueueQQFactory</value>
</property>
<property name="resourceRef">
<value>true</value>
</property>
</bean>
<bean id="myqueue" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>jms/MyQueue</value>
</property>
<property name="resourceRef">
<value>true</value>
</property>
</bean>
<bean id="mdbTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="conFac" />
<property name="defaultDestination" ref="myqueue" />
</bean>
source
share