Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18615

Using CSVDataformat in a Route Template

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.18.2
    • 3.20.0
    • None
    • None
    • Camel version: 3.18.2

      JDK: 11 (Temurin)

    • Unknown

    Description

      I have a rout template like this:

      @Override
      public void configure() throws Exception {         
      
               CsvDataFormat csv = new CsvDataFormat();
               csv.setDelimiter(new Character(','));
               csv.setUseMaps(true);         
      
              routeTemplate("csv-action")
                       .templateParameter("in")
                       .templateParameter("out")
                       .from("{{in}}")
                           .unmarshal(csv)
                           .to("{{out}}");
          }
       

      I would like to make the CsvDataFormat parameterized. For example, to set the delimiteter. In this case it's outside the routeTemplate (and when it's in it's not interpolated).

      Would be nice to set it like CsvDataFormat options something like this:

      @Override public void configure() throws Exception {         
      
      routeTemplate("csv-action")
              .templateParameter("in")
              .templateParameter("out")
              .templateParameter("delimiter",",")
              .templateParameter("map","true")
              .from("{{in}}")
                .unmarshal().csv().setDelimiter("{{delimiter}}").setUseMaps("map");
                .to("{{out}}");
      
      } 

       

      Attachments

        Issue Links

          Activity

            People

              nfilotto Nicolas Filotto
              skin27 Raymond
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: