Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-993 NPE in TraceFormatter
  3. CAMEL-393

BatchProcessor always consumes directly from endpoint ignoring previous steps

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0, 2.0-M1
    • Component/s: camel-core
    • Labels:
      None

      Description

      Aggregator when created connects itself directly to the endpoint it 'originates' - not to the last step of processing so in such case

      from("seda:header").setHeader("visited", constant(true)).aggregator(header("cheese")).to("mock:result");
      

      at mock:result visited header is not set and in fact there are two different routes created that start from seda:header: one directly to aggregator, and the second one to setHeader().

      In case of direct endpoint everything works because direct component invokes flows one-by-one so it will set the header, and then aggregate, but with seda it doesn't work.

      Lets look at the test I added to AggregatorTest class to see the problem (_testAggregatorNotAtStart()). This test doesn't pass so far and I was unable to fix it, because I'm not good enough in DSL code. maybe someone could handle this.
      Another solution is to let to specify aggregator in RouteType so it could be used only just after from().

        Activity

        Hide
        njiang Willem Jiang added a comment -

        Enabled the test by introducing a direct endpoint before the BatchProcessor.

        Show
        njiang Willem Jiang added a comment - Enabled the test by introducing a direct endpoint before the BatchProcessor.
        Hide
        romkal Roman Kalukiewicz added a comment -

        Hello Willem!

        I see that you enabled the test and it passes by introducing another direct endpoint.

        The problem is that it should pass (In my opinion) without introducing this new endpoint in the exact form it was previously.

        Show
        romkal Roman Kalukiewicz added a comment - Hello Willem! I see that you enabled the test and it passes by introducing another direct endpoint. The problem is that it should pass (In my opinion) without introducing this new endpoint in the exact form it was previously.
        Hide
        hadrian Hadrian Zbarcea added a comment -

        This is a bit messy... I may have to move it to 2.0.

        Show
        hadrian Hadrian Zbarcea added a comment - This is a bit messy... I may have to move it to 2.0.
        Hide
        davsclaus Claus Ibsen added a comment -

        yes it actually is, I discovered this too when I was looking into the aggregator.

        Great that you pick up the glove and we should get it sorted in camel 2.0.

        Show
        davsclaus Claus Ibsen added a comment - yes it actually is, I discovered this too when I was looking into the aggregator. Great that you pick up the glove and we should get it sorted in camel 2.0.
        Hide
        davsclaus Claus Ibsen added a comment -

        Maybe we should write something to the release notes of 1.5 in the known issues section?

        Show
        davsclaus Claus Ibsen added a comment - Maybe we should write something to the release notes of 1.5 in the known issues section?
        Hide
        davsclaus Claus Ibsen added a comment -

        A patch to throw an exception if the route is configured wrong so end-users get this exception and can fix it

        Later we can get it fixed properly (if possible without to much hazzle)

        Show
        davsclaus Claus Ibsen added a comment - A patch to throw an exception if the route is configured wrong so end-users get this exception and can fix it Later we can get it fixed properly (if possible without to much hazzle)
        Hide
        davsclaus Claus Ibsen added a comment -

        I commited the patch that throws an exception if the route is not configued properly.

        Show
        davsclaus Claus Ibsen added a comment - I commited the patch that throws an exception if the route is not configued properly.
        Hide
        mrt1nz Martin Krasser added a comment -

        A patch for this is attached to CAMEL-1037

        Show
        mrt1nz Martin Krasser added a comment - A patch for this is attached to CAMEL-1037
        Hide
        davsclaus Claus Ibsen added a comment -

        This is fixed by Martin's patch

        Show
        davsclaus Claus Ibsen added a comment - This is fixed by Martin's patch
        Hide
        davsclaus Claus Ibsen added a comment -

        Closing 2.0m1 tickets

        Show
        davsclaus Claus Ibsen added a comment - Closing 2.0m1 tickets

          People

          • Assignee:
            hadrian Hadrian Zbarcea
            Reporter:
            romkal Roman Kalukiewicz
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development