I've got a bean defined in resource.groovy like
beans = {
jmsConnectionFactory(org.apache.activemq.pool.PooledConnectionFactory) {bean ->
connectionFactory = {org.apache.activemq.ActiveMQConnectionFactory cf ->
brokerURL = brokerDestination
}
}
}
Now, 开发者_StackOverflow社区is there a way to dynamically change the brokerURL at runtime and therefore also restart the activemq connection?
An easier solution will be to define multiple connection factories for each of your brokers and corresponding bean destinations. You can then swap out the destinations conditionally in your code based on your requirement - there would not be a easy way to go back and modify the bean definitions once the beans have been initialized.
精彩评论