This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets-examples.git


The following commit(s) were added to refs/heads/main by this push:
     new 49211b4  We can use package names in embedded Java classes now
49211b4 is described below

commit 49211b478b0bdbd643fdeb9bee3aae3cefc77f33
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Thu Dec 15 19:10:17 2022 +0100

    We can use package names in embedded Java classes now
---
 jbang/camelk-bean/echo.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/jbang/camelk-bean/echo.yaml b/jbang/camelk-bean/echo.yaml
index db4ae49..ef35c72 100644
--- a/jbang/camelk-bean/echo.yaml
+++ b/jbang/camelk-bean/echo.yaml
@@ -5,11 +5,13 @@ metadata:
 spec:
   sources:
     - content: |
-       // using package names is not supported so the class is in root package
+       // package name is optional, but include in this example
+       package com.foo;
+
        @org.apache.camel.BindToRegistry("echo")
        public class MyEchoBean {
          public String echo(String body) {
-             return body + " " + body + "!";
+             return body + " " + body + "! from " + this.getClass().getName();
          }
        }
       name: MyEchoBean.java

Reply via email to