title: CamelContext camelContext = SpringCamelContext.springCamelContext(appContext, false); deprecated in camel version 2.17.3
body: <p>I'm using <code>Spring + Apache Camel</code> example. In this example earlier I was using <code>camel-core version 2.15.1</code>. Now I just updated dependency to <code>2.17.3</code> When I updated dependency I see that below method gets deprecated:</p>
  
  <pre><code>CamelContext camelContext = SpringCamelContext.springCamelContext(appContext, false);
  </code></pre>
  
  <p>Whats the replacement code for that ?</p>
  
  <p>Please my code below for reference:
  <strong>CamelTimerFeedingActiveMqExample</strong></p>
  
  <pre><code>public class CamelTimerFeedingActiveMqExample {
      public static final void main(String[] args) throws Exception {
          ApplicationContext appContext = new ClassPathXmlApplicationContext("timerFeedActiveMqApplicationContext.xml");
          CamelContext camelContext = SpringCamelContext.springCamelContext(appContext, false);
          try {
              camelContext.start();
              Thread.sleep(5000);
          } finally {
              camelContext.stop();
          }
      }
  }
  </code></pre>
  
  <p><strong>applicationContext.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"&gt;
  
      &lt;bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"&gt;
          &lt;property name="brokerURL" value="vm://localhost?broker.persistent=false" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"&gt;
          &lt;property name="connectionFactory" ref="connectionFactory" /&gt;
      &lt;/bean&gt;
  
      &lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
          &lt;route&gt;
              &lt;from uri="activemq:queue:numbers" /&gt;
              &lt;to uri="log:com.javarticles?level=INFO&amp;amp;groupInterval=10000" /&gt;
          &lt;/route&gt;
      &lt;/camelContext&gt; 
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>timerFeedActiveMqApplicationContext.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"&gt;
  
      &lt;bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"&gt;
          &lt;property name="brokerURL" value="vm://localhost?broker.persistent=false" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"&gt;
          &lt;property name="connectionFactory" ref="connectionFactory" /&gt;
      &lt;/bean&gt;
  
      &lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
          &lt;route id="timerPingToInQueue"&gt;
              &lt;from uri="timer:ping?period=1s" /&gt;
              &lt;transform&gt;
                  &lt;simple&gt;Ping at ${date:now:yyyy-MM-dd HH:mm:ss}&lt;/simple&gt;
              &lt;/transform&gt;
              &lt;to uri="activemq:queue:ping_queue" /&gt;
          &lt;/route&gt;
          &lt;route id="InQueueToConsole"&gt;
              &lt;from uri="activemq:queue:ping_queue" /&gt;
              &lt;to uri="stream:out" /&gt;
          &lt;/route&gt;
      &lt;/camelContext&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>timerSelectQueryApplicationContext.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:context="http://www.springframework.org/schema/context"
      xmlns:jdbc="http://www.springframework.org/schema/jdbc"
      xsi:schemaLocation="
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
          http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd"&gt;
  
      &lt;context:property-placeholder location="classpath:database.properties"/&gt;
  
      &lt;bean id="orderProcessor" class="com.javarticles.camel.components.OrderProcessor"/&gt;
  
      &lt;jdbc:initialize-database data-source="dataSource" enabled="true"&gt;
          &lt;jdbc:script location="classpath:db-schema.sql" /&gt;
          &lt;jdbc:script location="classpath:db-test-data.sql" /&gt;
      &lt;/jdbc:initialize-database&gt;
  
  
      &lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
          &lt;property name="driverClassName" value="${mysql.driver.class.name}" /&gt;
          &lt;property name="url" value="${mysql.url}" /&gt;
          &lt;property name="username" value="${mysql.username}" /&gt;
          &lt;property name="password" value="${mysql.username}" /&gt;
      &lt;/bean&gt;
  
      &lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
          &lt;route&gt;
              &lt;from uri="timer://queryTimer?period=2s" /&gt;
              &lt;setBody&gt;
                  &lt;constant&gt;
                      SELECT * FROM ORDERS WHERE STATUS='NEW' ORDER BY NAME
                  &lt;/constant&gt;
              &lt;/setBody&gt;
              &lt;to uri="jdbc:dataSource" /&gt;
              &lt;split&gt;
                  &lt;simple&gt;${body}&lt;/simple&gt;
                  &lt;to uri="bean:orderProcessor" /&gt;
              &lt;/split&gt;
          &lt;/route&gt;
      &lt;/camelContext&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;properties&gt;
          &lt;!-- General Properties --&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  
          &lt;!-- Apache Camel --&gt;
          &lt;apache.camel.version&gt;2.17.3&lt;/apache.camel.version&gt;
  
          &lt;!-- Spring Framework --&gt;
          &lt;spring.version&gt;4.3.1.RELEASE&lt;/spring.version&gt;
  
          &lt;!-- MYSQL --&gt;
          &lt;mysql.version&gt;5.1.39&lt;/mysql.version&gt;
  
          &lt;!-- Logging Framework --&gt;
          &lt;logback.version&gt;1.1.7&lt;/logback.version&gt;
          &lt;jcl-over-slf4j.version&gt;1.7.21&lt;/jcl-over-slf4j.version&gt;
  
          &lt;!-- Junit Framework --&gt;
          &lt;junit.version&gt;4.12&lt;/junit.version&gt;
      &lt;/properties&gt;
  
  
      &lt;dependencies&gt;
          &lt;!-- Spring Context --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Spring JDBC --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Camel core --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-core&lt;/artifactId&gt;
              &lt;version&gt;${apache.camel.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- camel stream --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-stream&lt;/artifactId&gt;
              &lt;version&gt;${apache.camel.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-jms&lt;/artifactId&gt;
              &lt;version&gt;${apache.camel.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- camel spring --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-spring&lt;/artifactId&gt;
              &lt;version&gt;${apache.camel.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- camel JDBC --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-jdbc&lt;/artifactId&gt;
              &lt;version&gt;${apache.camel.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- MYSQL --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;${mysql.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- JUnit --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;${junit.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>
  
  <p>Image:
  <a href="https://i.stack.imgur.com/6cPm1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6cPm1.png" alt="enter image description here"></a></p>