Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-2083

Delayed start of spring camel context does not work with "shouldStartContext=false"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.0.0
    • 2.1.0
    • camel-core, camel-spring
    • None
    • unit test, jdk 1.5, spring 2.5.6

    Description

      I set "shouldStartContext" to false and want to start the context later by calling start() on the context.from the code.

      The routes do not start.

      I found a workaround, setting shouldStartContext manually before starting the context from the code:

                  ((SpringCamelContext)camelContext).setShouldStartContext(true);
                  camelContext.start();
      

      Example context:

      	<camel:camelContext id="ids.camel.context" shouldStartContext="false"> 
      		 
      		<!-- Queue endpoints. -->
      		<camel:endpoint id="defaultInQueue" uri="jms:queue:${default.in.queue.name}"/>  
      		<camel:endpoint id="defaultOutQueue" uri="jms:queue:${default.out.queue.name}"/> 				
      
      		<!-- Route to send messages to IDS  -->
      		<camel:route id="out" trace="true">
      			<camel:from uri="direct:sender"/>
      			<!-- Do not expect answer (fire and forget) -->
      			<camel:setExchangePattern pattern="InOnly"/>
      			<camel:to ref="defaultOutQueue"/>
      		</camel:route>
      
      		<!-- Route to receive -->	
      		<camel:route id ="in" trace="true">
      			<camel:from ref="defaultInQueue"/>
      			<camel:to uri="bean:defaultTextAdapter?method=onMessage"/>
      		</camel:route>
      		
      	</camel:camelContext>	
      

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              laurent.bovet Laurent Bovet
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: