[PR] fix#1087-fix for icon issue when dsl modal is open [camel-karavan]

2024-02-03 Thread via GitHub


vidhyasagarj opened a new pull request, #1100:
URL: https://github.com/apache/camel-karavan/pull/1100

   Issue fix for #1087 


-- 
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-unsubscr...@camel.apache.org

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



[PR] fix#947- Eip filter buttons included in knowledgebase [camel-karavan]

2024-02-03 Thread via GitHub


vidhyasagarj opened a new pull request, #1099:
URL: https://github.com/apache/camel-karavan/pull/1099

   (no comment)


-- 
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-unsubscr...@camel.apache.org

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



Re: [I] [CI] - Quarkus Main Branch Build Failure [camel-quarkus]

2024-02-03 Thread via GitHub


github-actions[bot] closed issue #2926: [CI] - Quarkus Main Branch Build Failure
URL: https://github.com/apache/camel-quarkus/issues/2926


-- 
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-unsubscr...@camel.apache.org

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



Re: [I] [CI] - Quarkus Main Branch Build Failure [camel-quarkus]

2024-02-03 Thread via GitHub


github-actions[bot] commented on issue #2926:
URL: https://github.com/apache/camel-quarkus/issues/2926#issuecomment-1925571500

   Build fixed with:
   
   * Camel Quarkus Commit: d8a711e007f1faa6f9fce4a94648c8125e7435b7
   
   * Quarkus Main Commit: 212e996be9b49dfaac451d76d7a2b5421178f22c
   * Link to build: 
https://github.com/apache/camel-quarkus/actions/runs/7771004296


-- 
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-unsubscr...@camel.apache.org

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



[I] camel-quarkus-jackson-avro - Cannot use FormatSchema of type com.fasterxml.jackson.dataformat.avro.AvroSchema for format JSON [camel-quarkus]

2024-02-03 Thread via GitHub


MateusLopesDev opened a new issue, #5717:
URL: https://github.com/apache/camel-quarkus/issues/5717

   ### Bug description
   
   These days I suffered from an error described as:
   ```
   com.fasterxml.jackson.core.JsonParseException: No AvroSchema set, can not 
parse at 
com.fasterxml.jackson.dataformat.avro.deser.MissingReader._checkSchemaSet(MissingReader.java:68)
   ```
   
   This error, along with the lack of examples of how to apply 
