FAQ
DSL how to set aggregationStrategy on a choise() when() ?


     I have looked at littel on this problem, but cant figure out how to do
it...



     This dosent work, but how ? this fails with syntax error: The method
aggregationStrategy(HubAggregationStrategy) is undefined for the type
ChoiceDefinition


      from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
       .bean(AddIpBean.class)
       .bean(SetRoutingKey.class)
       .bean(Util.class, "setMiljo")
       .multicast()
       .choice()
       .when(header(HubConstants.MILJO.getValue()).contains("U"))
       .to("direct:channel1", "direct:channel2","direct:channel3")
       .otherwise()
        .to("direct:channel1", "direct:channel2","direct:channel3")
        .aggregationStrategy(new HubAggregationStrategy());


       This works:

  from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
       .bean(AddIpBean.class)
       .bean(SetRoutingKey.class)
       .bean(Util.class, "setMiljo")
       .multicast()
       .to("direct:channel1", "direct:channel2","direct:channel3")
       .aggregationStrategy(new HubAggregationStrategy());

Frank



--
View this message in context: http://camel.465427.n5.nabble.com/DSL-how-to-set-aggregationStrategy-on-a-choise-when-tp5754946.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Elvio Caruana (ecaruana) at Aug 8, 2014 at 3:29 pm
    Try .endChoice() before the aggregation?

    -----Original Message-----
    From: Frankiboy
    Sent: 08 August 2014 14:14
    To: users@camel.apache.org
    Subject: DSL how to set aggregationStrategy on a choise() when() ?

    DSL how to set aggregationStrategy on a choise() when() ?


         I have looked at littel on this problem, but cant figure out how to do it...



         This dosent work, but how ? this fails with syntax error: The method
    aggregationStrategy(HubAggregationStrategy) is undefined for the type ChoiceDefinition


          from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
           .bean(AddIpBean.class)
           .bean(SetRoutingKey.class)
           .bean(Util.class, "setMiljo")
           .multicast()
           .choice()
           .when(header(HubConstants.MILJO.getValue()).contains("U"))
           .to("direct:channel1", "direct:channel2","direct:channel3")
           .otherwise()
            .to("direct:channel1", "direct:channel2","direct:channel3")
            .aggregationStrategy(new HubAggregationStrategy());


           This works:

      from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
           .bean(AddIpBean.class)
           .bean(SetRoutingKey.class)
           .bean(Util.class, "setMiljo")
           .multicast()
           .to("direct:channel1", "direct:channel2","direct:channel3")
           .aggregationStrategy(new HubAggregationStrategy());

    Frank



    --
    View this message in context: http://camel.465427.n5.nabble.com/DSL-how-to-set-aggregationStrategy-on-a-choise-when-tp5754946.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Elvio Caruana (ecaruana) at Aug 8, 2014 at 3:31 pm
    Re-reading your route, I think the multicast needs to go into the choice blocks, rather than outside the choice. But then you still have the same number of multicast routes. What are you trying to achieve?

    Elvio

    -----Original Message-----
    From: Elvio Caruana (ecaruana)
    Sent: 08 August 2014 15:29
    To: users@camel.apache.org
    Subject: RE: DSL how to set aggregationStrategy on a choise() when() ?

    Try .endChoice() before the aggregation?

    -----Original Message-----
    From: Frankiboy
    Sent: 08 August 2014 14:14
    To: users@camel.apache.org
    Subject: DSL how to set aggregationStrategy on a choise() when() ?

    DSL how to set aggregationStrategy on a choise() when() ?


         I have looked at littel on this problem, but cant figure out how to do it...



         This dosent work, but how ? this fails with syntax error: The method
    aggregationStrategy(HubAggregationStrategy) is undefined for the type ChoiceDefinition


          from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
           .bean(AddIpBean.class)
           .bean(SetRoutingKey.class)
           .bean(Util.class, "setMiljo")
           .multicast()
           .choice()
           .when(header(HubConstants.MILJO.getValue()).contains("U"))
           .to("direct:channel1", "direct:channel2","direct:channel3")
           .otherwise()
            .to("direct:channel1", "direct:channel2","direct:channel3")
            .aggregationStrategy(new HubAggregationStrategy());


           This works:

      from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
           .bean(AddIpBean.class)
           .bean(SetRoutingKey.class)
           .bean(Util.class, "setMiljo")
           .multicast()
           .to("direct:channel1", "direct:channel2","direct:channel3")
           .aggregationStrategy(new HubAggregationStrategy());

    Frank



    --
    View this message in context: http://camel.465427.n5.nabble.com/DSL-how-to-set-aggregationStrategy-on-a-choise-when-tp5754946.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedAug 8, '14 at 2:09p
activeAug 8, '14 at 3:31p
posts3
users2
websitecamel.apache.org

People

Translate

site design / logo © 2022 Grokbase