camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paulo Ramos <paulo.ra...@multicert.com>
Subject Re: Processor thread pool
Date Tue, 16 Oct 2007 18:07:18 GMT

I am using Camel 1.1-SNAPSHOT.
I have tried your example but i have only one message being processed by the
"Processor" at the same time.

camel-context.xml :

...
    	<endpoint id="queueA"   uri="activemq:queue:a"/>
    	<endpoint id="queueB"   uri="activemq:queue:b"/>

	<route>
		<from uri="queueA" />
		<thread coreSize="5" maxSize="15" daemon="false" keepAliveTime="1"
priority="0" stackSize="5"/> 
		<bean ref="processar"/>
		<!-- <process ref="processar" /> -->
		<to uri="queueB" ></to>		
	</route>
...
	<bean id="processar" class="org.apache.camel.example.spring.ProcessarPrc"
/>


ProcessarPrc.java :

public class ProcessarPrc implements Processor{


public void process(Exchange e) {

    	Message in = e.getIn();
    	Mensagem  mesg = in.getBody(Mensagem.class);
    	
    
System.out.println(this.getClass().getSimpleName()+"vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv"+mesg.getId());

    	
    	mesg.setProcessado(new Random().nextBoolean());
	long t;
	t = System.currentTimeMillis();
	
	while(System.currentTimeMillis()-t<5000){}
		
        in.setBody(mesg);
    	System.out.println(this.getClass().getSimpleName()+" - " +
mesg.toString());
    
System.out.println(this.getClass().getSimpleName()+"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"+mesg.getId());
    }
}

-- 
View this message in context: http://www.nabble.com/Processor-thread-pool-tf4627377s22882.html#a13239009
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message