Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using camel activemq component documentation example pooled connection spring configuration #3

Open
stephen-swensen opened this issue Jan 14, 2013 · 1 comment

Comments

@stephen-swensen
Copy link

We've had issues with connection leaks using the default routing-jms activemq connection management (not actually sure what the defaults are; whether connection pooling is used at all, or whether the pool size is just incredibly high: the defaults allow over 1000 connections to grow when using e.g. dynamic endpoints). The following is a translation of the documentation's example connection pooling spring configuration ((http://camel.apache.org/activemq.html) to the grails spring dsl, consider using this as the default spring configuration shipped with the routing-jms plugin:

jmsConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) {
    brokerURL = application.config.grails.plugin.routing.jms.brokerURL ?: 'vm://LocalBroker'     
}

pooledConnectionFactory(org.apache.activemq.pool.PooledConnectionFactory) { bean ->
    bean.initMethod = 'start'
    bean.destroyMethod = 'stop'
    maxConnections = 8
    connectionFactory = ref('jmsConnectionFactory')
}

jmsConfig(org.apache.camel.component.jms.JmsConfiguration) {
    connectionFactory = ref('pooledConnectionFactory')
    concurrentConsumers = 10
}

activemq(org.apache.activemq.camel.component.ActiveMQComponent) {
    configuration = ref('jmsConfig')
}
@padcom
Copy link
Owner

padcom commented Jan 14, 2013

Hi,

it makes sense. Could you create a pull request out of it?

M.

2013/1/14 stephen-swensen [email protected]

We've had issues with connection leaks using the default routing-jms
activemq connection management (not actually sure what the defaults are;
whether connection pooling is used at all, or whether the pool size is just
incredibly high: the defaults allow over 1000 connections to grow when
using e.g. dynamic endpoints). The following is a translation of the
documentation's example connection pooling spring configuration (
http://camel.apache.org/activemq.html), consider using this as the
default spring configuration shipped with the routing-jms plugin:

jmsConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) {
brokerURL = application.config.grails.plugin.routing.jms.brokerURL ?: 'vm://LocalBroker'
}

pooledConnectionFactory(org.apache.activemq.pool.PooledConnectionFactory) { bean ->
bean.initMethod = 'start'
bean.destroyMethod = 'stop'
maxConnections = 8
connectionFactory = ref('jmsConnectionFactory')
}

jmsConfig(org.apache.camel.component.jms.JmsConfiguration) {
connectionFactory = ref('pooledConnectionFactory')
concurrentConsumers = 10
}

activemq(org.apache.activemq.camel.component.ActiveMQComponent) {
configuration = ref('jmsConfig')
}


Reply to this email directly or view it on GitHubhttps://github.com//issues/3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants