Hi,
I've implemented a simple test for Aggregator pattern:

public void testAggregator() throws Exception {
                cc.addRoutes(new RouteBuilder() {

                        @Override
                        public void configure() throws Exception {
                                from("direct:start").multicast(null, 
true).to("direct:a", "direct:b");
                                
                                from("direct:a").process(new MockProcessor("a: 
")).to("direct:merge");
                                from("direct:b").process(new MockProcessor("b: 
")).to("direct:merge");
                                
                                from("direct:merge").process(new 
MockProcessor("MergeIn: "))
                                        .aggregator(header("ID")).batchSize(2)  
                
                                        .to("mock:end");                        
        
                        }                       
                });
                
                pt.sendBodyAndHeader("direct:start", "testMsg", "ID", 1);
                
                MockEndpoint mock = (MockEndpoint) cc.getEndpoint("mock:end");
                mock.expectedMessageCount(1);
                mock.assertIsSatisfied();               
        }
// where cc is a DefaultCamelContext and
// pt is a ProducerTemplate

I'm working with Camel 1.4, and to get this above code running, I need to
import
camel-core-1.4.jar
commons-logging-1.1.1.jar
junit-4.4.jar

BUT, the problem is, when I'm trying to use this pattern in a bigger
project, where also some spring-jars are needed it doesn't work anymore. It
seems to time out, i.e. the MockEndpoint doesn't receive any message. 
I figured out that this weird behaviour occurs when I, in addition to the
above jars, have imported the following spring-jars into projects classpath:

spring-core-2.5.5.jar
spring-context-2.5.5.jar
spring-beans-2.5.5.jar
spring-aop-2.5.5.jar

The log says:
WARNUNG: No getConsumers() available on Producer[direct:merge] for
Exchange[Message:  aggTest ]

So it seems that the route 
from("direct:merge").process(new MockProcessor("MergeIn: "))
                                        .aggregator(header("ID")).batchSize(2)  
                
                                        .to("mock:end");        
isn't correctly loaded? 

There seems to be a (hidden) dependency somewhere, I guess. But I need to
get it running really urgently, with Camel 1.4 and Spring 2.5.5 actually.


Thanks,
Rob

-- 
View this message in context: 
http://www.nabble.com/Aggregator-Problems-tp20085385s22882p20085385.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to