camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snowbug <>
Subject Re: Use regular spring bean definition style rather than xbean camelContext style
Date Sun, 06 Sep 2009 04:16:23 GMT

Thanks for the reply, do I need to open a ticket to track it? Before it is
implemented, is there any alternative way of initialize the camel context
with the package scan feature?


willem.jiang wrote:
> I think we can add the set methods for the PackageScan.
> For the ProducerTemplate, you just need to make sure you inject a right 
> camel context.
> Willem
> snowbug wrote:
>> Hi,
>> I would like to use regular spring bean definition style (<bean> tag)
>> rather
>> than the more expressive <camelContext> style to define my camel context
>> bean. Is it doable?
>> The reason:
>> - I'd like to be able to let the camel bean "depends-on" another bean I
>> defined to control the orders of the initialization for a couple of
>> critical
>> beans
>> - I'd like to use Spring's PropertyPlaceholderConfigure to externalize
>> some
>> properties that need to be changed by the client engineer, and one of
>> these
>> variables would be the packageScan of the camel context, as I'd like to
>> allow the client engineer to add their packages to be scanned by updating
>> the properties file. At present, the document says that Camel does not
>> support the Spring PropertyPlaceholderConfigure yet.
>> So after examining the CamelContextFactoryBean, I've tried something like
>> this:
>>     <bean id="camel"
>> class="org.apache.camel.spring.CamelContextFactoryBean">
>>         <property name="trace" value="false" />
>>         <property name="packageScan">
>>             <bean class="org.apache.camel.model.PackageScanDefinition">
>>               <property name="packages"></property>
>>             </bean>
>>         </property>
>>     </bean>
>> It won't work because the "packageScan" takes a "PackageScanDefinition"
>> class, which has a private List property "packages" that does not have a
>> public setter, so I have no way to initialize it.
>> Another thing is that I don't know how to create a template inside the
>> context... should it be created as a separate Spring bean?
>> Thanks,
>> Alan

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message