serialization/deserialization with camel quarkus avro in the java DSL format, 
made me try to create a ZulipChat topic to find some guidance on the problem: 
[how to marshall/unmarshall AVRO 
format](https://camel.zulipchat.com/#narrow/stream/257302-camel-quarkus/topic/how.20to.20marshal.2Funmarshal.20avro.20format)
   
   With support from **James Netherton** and his example 
[repository](https://github.com/apache/camel-quarkus/blob/main/integration-tests/jackson-avro/src/main/java/org/apache/camel/quarkus/component/jackson/avro/it/JacksonAvroResource.java#L96-L99),
 I adjusted the code like this:
   
   - A RouteBuilder for building REST:
   
   ```
   @ApplicationScoped
   public class EndpointRest extends RouteBuilder {
   
   @Override
   public void configure() throws Exception {
   
   super.configure();
   
   restConfiguration()
   .bindingMode(RestBindingMode.off)
   .skipBindingOnErrorCode(false)
   .component("platform-http")
   .dataFormatProperty("prettyPrint", "true")
   .contextPath("/").port(8080)
   .apiContextPath("/q/openapi")
   .apiProperty("api.title", "{{openApi.apiTitle}}")
   .apiProperty("api.description", "{{openApi.apiDescription}}")
   .dataFormatProperty("json.in.disableFeatures", 
"FAIL_ON_UNKNOWN_PROPERTIES")
   .apiProperty("api.version", "0.0.1")
   .apiProperty("cors", "true");
   rest("/cargo")
   .tag("cargo")
   .produces(MediaType.APPLICATION_JSON)
   .consumes(MediaType.APPLICATION_JSON)
   .post()
   .route()
   .process(tempoTracingRota)
   .routeId("recebeCargoPost")
   .setHeader(UtilConstante.EVENT, constant("Recebe 
solicitação"))
   .process(loggingProcessor)
   .to(Route.RECEBE)
   .end()
   .endRest();
   }
   }
   ```
   
   - A RouteBuilder for building Camel Routes:
   ```
   public class Route extends RouteBuilder {
   
   public static final String RECEBE = "direct:receive-message";
   
   @Override
   public void configure() throws Exception {
   
   from(RECEIVE)
.routeId("receive-id")
.log("Body before ${body}")
.unmarshal().json(JsonLibrary.Jackson, MensagemEntrada.class)
   // .convertBodyTo(InputStream.class)
.log("Body convert ${body}")
   // .marshal().json(JsonLibrary.Jackson, MensagemEntrada.class)
.marshal().avro(
AvroLibrary.Jackson,
InputMessage.class,
"serializeSchema"
)
.log("Body after ${body}")
;
   }
   }
   ```
   
   - A Utility Class to be used as a CDI bean:
   ```
   public class AvroMarshalUnmarshal {
   
private final AvroMapper MAPPER = AvroMapper.builder().build();
   
@Named
private SchemaResolver serializeSchema() throws IOException {
AvroSchemaGenerator gen = new AvroSchemaGenerator();
MAPPER.acceptJsonFormatVisitor(MensagemEntrada.class, gen);
AvroSchema schema = gen.getGeneratedSchema();
   
return ex -> schema;
}
   }
   ```
   
   Thus, managing to resolve the previous error, but starting to suffer another 
error:
   ```
   java.lang.IllegalArgumentException: Cannot use FormatSchema of type 
com.fasterxml.jackson.dataformat.avro.AvroSchema for format JSON
   ```
   
   And as described in the topic, I tried to use some approaches both from this 
repository that was given as an example, and others found in searches I did on 
the internet, but nothing resolved this specific error. Occurring both trying 
to marshall/unmarshall the avro format, and also trying to marshall/unmarshall 
a json (which only worked normally again using the java DSL when commenting out 
the section of the serializeSchema function in the utility class)
   
   So, after that, I started debugging camel flow to better understand what 
could be changed in the code to finally have the expected result, which was 
marshall/unmarshall for the AVRO format.
   
   So, I discovered that using in Camel Route Class
   ```
   .marshal().avro( 
AvroLibrary.Jackson,
InputMessage.class,
"serializeSchema"
   )
   ```
   The camel in the class `package 

Re: [I] [CI] - Camel Main Branch Build Failure [camel-quarkus]

2024-02-03 Thread via GitHub


github-actions[bot] commented on issue #2927:
URL: https://github.com/apache/camel-quarkus/issues/2927#issuecomment-1925502805

   The [camel-main](https://github.com/apache/camel-quarkus/tree/camel-main) 
branch build has failed:
   
   * Build ID: 7770272039-1278-d171e83d-891d-404e-b00c-bee214720c02
   * Camel Quarkus Commit: c4325b80aea7898a1e829ceb042c14bdaeff5209
   
   * Camel Main Commit: 212e996be9b49dfaac451d76d7a2b5421178f22c
   * Link to build: 
https://github.com/apache/camel-quarkus/actions/runs/7770272039


-- 
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-unsubscr...@camel.apache.org

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



[PR] [Github Actions] Periodic Sync Camel Spring Boot (Camel 4) [camel-spring-boot]

2024-02-03 Thread via GitHub


github-actions[bot] opened a new pull request, #1080:
URL: https://github.com/apache/camel-spring-boot/pull/1080

   Periodic Sync of Camel Spring Boot Main Branch with main Camel Main.
   see 
https://github.com/apache/camel-spring-boot/blob/main/.github/workflows/automatic-sync-main.yml


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]

2024-02-03 Thread via GitHub


github-actions[bot] commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925414997

   :robot: The Apache Camel test robot will run the tests for you :+1:


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]

2024-02-03 Thread via GitHub


kulagaIA commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925414910

   /component-test camel-jolokia


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] Lang5 [camel]

2024-02-03 Thread via GitHub


github-actions[bot] commented on PR #12986:
URL: https://github.com/apache/camel/pull/12986#issuecomment-1925365330

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :robot: CI automation will test this PR automatically.
   
   :camel: Apache Camel Committers, please review the following items:
   
   * First-time contributors **require MANUAL approval** for the GitHub Actions 
to run
   
   * You can use the command `/component-test (camel-)component-name1 
(camel-)component-name2..` to request a test from the test bot.
   
   * You can label PRs using `build-all`, `build-dependents`, `skip-tests` and 
`test-dependents` to fine-tune the checks executed by this PR.
   
   * Build and test logs are available in the Summary page. **Only** [Apache 
Camel committers](https://camel.apache.org/community/team/#committers) have 
access to the summary. 
   
   * :warning: Be careful when sharing logs. Review their contents before 
sharing them publicly.


-- 
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-unsubscr...@camel.apache.org

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



[PR] Lang5 [camel]

2024-02-03 Thread via GitHub


davsclaus opened a new pull request, #12986:
URL: https://github.com/apache/camel/pull/12986

   # Description
   
   
   
   # Target
   
   - [ ] I checked that the commit is targeting the correct branch (note that 
Camel 3 uses `camel-3.x`, whereas Camel 4 uses the `main` branch)
   
   # Tracking
   - [ ] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   
   
   # Apache Camel coding standards and style
   
   - [ ] I checked that each commit in the pull request has a meaningful 
subject line and body.
   
   
   
   - [ ] I have run `mvn clean install -DskipTests` locally and I have 
committed all auto-generated changes
   
   
   
   


-- 
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-unsubscr...@camel.apache.org

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



(camel) 01/04: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang5
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 2b4582724ffe3c3be04bf4d5e143bd59ddb2e589
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 13:06:53 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../org/apache/camel/language/csimple/CSimpleLanguage.java   |  2 +-
 .../camel/support/SingleInputTypedLanguageSupport.java   |  4 ++--
 .../java/org/apache/camel/support/TypedLanguageSupport.java  | 12 +---
 3 files changed, 4 insertions(+), 14 deletions(-)

diff --git 
a/core/camel-core-languages/src/main/java/org/apache/camel/language/csimple/CSimpleLanguage.java
 
b/core/camel-core-languages/src/main/java/org/apache/camel/language/csimple/CSimpleLanguage.java
index 648974bdc09..0c38af295e0 100644
--- 
a/core/camel-core-languages/src/main/java/org/apache/camel/language/csimple/CSimpleLanguage.java
+++ 
b/core/camel-core-languages/src/main/java/org/apache/camel/language/csimple/CSimpleLanguage.java
@@ -150,7 +150,7 @@ public class CSimpleLanguage extends TypedLanguageSupport 
implements StaticServi
 
 @Override
 public Expression createExpression(String expression, Object[] properties) 
{
-Class resultType = property(Class.class, properties, 0, 
getResultType());
+Class resultType = property(Class.class, properties, 0, null);
 if (Boolean.class == resultType || boolean.class == resultType) {
 // we want it compiled as a predicate
 return (Expression) createPredicate(expression);
diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/SingleInputTypedLanguageSupport.java
 
b/core/camel-support/src/main/java/org/apache/camel/support/SingleInputTypedLanguageSupport.java
index c57f2055344..caf18859500 100644
--- 
a/core/camel-support/src/main/java/org/apache/camel/support/SingleInputTypedLanguageSupport.java
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/SingleInputTypedLanguageSupport.java
@@ -39,7 +39,7 @@ public abstract class SingleInputTypedLanguageSupport extends 
TypedLanguageSuppo
 
 @Override
 public Expression createExpression(String expression, Object[] properties) 
{
-Class type = property(Class.class, properties, 0, getResultType());
+Class type = property(Class.class, properties, 0, null);
 String variable = property(String.class, properties, 1, null);
 String header = property(String.class, properties, 2, null);
 String property = property(String.class, properties, 3, null);
@@ -52,7 +52,7 @@ public abstract class SingleInputTypedLanguageSupport extends 
TypedLanguageSuppo
 
 @Override
 public Predicate createPredicate(String expression, Object[] properties) {
-Class type = property(Class.class, properties, 0, getResultType());
+Class type = property(Class.class, properties, 0, null);
 String variable = property(String.class, properties, 1, null);
 String header = property(String.class, properties, 2, null);
 String property = property(String.class, properties, 3, null);
diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/TypedLanguageSupport.java
 
b/core/camel-support/src/main/java/org/apache/camel/support/TypedLanguageSupport.java
index 921f1d1c5b7..5bd2b4bbe92 100644
--- 
a/core/camel-support/src/main/java/org/apache/camel/support/TypedLanguageSupport.java
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/TypedLanguageSupport.java
@@ -25,19 +25,9 @@ import org.apache.camel.support.builder.ExpressionBuilder;
  */
 public abstract class TypedLanguageSupport extends LanguageSupport {
 
-private Class resultType;
-
-public Class getResultType() {
-return resultType;
-}
-
-public void setResultType(Class resultType) {
-this.resultType = resultType;
-}
-
 @Override
 public Expression createExpression(String expression, Object[] properties) 
{
-Class type = property(Class.class, properties, 0, getResultType());
+Class type = property(Class.class, properties, 0, null);
 if (type == null || type == Object.class) {
 return createExpression(expression);
 }



(camel) 02/04: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang5
in repository https://gitbox.apache.org/repos/asf/camel.git

commit e8762a5fff1cf69e6a10a39a6118a48a05d9f42e
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 14:07:42 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../apache/camel/language/bean/BeanLanguage.java   | 18 +++--
 .../language/datasonnet/DatasonnetLanguage.java| 23 ++
 .../apache/camel/language/joor/JavaLanguage.java   |  4 ++--
 .../org/apache/camel/language/jq/JqLanguage.java   |  2 +-
 .../apache/camel/jsonpath/JsonPathLanguage.java|  6 +-
 .../camel/component/language/LanguageEndpoint.java | 12 ---
 .../camel/language/xquery/XQueryLanguage.java  |  6 +-
 .../apache/camel/language/wasm/WasmLanguage.java   |  6 +-
 .../apache/camel/language/xpath/XPathLanguage.java | 14 +
 .../reifier/language/JavaExpressionReifier.java|  4 ++--
 .../reifier/language/JoorExpressionReifier.java|  4 ++--
 .../language/MethodCallExpressionReifier.java  | 14 ++---
 12 files changed, 40 insertions(+), 73 deletions(-)

diff --git 
a/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java
 
b/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java
index 785dddb5204..2939f1e8b13 100644
--- 
a/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java
+++ 
b/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java
@@ -86,10 +86,6 @@ public class BeanLanguage extends TypedLanguageSupport 
implements ScriptingLangu
 case "validate":
 setValidate(PropertyConfigurerSupport.property(camelContext, 
Boolean.class, value));
 return true;
-case "resultType":
-case "resulttype":
-setResultType(PropertyConfigurerSupport.property(camelContext, 
Class.class, value));
-return true;
 default:
 return false;
 }
@@ -114,19 +110,19 @@ public class BeanLanguage extends TypedLanguageSupport 
implements ScriptingLangu
 public Expression createExpression(String expression, Object[] properties) 
{
 BeanExpression answer = null;
 
-String method = property(String.class, properties, 1, null);
-Object bean = property(Object.class, properties, 0, null);
+Object bean = property(Object.class, properties, 1, null);
+String method = property(String.class, properties, 2, null);
 if (bean != null) {
 answer = new BeanExpression(bean, method);
 }
 if (answer == null) {
-Class beanType = property(Class.class, properties, 2, null);
+Class beanType = property(Class.class, properties, 3, null);
 if (beanType != null) {
 answer = new BeanExpression(beanType, method);
 }
 }
 if (answer == null) {
-String ref = property(String.class, properties, 3, null);
+String ref = property(String.class, properties, 4, null);
 if (ref != null) {
 answer = new BeanExpression(ref, method);
 }
@@ -137,14 +133,14 @@ public class BeanLanguage extends TypedLanguageSupport 
implements ScriptingLangu
 if (answer == null) {
 throw new IllegalArgumentException("Bean language requires bean, 
beanType, or ref argument");
 }
-Object scope = property(Object.class, properties, 4, null);
+Object scope = property(Object.class, properties, 5, null);
 if (scope instanceof BeanScope) {
 answer.setScope((BeanScope) scope);
 } else if (scope != null) {
 answer.setScope(BeanScope.valueOf(scope.toString()));
 }
-answer.setValidate(property(boolean.class, properties, 5, 
isValidate()));
-answer.setResultType(property(Class.class, properties, 6, 
getResultType()));
+answer.setValidate(property(boolean.class, properties, 6, 
isValidate()));
+answer.setResultType(property(Class.class, properties, 0, null));
 answer.setBeanComponent(beanComponent);
 answer.setParameterMappingStrategy(parameterMappingStrategy);
 answer.setSimple(simple);
diff --git 
a/components/camel-datasonnet/src/main/java/org/apache/camel/language/datasonnet/DatasonnetLanguage.java
 
b/components/camel-datasonnet/src/main/java/org/apache/camel/language/datasonnet/DatasonnetLanguage.java
index 2c53f177adb..b3f5b24187c 100644
--- 
a/components/camel-datasonnet/src/main/java/org/apache/camel/language/datasonnet/DatasonnetLanguage.java
+++ 
b/components/camel-datasonnet/src/main/java/org/apache/camel/language/datasonnet/DatasonnetLanguage.java
@@ -27,19 +27,16 @@ import com.datasonnet.Mapper;
 

(camel) 04/04: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang5
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 37c756562a95d7dc173b46bbb9c3eeb8cf564e28
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 16:49:47 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../org/apache/camel/language/csimple/CSimpleHelper.java   | 10 +-
 .../camel/language/simple/SimpleExpressionBuilder.java | 14 +++---
 .../language/simple/ast/SimpleFunctionExpression.java  | 10 +-
 .../apache/camel/support/builder/ExpressionBuilder.java|  4 ++--
 4 files changed, 19 insertions(+), 19 deletions(-)

diff --git 
a/core/camel-core-languages/src/main/java/org/apache/camel/language/csimple/CSimpleHelper.java
 
b/core/camel-core-languages/src/main/java/org/apache/camel/language/csimple/CSimpleHelper.java
index 4bf6cdd5f09..6d2200a866b 100644
--- 
a/core/camel-core-languages/src/main/java/org/apache/camel/language/csimple/CSimpleHelper.java
+++ 
b/core/camel-core-languages/src/main/java/org/apache/camel/language/csimple/CSimpleHelper.java
@@ -380,11 +380,11 @@ public final class CSimpleHelper {
 }
 }
 
-Object[] properties = new Object[5];
-properties[2] = type;
-properties[3] = ref;
-properties[1] = method;
-properties[4] = scope;
+Object[] properties = new Object[7];
+properties[3] = type;
+properties[4] = ref;
+properties[2] = method;
+properties[5] = scope;
 Expression exp = bean.createExpression(null, properties);
 exp.init(exchange.getContext());
 return exp.evaluate(exchange, Object.class);
diff --git 
a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/SimpleExpressionBuilder.java
 
b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/SimpleExpressionBuilder.java
index 9ec436ae6ec..47fa8d95fb7 100644
--- 
a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/SimpleExpressionBuilder.java
+++ 
b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/SimpleExpressionBuilder.java
@@ -691,7 +691,7 @@ public final class SimpleExpressionBuilder {
 } catch (InvalidPayloadException e) {
 throw 
CamelExecutionException.wrapCamelExecutionException(exchange, e);
 }
-Expression ognlExp = bean.createExpression(null, new Object[] 
{ body, ognl });
+Expression ognlExp = bean.createExpression(null, new Object[] 
{ null, body, ognl });
 ognlExp.init(exchange.getContext());
 return ognlExp.evaluate(exchange, Object.class);
 }
@@ -772,7 +772,7 @@ public final class SimpleExpressionBuilder {
 if (msg != null) {
 // ognl is able to evaluate method name if it contains 
nested functions
 // so we should not eager evaluate ognl as a string
-Expression ognlExp = bean.createExpression(null, new 
Object[] { msg, ognl });
+Expression ognlExp = bean.createExpression(null, new 
Object[] { null, msg, ognl });
 ognlExp.init(exchange.getContext());
 return ognlExp.evaluate(exchange, Object.class);
 } else {
@@ -818,7 +818,7 @@ public final class SimpleExpressionBuilder {
 if (body != null) {
 // ognl is able to evaluate method name if it contains 
nested functions
 // so we should not eager evaluate ognl as a string
-Expression ognlExp = bean.createExpression(null, new 
Object[] { body, ognl });
+Expression ognlExp = bean.createExpression(null, new 
Object[] { null, body, ognl });
 ognlExp.init(exchange.getContext());
 return ognlExp.evaluate(exchange, Object.class);
 } else {
@@ -854,7 +854,7 @@ public final class SimpleExpressionBuilder {
 public Object evaluate(Exchange exchange) {
 // ognl is able to evaluate method name if it contains nested 
functions
 // so we should not eager evaluate ognl as a string
-Expression ognlExp = bean.createExpression(null, new Object[] 
{ exchange, ognl });
+Expression ognlExp = bean.createExpression(null, new Object[] 
{ null, exchange, ognl });
 ognlExp.init(exchange.getContext());
 return ognlExp.evaluate(exchange, Object.class);
 }
@@ -915,7 +915,7 @@ public final class SimpleExpressionBuilder {
 if (body == null) {
 return null;
 }
-Expression ognlExp = bean.createExpression(null, new Object[] 
{ body, ognl });
+

(camel) branch lang5 created (now 37c756562a9)

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch lang5
in repository https://gitbox.apache.org/repos/asf/camel.git


  at 37c756562a9 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.

This branch includes the following new commits:

 new 2b4582724ff CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.
 new e8762a5fff1 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.
 new ca4db0046f4 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.
 new 37c756562a9 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




(camel) 03/04: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang5
in repository https://gitbox.apache.org/repos/asf/camel.git

commit ca4db0046f430517c19cb89c6883cdea802c8fad
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 14:18:00 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
 
b/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
index 0a6126ac729..84d998fa840 100644
--- 
a/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
+++ 
b/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
@@ -1457,7 +1457,7 @@ public abstract class AbstractCamelCatalog {
 }
 return answer;
 } catch (NoSuchMethodException e) {
- // ignore
+// ignore
 }
 if (predicate) {
 instance.getClass().getMethod("createPredicate", 
String.class).invoke(instance, text);



Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]

2024-02-03 Thread via GitHub


davsclaus commented on code in PR #12985:
URL: https://github.com/apache/camel/pull/12985#discussion_r1477063321


##
core/pom.xml:
##
@@ -59,6 +59,7 @@
 camel-cloud
 camel-health
 camel-console
+camel-jolokia

Review Comment:
   jolokia should not be a core module, move this under components



##
core/camel-jolokia/src/main/java/org/apache/camel/impl/jolokia/DefaultJolokiaHttpRequestHandlerFactory.java:
##
@@ -36,17 +37,21 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class JolokiaHttpRequestHandlerSupport extends ServiceSupport 
implements StaticService {
+/**
+ * Default {@link org.apache.camel.console.DevConsoleRegistry}.
+ */
+@DevConsole("jolokia")

Review Comment:
   This is wrong. @DevConsole is only for camel-console type of consoles.
   You need to come up with another annotation such as JdkFactory.
   
   



-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]

2024-02-03 Thread via GitHub


github-actions[bot] commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925306410

   :robot: The Apache Camel test robot will run the tests for you :+1:


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]

2024-02-03 Thread via GitHub


github-actions[bot] commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925306368

   :robot: The Apache Camel test robot will run the tests for you :+1:


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]

2024-02-03 Thread via GitHub


kulagaIA commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925306346

   /component-test camel-jolokia


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]

2024-02-03 Thread via GitHub


kulagaIA commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925306299

   /component-test camel-platform-http-main


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]

2024-02-03 Thread via GitHub


github-actions[bot] commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925306026

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :robot: CI automation will test this PR automatically.
   
   :camel: Apache Camel Committers, please review the following items:
   
   * First-time contributors **require MANUAL approval** for the GitHub Actions 
to run
   
   * You can use the command `/component-test (camel-)component-name1 
(camel-)component-name2..` to request a test from the test bot.
   
   * You can label PRs using `build-all`, `build-dependents`, `skip-tests` and 
`test-dependents` to fine-tune the checks executed by this PR.
   
   * Build and test logs are available in the Summary page. **Only** [Apache 
Camel committers](https://camel.apache.org/community/team/#committers) have 
access to the summary. 
   
   * :warning: Be careful when sharing logs. Review their contents before 
sharing them publicly.


-- 
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-unsubscr...@camel.apache.org

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



[PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]

2024-02-03 Thread via GitHub


kulagaIA opened a new pull request, #12985:
URL: https://github.com/apache/camel/pull/12985

   # Description
   `camel-jolokia` is now a context plugin with `@DevConsole` annotation.
   
   I was not able to generate file 
`core/camel-jolokia/src/generated/resources/META-INF/services/org/apache/camel/dev-console/jolokia`
 with the `camel-package-maven-plugin`. This file was added by hands, and it is 
possible that something is wrong with `camel-jolokia` maven configuration, or 
something is wrong with the plugin (see 
https://camel.zulipchat.com/#narrow/stream/364655-camel-core-dev/topic/how.20to.20add.20context.20plugin
 ).
   
   Also added jolokia to example repo: 
https://github.com/apache/camel-examples/pull/133
   
   # Tracking
   https://issues.apache.org/jira/browse/CAMEL-20361
   


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] CAMEL-20253: camel-jbang - Add support for jolokia 2.x [camel-examples]

2024-02-03 Thread via GitHub


kulagaIA commented on PR #133:
URL: https://github.com/apache/camel-examples/pull/133#issuecomment-1925304605

   wait this needs pr in camel repo to be merged first


-- 
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-unsubscr...@camel.apache.org

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



[PR] CAMEL-20253: camel-jbang - Add support for jolokia 2.x [camel-examples]

2024-02-03 Thread via GitHub


kulagaIA opened a new pull request, #133:
URL: https://github.com/apache/camel-examples/pull/133

   enabled jolokia in platform-http-main


-- 
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-unsubscr...@camel.apache.org

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



(camel) branch regen_bot updated (07adb5d7028 -> 8e8e7c57535)

2024-02-03 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch regen_bot
in repository https://gitbox.apache.org/repos/asf/camel.git


from 07adb5d7028 CAMEL-20387: headers should be case insensitive (#12981)
 add 8e8e7c57535 Lang4 (#12984)

No new revisions were added by this update.

Summary of changes:
 .../apache/camel/catalog/components/xquery.json|  55 
 .../camel/component/hl7/Hl7TerserLanguage.java |  14 +--
 .../org/apache/camel/language/jq/JqExpression.java |  81 +++-
 .../org/apache/camel/language/jq/JqLanguage.java   |  24 +---
 .../jq/JqExpressionFromHeaderOrPropertyTest.java   |  92 --
 .../language/jq/JqExpressionFromHeaderTest.java|  21 +---
 .../language/jq/JqExpressionFromPropertyTest.java  |   6 +-
 .../language/jq/JqSimpleTransformVariableTest.java |   4 +
 .../java/org/apache/camel/jsonpath/JsonPath.java   |  11 +-
 .../JsonPathAnnotationExpressionFactory.java   |  16 ++-
 .../org/apache/camel/jsonpath/JsonPathEngine.java  |  33 ++---
 .../apache/camel/jsonpath/JsonPathExpression.java  |  42 ++-
 .../apache/camel/jsonpath/JsonPathLanguage.java|  47 +++
 .../camel/jsonpath/JsonPathLanguageTest.java   |  14 +--
 .../component/xquery/XQueryEndpointConfigurer.java |   6 +
 .../component/xquery/XQueryEndpointUriFactory.java |   3 +-
 .../org/apache/camel/component/xquery/xquery.json  |  55 
 .../org/apache/camel/component/xquery/XQuery.java  |  11 +-
 .../xquery/XQueryAnnotationExpressionFactory.java  |  16 ++-
 .../camel/component/xquery/XQueryBuilder.java  | 107 
 .../camel/component/xquery/XQueryEndpoint.java |  19 ++-
 .../camel/language/xquery/XQueryLanguage.java  |  48 +--
 .../language/xtokenizer/XMLTokenizeLanguage.java   |   6 +-
 .../org/apache/camel/language/xpath/XPath.java |  13 +-
 .../xpath/XPathAnnotationExpressionFactory.java|  50 ++--
 .../apache/camel/language/xpath/XPathBuilder.java  | 126 ---
 .../apache/camel/language/xpath/XPathLanguage.java |  66 --
 .../org/apache/camel/NoSuchHeaderException.java|  12 +-
 .../org/apache/camel/NoSuchPropertyException.java  |   7 +-
 .../org/apache/camel/NoSuchVariableException.java  |   3 +
 .../camel/catalog/impl/AbstractCamelCatalog.java   |   4 +-
 .../camel/builder/ExpressionClauseSupport.java |  24 ++--
 .../language/JsonPathExpressionReifier.java|  18 +--
 .../reifier/language/XPathExpressionReifier.java   |  29 ++---
 .../reifier/language/XQueryExpressionReifier.java  |   6 +-
 .../org/apache/camel/support/LanguageSupport.java  |  13 +-
 .../camel/support/SingleInputLanguageSupport.java  |  65 --
 .../support/SingleInputTypedLanguageSupport.java   |  75 +--
 .../camel/support/builder/ExpressionBuilder.java   | 140 +
 .../dsl/groovy/GroovyRouteBuilderLoaderTest.groovy |   7 +-
 .../routes-with-languages-configuration.groovy |   7 +-
 41 files changed, 527 insertions(+), 869 deletions(-)
 delete mode 100644 
components/camel-jq/src/test/java/org/apache/camel/language/jq/JqExpressionFromHeaderOrPropertyTest.java
 delete mode 100644 
core/camel-support/src/main/java/org/apache/camel/support/SingleInputLanguageSupport.java



(camel) branch lang4 deleted (was 74d59b7afd7)

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch lang4
in repository https://gitbox.apache.org/repos/asf/camel.git


 was 74d59b7afd7 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



Re: [PR] Lang4 [camel]

2024-02-03 Thread via GitHub


davsclaus merged PR #12984:
URL: https://github.com/apache/camel/pull/12984


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] Lang4 [camel]

2024-02-03 Thread via GitHub


github-actions[bot] commented on PR #12984:
URL: https://github.com/apache/camel/pull/12984#issuecomment-1925295476

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :robot: CI automation will test this PR automatically.
   
   :camel: Apache Camel Committers, please review the following items:
   
   * First-time contributors **require MANUAL approval** for the GitHub Actions 
to run
   
   * You can use the command `/component-test (camel-)component-name1 
(camel-)component-name2..` to request a test from the test bot.
   
   * You can label PRs using `build-all`, `build-dependents`, `skip-tests` and 
`test-dependents` to fine-tune the checks executed by this PR.
   
   * Build and test logs are available in the Summary page. **Only** [Apache 
Camel committers](https://camel.apache.org/community/team/#committers) have 
access to the summary. 
   
   * :warning: Be careful when sharing logs. Review their contents before 
sharing them publicly.


-- 
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-unsubscr...@camel.apache.org

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



[PR] Lang4 [camel]

2024-02-03 Thread via GitHub


davsclaus opened a new pull request, #12984:
URL: https://github.com/apache/camel/pull/12984

   # Description
   
   
   
   # Target
   
   - [ ] I checked that the commit is targeting the correct branch (note that 
Camel 3 uses `camel-3.x`, whereas Camel 4 uses the `main` branch)
   
   # Tracking
   - [ ] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   
   
   # Apache Camel coding standards and style
   
   - [ ] I checked that each commit in the pull request has a meaningful 
subject line and body.
   
   
   
   - [ ] I have run `mvn clean install -DskipTests` locally and I have 
committed all auto-generated changes
   
   
   
   


-- 
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-unsubscr...@camel.apache.org

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



(camel) 03/11: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang4
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 9b6a33703e6ab0f659d80095100c9f137d52673b
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 10:24:59 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../apache/camel/language/xpath/XPathLanguage.java | 19 +---
 .../support/SingleInputTypedLanguageSupport.java   | 34 ++
 2 files changed, 41 insertions(+), 12 deletions(-)

diff --git 
a/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathLanguage.java
 
b/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathLanguage.java
index 028a445b53a..a0e158f5010 100644
--- 
a/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathLanguage.java
+++ 
b/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathLanguage.java
@@ -19,6 +19,7 @@ package org.apache.camel.language.xpath;
 import java.util.Map;
 
 import javax.xml.namespace.QName;
+import javax.xml.xpath.XPathConstants;
 import javax.xml.xpath.XPathFactory;
 
 import org.apache.camel.CamelContext;
@@ -26,7 +27,6 @@ import org.apache.camel.Expression;
 import org.apache.camel.Predicate;
 import org.apache.camel.spi.PropertyConfigurer;
 import org.apache.camel.spi.annotations.Language;
-import org.apache.camel.support.ExpressionToPredicateAdapter;
 import org.apache.camel.support.SingleInputTypedLanguageSupport;
 import org.apache.camel.support.component.PropertyConfigurerSupport;
 
@@ -45,18 +45,13 @@ public class XPathLanguage extends 
SingleInputTypedLanguageSupport implements Pr
 private Boolean preCompile;
 
 @Override
-public Predicate createPredicate(String expression) {
-return 
ExpressionToPredicateAdapter.toPredicate(createExpression(expression));
-}
-
-@Override
-public Expression createExpression(String expression) {
-return createExpression(expression, null);
-}
+public Predicate createPredicate(Expression source, String expression, 
Object[] properties) {
+expression = loadResource(expression);
 
-@Override
-public Predicate createPredicate(String expression, Object[] properties) {
-return 
ExpressionToPredicateAdapter.toPredicate(createExpression(expression, 
properties));
+XPathBuilder builder = XPathBuilder.xpath(expression);
+configureBuilder(builder, properties, source);
+builder.setResultQName(XPathConstants.BOOLEAN); // use boolean for 
predicate mode
+return builder;
 }
 
 @Override
diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/SingleInputTypedLanguageSupport.java
 
b/core/camel-support/src/main/java/org/apache/camel/support/SingleInputTypedLanguageSupport.java
index 19e00a97997..c57f2055344 100644
--- 
a/core/camel-support/src/main/java/org/apache/camel/support/SingleInputTypedLanguageSupport.java
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/SingleInputTypedLanguageSupport.java
@@ -17,14 +17,26 @@
 package org.apache.camel.support;
 
 import org.apache.camel.Expression;
+import org.apache.camel.Predicate;
 import org.apache.camel.spi.Language;
 import org.apache.camel.support.builder.ExpressionBuilder;
+import org.apache.camel.support.builder.PredicateBuilder;
 
 /**
  * Base class for {@link Language} implementations that support a result type 
and different sources of input data.
  */
 public abstract class SingleInputTypedLanguageSupport extends 
TypedLanguageSupport {
 
+@Override
+public Predicate createPredicate(String expression) {
+return createPredicate(expression, null);
+}
+
+@Override
+public Expression createExpression(String expression) {
+return createExpression(expression, null);
+}
+
 @Override
 public Expression createExpression(String expression, Object[] properties) 
{
 Class type = property(Class.class, properties, 0, getResultType());
@@ -38,6 +50,16 @@ public abstract class SingleInputTypedLanguageSupport 
extends TypedLanguageSuppo
 return ExpressionBuilder.convertToExpression(createExpression(source, 
expression, properties), type);
 }
 
+@Override
+public Predicate createPredicate(String expression, Object[] properties) {
+Class type = property(Class.class, properties, 0, getResultType());
+String variable = property(String.class, properties, 1, null);
+String header = property(String.class, properties, 2, null);
+String property = property(String.class, properties, 3, null);
+Expression source = ExpressionBuilder.singleInputExpression(variable, 
header, property);
+return createPredicate(source, expression, properties);
+}
+
 /**
  * Creates an expression based on the input with properties.
  *
@@ -49,4 +71,16 @@ 

(camel) 04/11: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang4
in repository https://gitbox.apache.org/repos/asf/camel.git

commit edc439af1f818aabd2775073a88d6a6b3846a51c
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 11:14:50 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../camel/component/hl7/Hl7TerserLanguage.java |  14 +--
 .../org/apache/camel/language/jq/JqLanguage.java   |  17 
 .../java/org/apache/camel/jsonpath/JsonPath.java   |  11 ++-
 .../JsonPathAnnotationExpressionFactory.java   |  16 ++-
 .../org/apache/camel/jsonpath/JsonPathEngine.java  |  33 ++-
 .../apache/camel/jsonpath/JsonPathExpression.java  |  42 ++--
 .../apache/camel/jsonpath/JsonPathLanguage.java|  47 +++--
 .../camel/jsonpath/JsonPathLanguageTest.java   |  14 +--
 .../component/xquery/XQueryEndpointConfigurer.java |   6 ++
 .../component/xquery/XQueryEndpointUriFactory.java |   3 +-
 .../org/apache/camel/component/xquery/xquery.json  |  55 +--
 .../org/apache/camel/component/xquery/XQuery.java  |  11 ++-
 .../xquery/XQueryAnnotationExpressionFactory.java  |  16 ++-
 .../camel/component/xquery/XQueryBuilder.java  | 107 +
 .../camel/component/xquery/XQueryEndpoint.java |  19 +++-
 .../camel/language/xquery/XQueryLanguage.java  |  48 +
 .../language/JsonPathExpressionReifier.java|  18 ++--
 .../reifier/language/XQueryExpressionReifier.java  |   6 +-
 18 files changed, 171 insertions(+), 312 deletions(-)

diff --git 
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Hl7TerserLanguage.java
 
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Hl7TerserLanguage.java
index bf8048169c3..0732c2e308a 100644
--- 
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Hl7TerserLanguage.java
+++ 
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Hl7TerserLanguage.java
@@ -22,10 +22,8 @@ import ca.uhn.hl7v2.util.Terser;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
-import org.apache.camel.Predicate;
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.support.ExpressionAdapter;
-import org.apache.camel.support.ExpressionToPredicateAdapter;
 import org.apache.camel.support.SingleInputTypedLanguageSupport;
 import org.apache.camel.support.builder.ExpressionBuilder;
 import org.apache.camel.util.ObjectHelper;
@@ -65,17 +63,7 @@ public class Hl7TerserLanguage extends 
SingleInputTypedLanguageSupport {
 }
 
 @Override
-public Predicate createPredicate(String expression) {
-return 
ExpressionToPredicateAdapter.toPredicate(createExpression(expression));
-}
-
-@Override
-public Expression createExpression(String expression) {
-return terser(expression);
-}
-
-@Override
-protected Expression createExpression(Expression source, String 
expression, Object[] properties) {
+public Expression createExpression(Expression source, String expression, 
Object[] properties) {
 return terser(source, expression);
 }
 }
diff --git 
a/components/camel-jq/src/main/java/org/apache/camel/language/jq/JqLanguage.java
 
b/components/camel-jq/src/main/java/org/apache/camel/language/jq/JqLanguage.java
index 027b3684195..9be23525b60 100644
--- 
a/components/camel-jq/src/main/java/org/apache/camel/language/jq/JqLanguage.java
+++ 
b/components/camel-jq/src/main/java/org/apache/camel/language/jq/JqLanguage.java
@@ -19,10 +19,8 @@ package org.apache.camel.language.jq;
 import net.thisptr.jackson.jq.Scope;
 import net.thisptr.jackson.jq.module.loaders.BuiltinModuleLoader;
 import org.apache.camel.Expression;
-import org.apache.camel.Predicate;
 import org.apache.camel.StaticService;
 import org.apache.camel.spi.annotations.Language;
-import org.apache.camel.support.ExpressionToPredicateAdapter;
 import org.apache.camel.support.SingleInputTypedLanguageSupport;
 import org.apache.camel.util.ObjectHelper;
 
@@ -57,21 +55,6 @@ public class JqLanguage extends 
SingleInputTypedLanguageSupport implements Stati
 // noop
 }
 
-@Override
-public Predicate createPredicate(String expression) {
-return 
ExpressionToPredicateAdapter.toPredicate(createExpression(expression));
-}
-
-@Override
-public Expression createExpression(String expression) {
-return createExpression(expression, null);
-}
-
-@Override
-public Predicate createPredicate(String expression, Object[] properties) {
-return 
ExpressionToPredicateAdapter.toPredicate(createExpression(expression, 
properties));
-}
-
 @Override
 public Expression createExpression(Expression source, String expression, 
Object[] properties) {
 JqExpression answer = new JqExpression(Scope.newChildScope(rootScope), 
expression);
diff 

(camel) 09/11: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang4
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 0eb613997b1d529c635b25910b5454df31e20f97
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 12:20:41 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../apache/camel/dsl/groovy/GroovyRouteBuilderLoaderTest.groovy| 7 +--
 .../resources/routes/routes-with-languages-configuration.groovy| 7 +--
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git 
a/dsl/camel-groovy-dsl/camel-groovy-dsl-test/src/test/groovy/org/apache/camel/dsl/groovy/GroovyRouteBuilderLoaderTest.groovy
 
b/dsl/camel-groovy-dsl/camel-groovy-dsl-test/src/test/groovy/org/apache/camel/dsl/groovy/GroovyRouteBuilderLoaderTest.groovy
index 27eddc62a5f..107f1452e18 100644
--- 
a/dsl/camel-groovy-dsl/camel-groovy-dsl-test/src/test/groovy/org/apache/camel/dsl/groovy/GroovyRouteBuilderLoaderTest.groovy
+++ 
b/dsl/camel-groovy-dsl/camel-groovy-dsl-test/src/test/groovy/org/apache/camel/dsl/groovy/GroovyRouteBuilderLoaderTest.groovy
@@ -147,13 +147,8 @@ class GroovyRouteBuilderLoaderTest extends Specification {
 loadRoute('/routes/routes-with-languages-configuration.groovy')
 
 then:
-with(context.resolveLanguage('bean'), BeanLanguage) {
-beanType == String.class
-method == "toUpperCase"
-}
 with(context.resolveLanguage('myBean'), BeanLanguage) {
-beanType == String.class
-method == "toLowerCase"
+(!isValidate());
 }
 }
 
diff --git 
a/dsl/camel-groovy-dsl/camel-groovy-dsl-test/src/test/resources/routes/routes-with-languages-configuration.groovy
 
b/dsl/camel-groovy-dsl/camel-groovy-dsl-test/src/test/resources/routes/routes-with-languages-configuration.groovy
index 707e057bcb7..feeba851b73 100644
--- 
a/dsl/camel-groovy-dsl/camel-groovy-dsl-test/src/test/resources/routes/routes-with-languages-configuration.groovy
+++ 
b/dsl/camel-groovy-dsl/camel-groovy-dsl-test/src/test/resources/routes/routes-with-languages-configuration.groovy
@@ -20,13 +20,8 @@ import org.apache.camel.language.bean.BeanLanguage
 camel {
 
 languages {
-bean {
-beanType = String.class
-method = "toUpperCase"
-}
 myBean(BeanLanguage) {
-beanType = String.class
-method = "toLowerCase"
+validate = false;
 }
 }
 }



(camel) 11/11: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang4
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 74d59b7afd7c75eb5078df2f46d58af318c7c12b
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 12:42:44 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../org/apache/camel/catalog/impl/AbstractCamelCatalog.java |  3 +--
 .../main/java/org/apache/camel/support/LanguageSupport.java | 13 ++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git 
a/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
 
b/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
index acd2447db37..0a6126ac729 100644
--- 
a/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
+++ 
b/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
@@ -1457,9 +1457,8 @@ public abstract class AbstractCamelCatalog {
 }
 return answer;
 } catch (NoSuchMethodException e) {
-// ignore
+ // ignore
 }
-// optional validate
 if (predicate) {
 instance.getClass().getMethod("createPredicate", 
String.class).invoke(instance, text);
 } else {
diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/LanguageSupport.java
 
b/core/camel-support/src/main/java/org/apache/camel/support/LanguageSupport.java
index 5fc48b1fbb9..63a492326cb 100644
--- 
a/core/camel-support/src/main/java/org/apache/camel/support/LanguageSupport.java
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/LanguageSupport.java
@@ -124,7 +124,7 @@ public abstract class LanguageSupport implements Language, 
IsSingleton, CamelCon
 value = defaultValue;
 }
 
-if (value instanceof String) {
+if (camelContext != null && value instanceof String) {
 value = 
getCamelContext().resolvePropertyPlaceholders(value.toString());
 }
 
@@ -133,7 +133,7 @@ public abstract class LanguageSupport implements Language, 
IsSingleton, CamelCon
 if (value instanceof String && String.class != type) {
 String text = value.toString();
 
-if (EndpointHelper.isReferenceParameter(text)) {
+if (camelContext != null && 
EndpointHelper.isReferenceParameter(text)) {
 Object obj;
 // special for a list where we refer to beans which can be 
either a list or a single element
 // so use Object.class as type
@@ -177,7 +177,14 @@ public abstract class LanguageSupport implements Language, 
IsSingleton, CamelCon
+ " as the value is not 
true or false");
 }
 }
-return value == null ? null : 
getCamelContext().getTypeConverter().convertTo(type, value);
+if (value == null) {
+return null;
+}
+if (camelContext != null) {
+return camelContext.getTypeConverter().convertTo(type, value);
+} else {
+return (T) value;
+}
 }
 
 }



(camel) 05/11: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang4
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 82214b545c5cdf051f42b8cf42e0eda20ee5
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 11:59:52 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../jq/JqExpressionFromHeaderOrPropertyTest.java   | 92 --
 .../language/jq/JqExpressionFromHeaderTest.java| 21 +
 .../language/jq/JqExpressionFromPropertyTest.java  |  6 +-
 .../camel/builder/ExpressionClauseSupport.java | 14 ++--
 .../camel/support/builder/ExpressionBuilder.java   |  2 +-
 5 files changed, 12 insertions(+), 123 deletions(-)

diff --git 
a/components/camel-jq/src/test/java/org/apache/camel/language/jq/JqExpressionFromHeaderOrPropertyTest.java
 
b/components/camel-jq/src/test/java/org/apache/camel/language/jq/JqExpressionFromHeaderOrPropertyTest.java
deleted file mode 100644
index dc6fdfcc092..000
--- 
a/components/camel-jq/src/test/java/org/apache/camel/language/jq/JqExpressionFromHeaderOrPropertyTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.language.jq;
-
-import com.fasterxml.jackson.databind.node.TextNode;
-import org.apache.camel.NoSuchHeaderOrPropertyException;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.Test;
-
-public class JqExpressionFromHeaderOrPropertyTest extends JqTestSupport {
-@Override
-protected RouteBuilder createRouteBuilder() {
-return new RouteBuilder() {
-@Override
-public void configure() {
-from("direct:start")
-.doTry()
-.transform().jq(".foo", "Content", "ContentProp")
-.to("mock:result")
-.doCatch(NoSuchHeaderOrPropertyException.class)
-.to("mock:fail");
-
-}
-};
-}
-
-@Test
-public void testExpressionFromProperty() throws Exception {
-getMockEndpoint("mock:result")
-.expectedBodiesReceived(new TextNode("bar"));
-getMockEndpoint("mock:fail")
-.expectedMessageCount(0);
-
-fluentTemplate.to("direct:start")
-.withProcessor(e -> {
-e.getMessage().setHeader("Invalid", node("foo", "baz"));
-e.setProperty("ContentProp", node("foo", "bar"));
-})
-.send();
-
-MockEndpoint.assertIsSatisfied(context);
-}
-
-@Test
-public void testExpressionFromHeader() throws Exception {
-getMockEndpoint("mock:result")
-.expectedBodiesReceived(new TextNode("baz"));
-getMockEndpoint("mock:fail")
-.expectedMessageCount(0);
-
-fluentTemplate.to("direct:start")
-.withProcessor(e -> {
-e.getMessage().setHeader("Content", node("foo", "baz"));
-e.setProperty("ContentProp", node("foo", "bar"));
-})
-.send();
-
-MockEndpoint.assertIsSatisfied(context);
-}
-
-@Test
-public void testExpressionFail() throws Exception {
-getMockEndpoint("mock:result")
-.expectedMessageCount(0);
-getMockEndpoint("mock:fail")
-.expectedMessageCount(1);
-
-fluentTemplate.to("direct:start")
-.withProcessor(e -> {
-e.getMessage().setHeader("Invalid", node("foo", "baz"));
-e.setProperty("Invalid", node("foo", "bar"));
-})
-.send();
-
-MockEndpoint.assertIsSatisfied(context);
-}
-}
diff --git 
a/components/camel-jq/src/test/java/org/apache/camel/language/jq/JqExpressionFromHeaderTest.java
 
b/components/camel-jq/src/test/java/org/apache/camel/language/jq/JqExpressionFromHeaderTest.java
index d13ec9bae97..cd302de09fa 100644
--- 

(camel) 07/11: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang4
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 6a9975950f64960163ca2b31ed7f9c4a29613716
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 12:08:13 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../org/apache/camel/language/xtokenizer/XMLTokenizeLanguage.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/components/camel-stax/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenizeLanguage.java
 
b/components/camel-stax/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenizeLanguage.java
index dca18770abf..73ef1d1fc21 100644
--- 
a/components/camel-stax/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenizeLanguage.java
+++ 
b/components/camel-stax/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenizeLanguage.java
@@ -22,7 +22,7 @@ import org.apache.camel.Expression;
 import org.apache.camel.Predicate;
 import org.apache.camel.spi.annotations.Language;
 import org.apache.camel.support.ExpressionToPredicateAdapter;
-import org.apache.camel.support.SingleInputLanguageSupport;
+import org.apache.camel.support.LanguageSupport;
 import org.apache.camel.support.builder.Namespaces;
 
 /**
@@ -37,7 +37,7 @@ import org.apache.camel.support.builder.Namespaces;
  * 
  */
 @Language("xtokenize")
-public class XMLTokenizeLanguage extends SingleInputLanguageSupport {
+public class XMLTokenizeLanguage extends LanguageSupport {
 
 @Override
 public Predicate createPredicate(String expression) {
@@ -59,7 +59,7 @@ public class XMLTokenizeLanguage extends 
SingleInputLanguageSupport {
 Character mode = property(Character.class, properties, 1, "i");
 
 XMLTokenExpressionIterator answer = new 
XMLTokenExpressionIterator(expression, mode);
-answer.setHeaderName(property(String.class, properties, 0, 
getHeaderName()));
+answer.setHeaderName(property(String.class, properties, 0, null));
 answer.setGroup(property(int.class, properties, 2, 1));
 Object obj = properties[3];
 if (obj != null) {



(camel) branch lang4 created (now 74d59b7afd7)

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch lang4
in repository https://gitbox.apache.org/repos/asf/camel.git


  at 74d59b7afd7 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.

This branch includes the following new commits:

 new 3062656f046 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.
 new 96a4cc832fc CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.
 new 9b6a33703e6 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.
 new edc439af1f8 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.
 new 82214b545c5 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.
 new 404164a6392 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.
 new 6a9975950f6 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.
 new 45d4fc63cf3 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.
 new 0eb613997b1 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.
 new f3bf370e036 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.
 new 74d59b7afd7 CAMEL-20378: Languages should be thread-safe and be 
configured only via properties array, all in the same way.

The 11 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




(camel) 06/11: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang4
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 404164a63928c681148d73a7f9c08743af9af914
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 12:06:24 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../org/apache/camel/builder/ExpressionClauseSupport.java  | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/core/camel-core-model/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java
 
b/core/camel-core-model/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java
index c6be8806cf6..5acd7b97e3e 100644
--- 
a/core/camel-core-model/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java
+++ 
b/core/camel-core-model/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java
@@ -458,9 +458,9 @@ public class ExpressionClauseSupport implements 
ExpressionFactoryAware, Predi
 /**
  * Evaluates http://camel.apache.org/jq.html;>JQ expression
  *
- * @param  text the expression to be evaluated
- * @param  headerName   the name of the header to apply the 
expression to
- * @return  the builder to continue processing the DSL
+ * @param  text   the expression to be evaluated
+ * @param  headerName the name of the header to apply the expression to
+ * @returnthe builder to continue processing the DSL
  */
 public T jq(String text, String headerName) {
 JqExpression exp = new JqExpression(text);
@@ -486,10 +486,10 @@ public class ExpressionClauseSupport implements 
ExpressionFactoryAware, Predi
 /**
  * Evaluates http://camel.apache.org/jq.html;>JQ expression
  *
- * @param  text the expression to be evaluated
- * @param  resultType   the return type expected by the expression
- * @param  headerName   the name of the header or the property to 
apply the expression to
- * @return  the builder to continue processing the DSL
+ * @param  text   the expression to be evaluated
+ * @param  resultType the return type expected by the expression
+ * @param  headerName the name of the header or the property to apply the 
expression to
+ * @returnthe builder to continue processing the DSL
  */
 public T jq(String text, Class resultType, String headerName) {
 JqExpression exp = new JqExpression(text);



(camel) 01/11: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang4
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 3062656f0469ca214dbce7f871922a397d0576e3
Author: Claus Ibsen 
AuthorDate: Fri Feb 2 15:39:30 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../org/apache/camel/language/jq/JqExpression.java | 81 --
 .../org/apache/camel/language/jq/JqLanguage.java   |  7 +-
 .../language/jq/JqSimpleTransformVariableTest.java |  4 ++
 .../camel/support/SingleInputLanguageSupport.java  | 65 -
 .../support/SingleInputTypedLanguageSupport.java   | 49 ++---
 .../camel/support/builder/ExpressionBuilder.java   | 29 +---
 6 files changed, 45 insertions(+), 190 deletions(-)

diff --git 
a/components/camel-jq/src/main/java/org/apache/camel/language/jq/JqExpression.java
 
b/components/camel-jq/src/main/java/org/apache/camel/language/jq/JqExpression.java
index a72cc5f90a3..1c9e3f6b068 100644
--- 
a/components/camel-jq/src/main/java/org/apache/camel/language/jq/JqExpression.java
+++ 
b/components/camel-jq/src/main/java/org/apache/camel/language/jq/JqExpression.java
@@ -29,16 +29,15 @@ import net.thisptr.jackson.jq.Versions;
 import net.thisptr.jackson.jq.exception.JsonQueryException;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
+import org.apache.camel.Expression;
 import org.apache.camel.ExpressionIllegalSyntaxException;
 import org.apache.camel.InvalidPayloadException;
-import org.apache.camel.NoSuchHeaderOrPropertyException;
-import org.apache.camel.NoSuchVariableException;
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.TypeConverter;
 import org.apache.camel.spi.ExpressionResultTypeAware;
-import org.apache.camel.support.ExchangeHelper;
 import org.apache.camel.support.ExpressionAdapter;
 import org.apache.camel.support.MessageHelper;
+import org.apache.camel.support.builder.ExpressionBuilder;
 
 public class JqExpression extends ExpressionAdapter implements 
ExpressionResultTypeAware {
 
@@ -49,10 +48,7 @@ public class JqExpression extends ExpressionAdapter 
implements ExpressionResultT
 private Class resultType;
 private JsonQuery query;
 private TypeConverter typeConverter;
-
-private String variableName;
-private String headerName;
-private String propertyName;
+private Expression source;
 
 public JqExpression(String expression) {
 this(null, expression);
@@ -88,6 +84,9 @@ public class JqExpression extends ExpressionAdapter 
implements ExpressionResultT
 resultType = JsonNode.class;
 }
 }
+if (this.source == null) {
+source = ExpressionBuilder.bodyExpression();
+}
 }
 
 public Scope getScope() {
@@ -120,41 +119,12 @@ public class JqExpression extends ExpressionAdapter 
implements ExpressionResultT
 this.resultTypeName = resultTypeName;
 }
 
-public String getVariableName() {
-return variableName;
-}
-
-/**
- * Name of the variable to use as input instead of the message body.
- */
-public void setVariableName(String variableName) {
-this.variableName = variableName;
-}
-
-public String getHeaderName() {
-return headerName;
-}
-
-/**
- * Name of the header to use as input instead of the message body.
- * 
- * It has higher precedence than the propertyName if both are set.
- */
-public void setHeaderName(String headerName) {
-this.headerName = headerName;
-}
-
-public String getPropertyName() {
-return propertyName;
+public Expression getSource() {
+return source;
 }
 
-/**
- * Name of the property to use as input instead of the message body.
- * 
- * It has lower precedence than the headerName if both are set.
- */
-public void setPropertyName(String propertyName) {
-this.propertyName = propertyName;
+public void setSource(Expression source) {
+this.source = source;
 }
 
 @Override
@@ -218,33 +188,12 @@ public class JqExpression extends ExpressionAdapter 
implements ExpressionResultT
  * @return  the {@link JsonNode} to be processed by the expression
  */
 private JsonNode getPayload(Exchange exchange) throws Exception {
-JsonNode payload = null;
-
-if (variableName == null && headerName == null && propertyName == 
null) {
-payload = exchange.getMessage().getBody(JsonNode.class);
-if (payload == null) {
-throw new InvalidPayloadException(exchange, JsonNode.class);
-}
-// if body is stream cached then reset, so we can re-read it again
-MessageHelper.resetStreamCache(exchange.getMessage());
-} else {
-if (variableName != null) {
-   

(camel) 10/11: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang4
in repository https://gitbox.apache.org/repos/asf/camel.git

commit f3bf370e0362e4ac7bd1dc8bf47affea4dbb2d38
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 12:29:04 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java| 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
 
b/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
index 93ed919158a..acd2447db37 100644
--- 
a/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
+++ 
b/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
@@ -1455,6 +1455,7 @@ public abstract class AbstractCamelCatalog {
 } else {
 instance.getClass().getMethod("validateExpression", 
String.class).invoke(instance, text);
 }
+return answer;
 } catch (NoSuchMethodException e) {
 // ignore
 }



(camel) 08/11: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang4
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 45d4fc63cf389a72f6fdb18bee0d5a2a9ee6c077
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 12:14:02 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../apache/camel/catalog/components/xquery.json| 55 +++---
 1 file changed, 28 insertions(+), 27 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xquery.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xquery.json
index 7f8340f892a..5df5016f9a4 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xquery.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xquery.json
@@ -35,35 +35,36 @@
 "allowStAX": { "index": 1, "kind": "parameter", "displayName": "Allow St 
AX", "group": "common", "label": "", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "autowired": false, "secret": 
false, "defaultValue": false, "description": "Whether to allow using StAX mode" 
},
 "headerName": { "index": 2, "kind": "parameter", "displayName": "Header 
Name", "group": "common", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "description": "To use a Camel Message header as the input 
source instead of Message body." },
 "namespacePrefixes": { "index": 3, "kind": "parameter", "displayName": 
"Namespace Prefixes", "group": "common", "label": "", "required": false, 
"type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, 
"description": "Allows to control which namespace prefixes to use for a set of 
namespace mappings" },
-"propertyName": { "index": 4, "kind": "parameter", "displayName": 
"Property Name", "group": "common", "label": "", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": false, "description": "To use a Camel Exchange property as the 
input source instead of Message body. It has a lower precedent than the name of 
header if both are set." },
+"propertyName": { "index": 4, "kind": "parameter", "displayName": 
"Property Name", "group": "common", "label": "", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": false, "description": "To use a Camel Exchange property as the 
input source instead of Message body." },
 "resultsFormat": { "index": 5, "kind": "parameter", "displayName": 
"Results Format", "group": "common", "label": "", "required": false, "type": 
"object", "javaType": "org.apache.camel.component.xquery.ResultFormat", "enum": 
[ "Bytes", "BytesSource", "DOM", "DOMSource", "List", "String", "StringSource" 
], "deprecated": false, "autowired": false, "secret": false, "defaultValue": 
"DOM", "description": "What output result to use" },
 "resultType": { "index": 6, "kind": "parameter", "displayName": "Result 
Type", "group": "common", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.Class", "deprecated": false, 
"autowired": false, "secret": false, "description": "What output result to use 
defined as a class" },
 "stripsAllWhiteSpace": { "index": 7, "kind": "parameter", "displayName": 
"Strips All White Space", "group": "common", "label": "", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": true, "description": "Whether to strip 
all whitespaces" },
-"sendEmptyMessageWhenIdle": { "index": 8, "kind": "parameter", 
"displayName": "Send Empty Message When Idle", "group": "consumer", "label": 
"consumer", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "description": "If the polling consumer did not poll any files, you can 
enable this option to send an empty message (no body) instead." },
-"bridgeErrorHandler": { "index": 9, "kind": "parameter", "displayName": 
"Bridge Error Handler", "group": "consumer (advanced)", "label": 
"consumer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "Allows for bridging the consumer to the 
Camel routing Error Handler, which mean any exceptions (if possible) occurred 
while the Camel consumer is trying to pickup incoming  [...]
-"exceptionHandler": { "index": 10, "kind": "parameter", "displayName": 
"Exception Handler", "group": "consumer (advanced)", "label": 
"consumer,advanced", "required": 

(camel) 02/11: CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way.

2024-02-03 Thread davsclaus
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch lang4
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 96a4cc832fcfb36786c212b18ea9faaf6c9db796
Author: Claus Ibsen 
AuthorDate: Sat Feb 3 09:59:53 2024 +0100

CAMEL-20378: Languages should be thread-safe and be configured only via 
properties array, all in the same way.
---
 .../org/apache/camel/language/xpath/XPath.java |  13 ++-
 .../xpath/XPathAnnotationExpressionFactory.java|  50 +---
 .../apache/camel/language/xpath/XPathBuilder.java  | 126 -
 .../apache/camel/language/xpath/XPathLanguage.java |  61 --
 .../org/apache/camel/NoSuchHeaderException.java|  12 +-
 .../org/apache/camel/NoSuchPropertyException.java  |   7 +-
 .../org/apache/camel/NoSuchVariableException.java  |   3 +
 .../reifier/language/XPathExpressionReifier.java   |  29 ++---
 .../camel/support/builder/ExpressionBuilder.java   | 111 --
 9 files changed, 220 insertions(+), 192 deletions(-)

diff --git 
a/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPath.java
 
b/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPath.java
index 1235f488ecd..74165579346 100644
--- 
a/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPath.java
+++ 
b/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPath.java
@@ -54,16 +54,17 @@ public @interface XPath {
 Class resultType() default Object.class;
 
 /**
- * The name of the header we want to apply the XPath expression to. If 
this is empty then the XPath expression will
- * be applied to the exchange property or the body instead.
+ * The name of the variable we want to apply the XPath expression to.
+ */
+String variableName() default "";
+
+/**
+ * The name of the message header we want to apply the XPath expression to.
  */
 String headerName() default "";
 
 /**
- * The name of the header we want to apply the XPath expression to. If 
this is empty then the XPath expression will
- * be applied to the body instead.
- * 
- * It has a lower precedent than the name of header if both are set.
+ * The name of the exchange propery we want to apply the XPath expression 
to.
  */
 String propertyName() default "";
 
diff --git 
a/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathAnnotationExpressionFactory.java
 
b/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathAnnotationExpressionFactory.java
index ff69b075d4b..f31bc1a3bc4 100644
--- 
a/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathAnnotationExpressionFactory.java
+++ 
b/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathAnnotationExpressionFactory.java
@@ -20,10 +20,10 @@ import java.lang.annotation.Annotation;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Expression;
+import org.apache.camel.support.builder.ExpressionBuilder;
 import org.apache.camel.support.language.DefaultAnnotationExpressionFactory;
 import org.apache.camel.support.language.LanguageAnnotation;
 import org.apache.camel.support.language.NamespacePrefix;
-import org.apache.camel.util.ObjectHelper;
 
 /**
  * Factory for the XPath expression annotations.
@@ -51,14 +51,12 @@ public class XPathAnnotationExpressionFactory extends 
DefaultAnnotationExpressio
 }
 }
 
-// Set the header name that we want the XPathBuilder to apply the 
XPath expression to
+String variableName = getVariableName(annotation);
 String headerName = getHeaderName(annotation);
-if (ObjectHelper.isNotEmpty(headerName)) {
-builder.setHeaderName(headerName);
-}
 String propertyName = getPropertyName(annotation);
-if (ObjectHelper.isNotEmpty(propertyName)) {
-builder.setPropertyName(propertyName);
+if (variableName != null || headerName != null || propertyName != 
null) {
+Expression source = 
ExpressionBuilder.singleInputExpression(variableName, headerName, propertyName);
+builder.setSource(source);
 }
 
 return builder;
@@ -80,13 +78,16 @@ public class XPathAnnotationExpressionFactory extends 
DefaultAnnotationExpressio
  * expression to. Otherwise, null will be returned
  */
 protected String getHeaderName(Annotation annotation) {
-String headerValue = null;
+String answer = null;
 try {
-headerValue = (String) getAnnotationObjectValue(annotation, 
"headerName");
+answer = (String) getAnnotationObjectValue(annotation, 
"headerName");
 } catch (Exception e) {
 // Do Nothing
 }
-return headerValue;
+if (answer != null && answer.isBlank()) {
+return null;
+}
+return answer;
 }
 

(camel) branch regen_bot updated (a9777d92d83 -> 07adb5d7028)

2024-02-03 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch regen_bot
in repository https://gitbox.apache.org/repos/asf/camel.git


from a9777d92d83 CAMEL-20389: fixed incorrectly named tests on 
camel-google-calendar
 add 07adb5d7028 CAMEL-20387: headers should be case insensitive (#12981)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/camel/tracing/ExtractAdapter.java|  2 +-
 .../propagation/CamelHeadersExtractAdapter.java |  6 +++---
 .../CamelMessagingHeadersExtractAdapter.java|  6 +++---
 .../CamelMessagingHeadersExtractAdapterTest.java| 21 ++---
 4 files changed, 21 insertions(+), 14 deletions(-)



(camel) branch main updated: CAMEL-20387: headers should be case insensitive (#12981)

2024-02-03 Thread davsclaus
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.git


The following commit(s) were added to refs/heads/main by this push:
 new 07adb5d7028 CAMEL-20387: headers should be case insensitive (#12981)
07adb5d7028 is described below

commit 07adb5d7028b5110f7e2a45866a1499d70c54c36
Author: dbregio 
AuthorDate: Sat Feb 3 12:10:17 2024 +0100

CAMEL-20387: headers should be case insensitive (#12981)
---
 .../org/apache/camel/tracing/ExtractAdapter.java|  2 +-
 .../propagation/CamelHeadersExtractAdapter.java |  6 +++---
 .../CamelMessagingHeadersExtractAdapter.java|  6 +++---
 .../CamelMessagingHeadersExtractAdapterTest.java| 21 ++---
 4 files changed, 21 insertions(+), 14 deletions(-)

diff --git 
a/components/camel-tracing/src/main/java/org/apache/camel/tracing/ExtractAdapter.java
 
b/components/camel-tracing/src/main/java/org/apache/camel/tracing/ExtractAdapter.java
index e2ed5bfd385..680a816062f 100644
--- 
a/components/camel-tracing/src/main/java/org/apache/camel/tracing/ExtractAdapter.java
+++ 
b/components/camel-tracing/src/main/java/org/apache/camel/tracing/ExtractAdapter.java
@@ -21,7 +21,7 @@ import java.util.Map;
 import java.util.Set;
 
 public interface ExtractAdapter {
-Iterator> iterator();
+Iterator> iterator();
 
 Object get(String key);
 
diff --git 
a/components/camel-tracing/src/main/java/org/apache/camel/tracing/propagation/CamelHeadersExtractAdapter.java
 
b/components/camel-tracing/src/main/java/org/apache/camel/tracing/propagation/CamelHeadersExtractAdapter.java
index c1be58b31d8..aa824bdb030 100644
--- 
a/components/camel-tracing/src/main/java/org/apache/camel/tracing/propagation/CamelHeadersExtractAdapter.java
+++ 
b/components/camel-tracing/src/main/java/org/apache/camel/tracing/propagation/CamelHeadersExtractAdapter.java
@@ -16,15 +16,15 @@
  */
 package org.apache.camel.tracing.propagation;
 
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
 import org.apache.camel.tracing.ExtractAdapter;
+import org.apache.camel.util.CaseInsensitiveMap;
 
 public final class CamelHeadersExtractAdapter implements ExtractAdapter {
-private final Map map = new HashMap<>();
+private final Map map = new CaseInsensitiveMap();
 
 public CamelHeadersExtractAdapter(final Map map) {
 // Extract string valued map entries
@@ -33,7 +33,7 @@ public final class CamelHeadersExtractAdapter implements 
ExtractAdapter {
 }
 
 @Override
-public Iterator> iterator() {
+public Iterator> iterator() {
 return map.entrySet().iterator();
 }
 
diff --git 
a/components/camel-tracing/src/main/java/org/apache/camel/tracing/propagation/CamelMessagingHeadersExtractAdapter.java
 
b/components/camel-tracing/src/main/java/org/apache/camel/tracing/propagation/CamelMessagingHeadersExtractAdapter.java
index 4765a7cca18..a415cd44ba0 100644
--- 
a/components/camel-tracing/src/main/java/org/apache/camel/tracing/propagation/CamelMessagingHeadersExtractAdapter.java
+++ 
b/components/camel-tracing/src/main/java/org/apache/camel/tracing/propagation/CamelMessagingHeadersExtractAdapter.java
@@ -17,16 +17,16 @@
 package org.apache.camel.tracing.propagation;
 
 import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
 import org.apache.camel.tracing.ExtractAdapter;
+import org.apache.camel.util.CaseInsensitiveMap;
 
 public final class CamelMessagingHeadersExtractAdapter implements 
ExtractAdapter {
 
-private final Map map = new HashMap<>();
+private final Map map = new CaseInsensitiveMap();
 private final boolean jmsEncoding;
 
 public CamelMessagingHeadersExtractAdapter(final Map map, 
boolean jmsEncoding) {
@@ -42,7 +42,7 @@ public final class CamelMessagingHeadersExtractAdapter 
implements ExtractAdapter
 }
 
 @Override
-public Iterator> iterator() {
+public Iterator> iterator() {
 return map.entrySet().iterator();
 }
 
diff --git 
a/components/camel-tracing/src/test/java/org/apache/camel/tracing/propagation/CamelMessagingHeadersExtractAdapterTest.java
 
b/components/camel-tracing/src/test/java/org/apache/camel/tracing/propagation/CamelMessagingHeadersExtractAdapterTest.java
index 7868118d5fb..8cc6ba92ac6 100644
--- 
a/components/camel-tracing/src/test/java/org/apache/camel/tracing/propagation/CamelMessagingHeadersExtractAdapterTest.java
+++ 
b/components/camel-tracing/src/test/java/org/apache/camel/tracing/propagation/CamelMessagingHeadersExtractAdapterTest.java
@@ -39,7 +39,7 @@ public class CamelMessagingHeadersExtractAdapterTest {
 @Test
 public void noProperties() {
 CamelMessagingHeadersExtractAdapter adapter = new 
CamelMessagingHeadersExtractAdapter(map, true);
-Iterator> iterator = adapter.iterator();
+

Re: [PR] CAMEL-20387: tracing-headers should be case insensitive [camel]

2024-02-03 Thread via GitHub


davsclaus merged PR #12981:
URL: https://github.com/apache/camel/pull/12981


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] CAMEL-20387: tracing-headers should be case insensitive [camel]

2024-02-03 Thread via GitHub


davsclaus commented on PR #12981:
URL: https://github.com/apache/camel/pull/12981#issuecomment-1925278264

   /component-test camel-observation camel-opentelemetry


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] CAMEL-20387: tracing-headers should be case insensitive [camel]

2024-02-03 Thread via GitHub


github-actions[bot] commented on PR #12981:
URL: https://github.com/apache/camel/pull/12981#issuecomment-1925278363

   :robot: The Apache Camel test robot will run the tests for you :+1:


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] CAMEL-20389: fix incorrectly named Integration tests [camel]

2024-02-03 Thread via GitHub


orpiske merged PR #12983:
URL: https://github.com/apache/camel/pull/12983


-- 
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-unsubscr...@camel.apache.org

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



(camel) branch main updated (b38966f1d02 -> a9777d92d83)

2024-02-03 Thread orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


from b38966f1d02 CAMEL-20380: fixed incomplete batching on poll timeout
 new d43eea31ba3 CAMEL-20389: fixed incorrectly named tests on 
camel-google-sheets
 new c5e552eb0bc CAMEL-20389: fixed incorrectly named tests on 
camel-google-mail
 new a9777d92d83 CAMEL-20389: fixed incorrectly named tests on 
camel-google-calendar

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ...grationTest.java => GoogleCalendarStreamConsumerIT.java} |  5 -
 ...IntegrationTest.java => GoogleMailStreamConsumerIT.java} |  5 -
 .../camel/component/google/sheets/SheetsSpreadsheetsIT.java | 10 +++---
 .../component/google/sheets/SheetsSpreadsheetsValuesIT.java | 13 +
 ...umerIntegrationTest.java => SheetsStreamConsumerIT.java} |  9 ++---
 5 files changed, 30 insertions(+), 12 deletions(-)
 rename 
components/camel-google/camel-google-calendar/src/test/java/org/apache/camel/component/google/calendar/stream/{GoogleCalendarStreamConsumerIntegrationTest.java
 => GoogleCalendarStreamConsumerIT.java} (82%)
 rename 
components/camel-google/camel-google-mail/src/test/java/org/apache/camel/component/google/mail/stream/{GoogleMailStreamConsumerIntegrationTest.java
 => GoogleMailStreamConsumerIT.java} (82%)
 rename 
components/camel-google/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/stream/{SheetsStreamConsumerIntegrationTest.java
 => SheetsStreamConsumerIT.java} (97%)



(camel) 02/03: CAMEL-20389: fixed incorrectly named tests on camel-google-mail

2024-02-03 Thread orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c5e552eb0bc7b264790d4b1cd3543632d57c95db
Author: Otavio R. Piske 
AuthorDate: Sat Feb 3 09:04:53 2024 +0100

CAMEL-20389: fixed incorrectly named tests on camel-google-mail

Signed-off-by: Otavio R. Piske 
---
 ...mConsumerIntegrationTest.java => GoogleMailStreamConsumerIT.java} | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-google/camel-google-mail/src/test/java/org/apache/camel/component/google/mail/stream/GoogleMailStreamConsumerIntegrationTest.java
 
b/components/camel-google/camel-google-mail/src/test/java/org/apache/camel/component/google/mail/stream/GoogleMailStreamConsumerIT.java
similarity index 82%
rename from 
components/camel-google/camel-google-mail/src/test/java/org/apache/camel/component/google/mail/stream/GoogleMailStreamConsumerIntegrationTest.java
rename to 
components/camel-google/camel-google-mail/src/test/java/org/apache/camel/component/google/mail/stream/GoogleMailStreamConsumerIT.java
index 462af8e0d97..dffc4e8aab8 100644
--- 
a/components/camel-google/camel-google-mail/src/test/java/org/apache/camel/component/google/mail/stream/GoogleMailStreamConsumerIntegrationTest.java
+++ 
b/components/camel-google/camel-google-mail/src/test/java/org/apache/camel/component/google/mail/stream/GoogleMailStreamConsumerIT.java
@@ -19,8 +19,11 @@ package org.apache.camel.component.google.mail.stream;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIf;
 
-public class GoogleMailStreamConsumerIntegrationTest extends 
AbstractGoogleMailStreamTestSupport {
+@EnabledIf(value = 
"org.apache.camel.component.google.mail.AbstractGoogleMailTestSupport#hasCredentials",
+   disabledReason = "Google Mail credentials were not provided")
+public class GoogleMailStreamConsumerIT extends 
AbstractGoogleMailStreamTestSupport {
 
 @Test
 public void testConsumePrefixedMessages() throws Exception {



(camel) branch regen_bot updated (b38966f1d02 -> a9777d92d83)

2024-02-03 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch regen_bot
in repository https://gitbox.apache.org/repos/asf/camel.git


from b38966f1d02 CAMEL-20380: fixed incomplete batching on poll timeout
 add d43eea31ba3 CAMEL-20389: fixed incorrectly named tests on 
camel-google-sheets
 add c5e552eb0bc CAMEL-20389: fixed incorrectly named tests on 
camel-google-mail
 add a9777d92d83 CAMEL-20389: fixed incorrectly named tests on 
camel-google-calendar

No new revisions were added by this update.

Summary of changes:
 ...grationTest.java => GoogleCalendarStreamConsumerIT.java} |  5 -
 ...IntegrationTest.java => GoogleMailStreamConsumerIT.java} |  5 -
 .../camel/component/google/sheets/SheetsSpreadsheetsIT.java | 10 +++---
 .../component/google/sheets/SheetsSpreadsheetsValuesIT.java | 13 +
 ...umerIntegrationTest.java => SheetsStreamConsumerIT.java} |  9 ++---
 5 files changed, 30 insertions(+), 12 deletions(-)
 rename 
components/camel-google/camel-google-calendar/src/test/java/org/apache/camel/component/google/calendar/stream/{GoogleCalendarStreamConsumerIntegrationTest.java
 => GoogleCalendarStreamConsumerIT.java} (82%)
 rename 
components/camel-google/camel-google-mail/src/test/java/org/apache/camel/component/google/mail/stream/{GoogleMailStreamConsumerIntegrationTest.java
 => GoogleMailStreamConsumerIT.java} (82%)
 rename 
components/camel-google/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/stream/{SheetsStreamConsumerIntegrationTest.java
 => SheetsStreamConsumerIT.java} (97%)



(camel) 03/03: CAMEL-20389: fixed incorrectly named tests on camel-google-calendar

2024-02-03 Thread orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a9777d92d8364d0fa13306894f00e1fd6d8152c1
Author: Otavio R. Piske 
AuthorDate: Sat Feb 3 09:06:20 2024 +0100

CAMEL-20389: fixed incorrectly named tests on camel-google-calendar

Signed-off-by: Otavio R. Piske 
---
 ...sumerIntegrationTest.java => GoogleCalendarStreamConsumerIT.java} | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-google/camel-google-calendar/src/test/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamConsumerIntegrationTest.java
 
b/components/camel-google/camel-google-calendar/src/test/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamConsumerIT.java
similarity index 82%
rename from 
components/camel-google/camel-google-calendar/src/test/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamConsumerIntegrationTest.java
rename to 
components/camel-google/camel-google-calendar/src/test/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamConsumerIT.java
index 0c8baabe464..41973a226de 100644
--- 
a/components/camel-google/camel-google-calendar/src/test/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamConsumerIntegrationTest.java
+++ 
b/components/camel-google/camel-google-calendar/src/test/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamConsumerIT.java
@@ -19,8 +19,11 @@ package org.apache.camel.component.google.calendar.stream;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIf;
 
-public class GoogleCalendarStreamConsumerIntegrationTest extends 
AbstractGoogleCalendarStreamTestSupport {
+@EnabledIf(value = 
"org.apache.camel.component.google.calendar.AbstractGoogleCalendarTestSupport#hasCredentials",
+   disabledReason = "Google Calendar credentials were not provided")
+public class GoogleCalendarStreamConsumerIT extends 
AbstractGoogleCalendarStreamTestSupport {
 
 @Test
 public void testConsumePrefixedMessages() throws Exception {



Re: [PR] [Camel 20377] *IT tests should be run with failsafe instead of surefire [camel]

2024-02-03 Thread via GitHub


orpiske commented on code in PR #12966:
URL: https://github.com/apache/camel/pull/12966#discussion_r1475782422


##
pom.xml:
##
@@ -915,5 +925,37 @@
 
 
 
+
+integration-test
+
+
+
+
+
+org.apache.maven.plugins
+maven-failsafe-plugin
+${maven-failsafe-plugin-version}
+
+
+
+integration-test
+verify
+
+
+
+
+false
+
+**/*IT.java
+**/*IntegrationTest.java
+
+
+**/*Test.java
+
+
+
+
+
+

Review Comment:
   I am truly sorry for having missed this, but I would like us to avoid piling 
up the build with profiles that are very rarely used (by ourselves or by our CI 
or by the automation that we have). 
   
   We (myself included) spent a lot of time cleaning up a several profiles that 
existed on Camel 3 but we never used and complicated the build.
   
   For profiles, the less and simpler, the better. And this is specially true 
now that we have to tweak the build so it works flawlessly in different 
architectures (x86, aarch64, s390x, ppc6le).
   
   Lastly, the configuration part is not necessary because [failsafe already 
does (most of) this by 
default](https://maven.apache.org/surefire/maven-failsafe-plugin/examples/inclusion-exclusion.html).
 There ~are~were, indeed, some test cases that are (incorrectly) named 
`*IntegrationTest.java` (in `camel-google` and in `camel-salesforce`), but the 
proper fix here is to rename them to `*IT.java` as we did in the past. 
   
   @davsclaus @oscerd wdyt?
   
   *Update*: there were 5 tests named incorrectly in Camel google. There were 
fixed by #12983.



##
pom.xml:
##
@@ -915,5 +925,37 @@
 
 
 
+
+integration-test
+
+
+
+
+
+org.apache.maven.plugins
+maven-failsafe-plugin
+${maven-failsafe-plugin-version}
+
+
+
+integration-test
+verify
+
+
+
+
+false
+
+**/*IT.java
+**/*IntegrationTest.java
+
+
+**/*Test.java
+
+
+
+
+
+

Review Comment:
   I am truly sorry for having missed this, but I would like us to avoid piling 
up the build with profiles that are very rarely used (by ourselves or by our CI 
or by the automation that we have). 
   
   We (myself included) spent a lot of time cleaning up a several profiles that 
existed on Camel 3 but we never used and complicated the build.
   
   For profiles, the less and simpler, the better. And this is specially true 
now that we have to tweak the build so it works flawlessly in different 
architectures (x86, aarch64, s390x, ppc6le).
   
   Lastly, the configuration part is not necessary because [failsafe already 
does (most of) this by 
default](https://maven.apache.org/surefire/maven-failsafe-plugin/examples/inclusion-exclusion.html).
 There ~are~were, indeed, some test cases that are (incorrectly) named 
`*IntegrationTest.java` (in `camel-google` and in `camel-salesforce`), but the 
proper fix here is to rename them to `*IT.java` as we did in the past. 
   
   @davsclaus @oscerd wdyt?
   
   **Update**: there were 5 tests named incorrectly in Camel google. There were 
fixed by #12983.



-- 
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-unsubscr...@camel.apache.org

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



(camel) 01/03: CAMEL-20389: fixed incorrectly named tests on camel-google-sheets

2024-02-03 Thread orpiske
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit d43eea31ba3c33a505217a012fb02c686800dc20
Author: Otavio R. Piske 
AuthorDate: Sat Feb 3 09:02:47 2024 +0100

CAMEL-20389: fixed incorrectly named tests on camel-google-sheets

Signed-off-by: Otavio R. Piske 
---
 .../camel/component/google/sheets/SheetsSpreadsheetsIT.java | 10 +++---
 .../component/google/sheets/SheetsSpreadsheetsValuesIT.java | 13 +
 ...umerIntegrationTest.java => SheetsStreamConsumerIT.java} |  9 ++---
 3 files changed, 22 insertions(+), 10 deletions(-)

diff --git 
a/components/camel-google/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsIT.java
 
b/components/camel-google/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsIT.java
index f2c6580abfb..c01b33be94e 100644
--- 
a/components/camel-google/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsIT.java
+++ 
b/components/camel-google/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsIT.java
@@ -32,6 +32,7 @@ import org.apache.camel.builder.RouteBuilder;
 import 
org.apache.camel.component.google.sheets.internal.GoogleSheetsApiCollection;
 import org.apache.camel.component.google.sheets.internal.GoogleSheetsConstants;
 import 
org.apache.camel.component.google.sheets.internal.SheetsSpreadsheetsApiMethod;
+import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,7 +49,8 @@ public class SheetsSpreadsheetsIT {
 private static final String PATH_PREFIX
 = 
GoogleSheetsApiCollection.getCollection().getApiName(SheetsSpreadsheetsApiMethod.class).getName();
 
-public static class CreateTest extends AbstractGoogleSheetsTestSupport {
+@Nested
+class CreateIT extends AbstractGoogleSheetsTestSupport {
 private String title = "camel-sheets-" + new 
SecureRandom().nextInt(Integer.MAX_VALUE);
 
 @Test
@@ -85,7 +87,8 @@ public class SheetsSpreadsheetsIT {
 }
 }
 
-public static class GetTest extends AbstractGoogleSheetsTestSupport {
+@Nested
+class GetIT extends AbstractGoogleSheetsTestSupport {
 private Spreadsheet testSheet = getSpreadsheet();
 
 @Test
@@ -115,7 +118,8 @@ public class SheetsSpreadsheetsIT {
 }
 }
 
-public static class BatchUpdateTest extends 
AbstractGoogleSheetsTestSupport {
+@Nested
+class BatchUpdateIT extends AbstractGoogleSheetsTestSupport {
 private Spreadsheet testSheet = getSpreadsheet();
 private String updateTitle = "updated-" + 
testSheet.getProperties().getTitle();
 
diff --git 
a/components/camel-google/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsValuesIT.java
 
b/components/camel-google/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsValuesIT.java
index 582316b036f..d1e89eef259 100644
--- 
a/components/camel-google/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsValuesIT.java
+++ 
b/components/camel-google/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsValuesIT.java
@@ -36,6 +36,7 @@ import 
org.apache.camel.component.google.sheets.internal.GoogleSheetsApiCollecti
 import org.apache.camel.component.google.sheets.internal.GoogleSheetsConstants;
 import 
org.apache.camel.component.google.sheets.internal.SheetsSpreadsheetsValuesApiMethod;
 import org.apache.camel.util.ObjectHelper;
+import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -53,7 +54,8 @@ public class SheetsSpreadsheetsValuesIT {
 private static final String PATH_PREFIX
 = 
GoogleSheetsApiCollection.getCollection().getApiName(SheetsSpreadsheetsValuesApiMethod.class).getName();
 
-public static class GetTest extends AbstractGoogleSheetsTestSupport {
+@Nested
+class GetIT extends AbstractGoogleSheetsTestSupport {
 private Spreadsheet testSheet = getSpreadsheet();
 
 @Test
@@ -92,7 +94,8 @@ public class SheetsSpreadsheetsValuesIT {
 }
 }
 
-public static class UpdateTest extends AbstractGoogleSheetsTestSupport {
+@Nested
+class UpdateIT extends AbstractGoogleSheetsTestSupport {
 private Spreadsheet testSheet = getSpreadsheet();
 private String range = "TEST_SHEET!A1:B2";
 private List> data = Arrays.asList(
@@ -153,7 +156,8 @@ public class SheetsSpreadsheetsValuesIT {
 }
 }
 
-public static class AppendTest extends AbstractGoogleSheetsTestSupport {
+@Nested
+class AppendIT extends AbstractGoogleSheetsTestSupport 

Re: [PR] CAMEL-20389: fix incorrectly named Integration tests [camel]

2024-02-03 Thread via GitHub


github-actions[bot] commented on PR #12983:
URL: https://github.com/apache/camel/pull/12983#issuecomment-1925207300

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :robot: CI automation will test this PR automatically.
   
   :camel: Apache Camel Committers, please review the following items:
   
   * First-time contributors **require MANUAL approval** for the GitHub Actions 
to run
   
   * You can use the command `/component-test (camel-)component-name1 
(camel-)component-name2..` to request a test from the test bot.
   
   * You can label PRs using `build-all`, `build-dependents`, `skip-tests` and 
`test-dependents` to fine-tune the checks executed by this PR.
   
   * Build and test logs are available in the Summary page. **Only** [Apache 
Camel committers](https://camel.apache.org/community/team/#committers) have 
access to the summary. 
   
   * :warning: Be careful when sharing logs. Review their contents before 
sharing them publicly.


-- 
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-unsubscr...@camel.apache.org

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



[PR] CAMEL-20389: fix incorrectly named Integration tests [camel]

2024-02-03 Thread via GitHub


orpiske opened a new pull request, #12983:
URL: https://github.com/apache/camel/pull/12983

   Fix a few integration tests that were named incorrectly - as I pointed on 
one of the comments on PR #12966. 
   
   This only affects camel-google-calendar, camel-google-mail and 
camel-google-sheets.


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] fix #4948 part of #3397 [camel-k]

2024-02-03 Thread via GitHub


valdar commented on PR #5119:
URL: https://github.com/apache/camel-k/pull/5119#issuecomment-1925205616

   What about these tests:

   ❌ TestMetrics (3m0.27s)
   ❌ TestMetrics/reconciliation_duration_metric (10ms)
   
   they seems flaky to me, first run they were passing, they are passing 
locally, but now failing in CI :/
   


-- 
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-unsubscr...@camel.apache.org

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