Waldemar Masilunas
Waldemar Masilunas

Reputation: 103

set MaxThreadPoolSize by InitialContext for ActiveMQ

I am configuring ActiveMQ via InitialContext similar to this code:

try {
    connectionFactory = (ConnectionFactory)jndiContext.lookup("ConnectionFactory");
    destination = (Destination)jndiContext.lookup(destinationName);
} catch (NamingException e) {
    LOG.info("JNDI API lookup failed: " + e);
    System.exit(1);
}

Is it possible to set MaxThreadPoolSize via property files?

Here is an example to set it only via code: http://activemq.apache.org/maven/apidocs/org/apache/activemq/ActiveMQConnectionFactory.html

I cannot find anything useful regarding this topic in the ActiveMQ docs. I saw in sources of ActiveMQConnectionFactory: http://grepcode.com/file/repo1.maven.org/maven2/org.apache.activemq/activemq-core/5.7.0/org/apache/activemq/ActiveMQConnectionFactory.java that the property's name is maxThreadPoolSize. Will it work?

Upvotes: 0

Views: 502

Answers (1)

Pranalee
Pranalee

Reputation: 3409

You will have to set max pool size using setter method only while creating connection factory. But the value that you pass to setter method that can be read from properties file

Upvotes: 1

Related Questions