Hi,
we try to aggregate messages from different provider, we use multicast
and aggregator but we cannot get it work. We tried it in different
ways but we don't have any idea what we do wrong. Please help:
public void configure() {
from("jbi:endpoint:http://tel.de/booking/jms/clientRequestReader").multicast().to(FLIGHTS,
HOTELS);
from(FLIGHTS).filter().xpath("//booking-package-request/flights")
.to("jbi:endpoint:http://flights.net/JMSProviderService/ypsilonRequestWriter");
from(HOTELS).filter().xpath("//booking-package-request/hotels")
.to("jbi:endpoint:http://www.hotels.com/JMSProviderService/gtaRequestWriter");
from("jbi:endpoint:http://flights.net/jms/flightsConnectorResponseWriter").to("direct:aggregator");
from("jbi:endpoint:http://www.hotels.com/jms/hotelsConnectorResponseWriter").to("direct:aggregator");
from("direct:aggregator").aggregator(header("JMSCorrelationID"),
new AggregationStrategy() {
@Override
public Exchange aggregate(Exchange oldExchange,
Exchange newExchange) {
Exchange copy = newExchange.copy();
Message newIn = copy.getIn();
String oldBody =
oldExchange.getIn().getBody(String.class);
String newBody = newIn.getBody(String.class);
newIn.setBody(oldBody + "\n" + newBody);
return copy;
}
}).
completedPredicate(header("org.apache.camel.Exchange.AggregatedCount").isEqualTo(3))
.to("jbi:endpoint:http:/tel.de/booking/clientProviderService/clientProviderEndpoint");
2008/10/30 Gert Vanthienen <[EMAIL PROTECTED]>:
>
> Tomasz,
>
> Could you describe what you are trying to do? This property should be there
> automatically when you use an aggregator. It is set on the Camel Exchange
> properties. Are you trying to access the property value from within your
> Camel route or from another JBI component?
>
> Regards,
>
> Gert
>
>
> Tomasz Prus wrote:
>>
>> Where can i find
>>
>> Exchange.AGGREGATED_COUNT
>>
>> because i found it in many examples?
>>
>> from("jms:queue:bankReplyQueue")
>> .aggregator(header(Constants.PROPERTY_SSN), new
>> BankResponseAggregationStrategy())
>> .completedPredicate(header(Exchange.AGGREGATED_COUNT).isEqualTo(3))
>>
>>
>>
>> I try use aggregator but i can't get it working.
>>
>> Is it actual and working? :
>>
>> https://svn.apache.org/repos/asf/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BodyInAggregatingStrategy.java
>>
>> or
>>
>> http://activemq.apache.org/camel/loan-broker-example.html
>>
>>
>
>
> -----
> ---
> Gert Vanthienen
> http://gertvanthienen.blogspot.com
> --
> View this message in context:
> http://www.nabble.com/Exchange.AGGREGATED_COUNT-tp20246960p20255586.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>