I am wondering if the below is possible in Spring
- Read a property file using spring - this file has a list of jms queue names
- Make spring loop on the above list and define beans that define Apache camel routes from that queue to a file
I could just create the routes using java code on the apache camel context, but wondering if it is possible through spring. 开发者_运维技巧
Reading a property file in a Spring XML wiring file is easy; e.g. using a PropertiesFactoryBean
. However, the second part of the problem cannot (I believe) be solved without writing a significant amount of Java code.
I suggest that you read Section 3.8.3 of the Spring Reference that describes how to write your own FactoryBean classes. Another possibility is to create a custom Java configuration bean as described in Section 3.11. There may be other possibilities too.
Warning: none of this stuff is particularly straight-forward if you are coming at it for the first time.
精彩评论