I gave this suggestion a go, so that I had the following:

  <bean id="routing-config" class="org.dominic.RoutingConfig" >
     <property name="something" value="23" />
  </bean>
  
  <bean id="route-builder" class="org.dominic.MyFirstRouter" >
     <property name="config" ref="routing-config" />
  </bean>  
  
  <bean id="camel" class="org.apache.camel.spring.CamelContextFactoryBean" >
     <property name="routeBuilder" ref="route-builder" />
  </bean>

I also removed <camelcontext> from the file.  Unfortunately this doesn't
seem to quite work.
I get errors indicating that a broker already exists (see below).  However,
I don't have another broker running so I presume that AMQ is deciding to
make two camel instances for some reason.
It's a shame because it seemed quite a neat solution for now!

WARN  ManagementContext              - Failed to start jmx connector: Cannot
bind to URL [rmi://localhost:1099/jmxrmi]:
javax.naming.NameAlreadyBoundException:
jmxrmi [Root exception is java.rmi.AlreadyBoundException: jmxrmi]
ERROR BrokerService                  - Failed to start ActiveMQ JMS Message
Broker. Reason: javax.management.InstanceAlreadyExistsException:
org.apache.activemq
:BrokerName=localhost,Type=Broker
javax.management.InstanceAlreadyExistsException:
org.apache.activemq:BrokerName=localhost,Type=Broker
        at
com.sun.jmx.mbeanserver.RepositorySupport.addMBean(RepositorySupport.
java:452)



RomKal wrote:
> 
>> A RouteBuilder is not necessarily gonna be XML marshallable via JAXB;
>> so we might just wanna refer to RouteBuilder instances by ID in the
>> XML.
> 
> I believe we should allow this in namespace notation.
> 
> But just to solve Dominic's problem maybe instead of creating our
> context via <camelContext> we could simply do
> 
> <bean class="org.apache.camel.spring.CamelContextFactoryBean">
> <property name="routeBuilder" ref="myConfiguredBuilder/>
> </bean>
> 
> It should work, shouldn't it?
> 
> Romek
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Configuring-a-Routebuilder-from-activemq.xml-file--tp14923839s22882p14951653.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to