Search code examples
apache-camelmigrationapache-camel-3

How to fix several input per route in Camel 3.X.X?


I have a route that looks like this:

from(URL_A)
  .from(URL_B)
  .to(URL_C)
  .process(...)
  // logging
  .to(URL_D)

This route works perfectly in Camel 2.X.X but not in 3.7.X

The error message I get:

Only one input is allowed per route. Cannot accept input: From[direct:ABCD]

I checked the migration guide, but I cannot get how to migrate this sort of route.

Do you have any idea how to tackle it further?


Solution

  • I think you can use direct component: https://camel.apache.org/components/3.4.x/direct-component.html

    For example:

    from(URL_A)
      .to(direct:collector)
    from(URL_B)
      .to(direct:collector)
      
    from(direct:collector)
      .to(URL_C)
      .process(...)
      // logging
      .to(URL_D)