camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dougly <>
Subject Configure Route in Spring Context
Date Thu, 11 Dec 2008 00:08:18 GMT

Hi riders,

I have a couple of properties in my RouteBuilder class that needed to be
initialized using Spring application context file.

public class MailRouteBuilder extends RouteBuilder

    private static MailConfigure mailConfig;
    private static IEmailMessageProcessor messageProcessor; 

then in my Spring context file I have this

<camelContext xmlns="">
  <bean id="mailRoute" class="com.lyfam.component.mail.MailRouteBuilder">
  	<property name="mailConfig" ref="mailConfigure" />
  	<property name="messageProcessor" ref="messageProcessor" />

Spring will try to create 2 instances of this MailRouteBuilder: one in the
camel context initialization and the other for the bean "mailRoute".
Obviously, this is not what I want.
Can I reuse/instruct camelContext to use the existing bean after it is
configured. In this case I need the camel context to use my "mailRoute"

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

View raw message