Bart, Thank you very much. This gets me very close to a solution. Right now I have a couple RouteBuilder instances in my project and I use the <package> element in my blueprint to get the RouteBuilder instances loaded. I assume I'll need to break this up and load the routes into the context individually. I looked through the camel source code and cannot find an instance where you can pass multiple RouteBuilder instances into a context but I'll try it.
Cheers, Mark On Fri, Jun 16, 2017 at 4:52 AM, Bart Horré <b...@anova.be> wrote: > Hi, > > in the below code example you'll find a blueprint file containing a > reference to the service which is then inserted in a camel route. > This can of course also be done in Spring. > I hope this is of any use to you. > > > <?xml version="1.0" encoding="UTF-8"?> > <!-- > Licensed to the Apache Software Foundation (ASF) under one or more > contributor license agreements. See the NOTICE file distributed with > this work for additional information regarding copyright ownership. > The ASF licenses this file to You under the Apache License, Version > 2.0 (the "License"); you may not use this file except in compliance > with the License. You may obtain a copy of the License at > http://www.apache.org/licenses/LICENSE-2.0 Unless required by > applicable law or agreed to in writing, software distributed under the > License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR > CONDITIONS OF ANY KIND, either express or implied. See the License for > the specific language governing permissions and limitations under the > License. > --> > <!-- Configures the Camel Context--> > <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> > > > <reference id="service" interface="com.example.MyService"/> > > <bean id="routes" class="com.example.MyRoute"> > <argument ref="service"/> > </bean> > > <camelContext xmlns="http://camel.apache.org/schema/blueprint"> > <routeBuilder ref="routes"/> > </camelContext> > </blueprint> > > > public class MyRoute extends RouteBuilder { > > private MyService service; > > public MyRoute(MyService service) { > this.service = service; > } > > public void configure() { > ///// > } > > } >