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

Enable vararg support for beaninvocation with Simple

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 2.11.1
    • None
    • camel-core
    • Unknown

    Description

      Having a simple bean method that accepts multiple String parameters declared as varargs, I'm having issues sending values from .bean(MyBean.class, "${ foo('a','b') }") or .bean(MyBean.class, "${ foo(new String[]

      {'a', 'b'}

      ) }") to my bean directly. The error states that it can't convert from String to String[] - but even with declaring a String[] (like the second bean invocation) it is not able to execute the bean.

      The bean class simply looks like this:
      public MyBean
      {
      public void foo(String ... param)

      { // do some stuff ... }

      }

      I'd need to specify multiple parameters and to avoid creating multiple classes or methods which are simply copy&paste classes with small adaptions (inheritance is in place) I'd love to have a more generic approach in place. If resource intensive calculations are done in the back running the method multiple times with changed parameters may not be the best solution imho.

      Attachments

        1. BeanCallTest.java
          8 kB
          Jan Materne

        Activity

          People

            davsclaus Claus Ibsen
            RovoMe Roman Vottner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: