You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/11/04 14:07:51 UTC

[GitHub] [camel-karavan] mgubaidullin opened a new issue, #514: Generate Processor code template from Processor step in UI

mgubaidullin opened a new issue, #514:
URL: https://github.com/apache/camel-karavan/issues/514

   import org.apache.camel.Exchange;
   import org.apache.camel.Processor;
   
   import javax.inject.Named;
   import javax.inject.Singleton;
   
   @Singleton @Named("CustomProcessor")
   public class CustomProcessor implements Processor {
   
     public void process(Exchange exchange) throws Exception {
         exchange.getIn().setBody("Hello world");
     }
   }
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-karavan] mgubaidullin closed issue #514: Generate Processor code template from Processor step in UI

Posted by GitBox <gi...@apache.org>.
mgubaidullin closed issue #514: Generate Processor code template from Processor step in UI
URL: https://github.com/apache/camel-karavan/issues/514


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-karavan] mrinalsharma commented on issue #514: Generate Processor code template from Processor step in UI

Posted by GitBox <gi...@apache.org>.
mrinalsharma commented on issue #514:
URL: https://github.com/apache/camel-karavan/issues/514#issuecomment-1304343409

   I think adding a converter template code from "Convert Body To" will also be useful. How do you plan to do it?
   ```
   
   import java.util.Arrays;
   import java.io.InputStream;
   import java.util.LinkedList;
   import java.io.ByteArrayInputStream;
   
   @Converter
   public class Exampleconverter {
        @Converter
       public static InputStream toInputStream(LinkedList elements) {
   		String [] stringArray = new String[elements.size()];
   		     for(int i =0; i < elements.size(); i++) {
   				stringArray[i] = (String) elements.get(i);
   			 }
           return new ByteArrayInputStream(Arrays.toString(stringArray).getBytes());
       }
   
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org