[jira] [Updated] (CAMEL-17705) Camel Salesforce - Http Client timeout is hardcoded

2022-03-25 Thread Nicolas Filotto (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-17705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nicolas Filotto updated CAMEL-17705:

Summary: Camel Salesforce - Http Client timeout is hardcoded  (was: Camel 
Salesforce - Http Client timout is hardcoded)

> Camel Salesforce - Http Client timeout is hardcoded
> ---
>
> Key: CAMEL-17705
> URL: https://issues.apache.org/jira/browse/CAMEL-17705
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-salesforce
>Affects Versions: 3.14.0, 3.15.0
>Reporter: Jawad Ahmad
>Assignee: Jeremy Ross
>Priority: Major
>
> I am using Bulk V2 API to upload large files to Salesforce. I have noticed 
> that on creating the job from Producer it times out with Timeout exception. I 
> tried to change the timeout configuration but noticed its always gets set to 
> a hardcoded one.
> Class : SalesforceComponent
> {code:java}
> static SalesforceHttpClient createHttpClient(
> Object source, final SslContextFactory sslContextFactory, final 
> CamelContext context, int workerPoolSize,
> int workerPoolMaxSize) {
> SecurityUtils.adaptToIBMCipherNames(sslContextFactory);
> final SalesforceHttpClient httpClient = new SalesforceHttpClient(
> context, 
> context.getExecutorServiceManager().newThreadPool(source, 
> "SalesforceHttpClient", workerPoolSize,
> workerPoolMaxSize),
> sslContextFactory);
> // default settings, use httpClientProperties to set other
> // properties
> httpClient.setConnectTimeout(CONNECTION_TIMEOUT);
> httpClient.setIdleTimeout(IDLE_TIMEOUT);
> return httpClient;
> }
> {code}
> As suggested by Claus to use httpClientProperties. In that case, HTTP client 
> does set the connection timeout of the configured value. But it passes 
> timeout value to SalesforceSession instead of ConnectionTimeout value. So it 
> still gets failed with a Timeout error.
> Class : SalesforceComponent
> Method: doStart
> {code:java}
>  setupHttpClient(httpClient, getCamelContext(), httpClientProperties);
> // support restarts
> if (session == null) {
> session = new SalesforceSession(getCamelContext(), httpClient, 
> httpClient.getTimeout(), loginConfig);
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Assigned] (CAMEL-17705) Camel Salesforce - Http Client timout is hardcoded

2022-03-25 Thread Jeremy Ross (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-17705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jeremy Ross reassigned CAMEL-17705:
---

Assignee: Jeremy Ross  (was: Ramu)

> Camel Salesforce - Http Client timout is hardcoded
> --
>
> Key: CAMEL-17705
> URL: https://issues.apache.org/jira/browse/CAMEL-17705
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-salesforce
>Affects Versions: 3.14.0, 3.15.0
>Reporter: Jawad Ahmad
>Assignee: Jeremy Ross
>Priority: Major
>
> I am using Bulk V2 API to upload large files to Salesforce. I have noticed 
> that on creating the job from Producer it times out with Timeout exception. I 
> tried to change the timeout configuration but noticed its always gets set to 
> a hardcoded one.
> Class : SalesforceComponent
> {code:java}
> static SalesforceHttpClient createHttpClient(
> Object source, final SslContextFactory sslContextFactory, final 
> CamelContext context, int workerPoolSize,
> int workerPoolMaxSize) {
> SecurityUtils.adaptToIBMCipherNames(sslContextFactory);
> final SalesforceHttpClient httpClient = new SalesforceHttpClient(
> context, 
> context.getExecutorServiceManager().newThreadPool(source, 
> "SalesforceHttpClient", workerPoolSize,
> workerPoolMaxSize),
> sslContextFactory);
> // default settings, use httpClientProperties to set other
> // properties
> httpClient.setConnectTimeout(CONNECTION_TIMEOUT);
> httpClient.setIdleTimeout(IDLE_TIMEOUT);
> return httpClient;
> }
> {code}
> As suggested by Claus to use httpClientProperties. In that case, HTTP client 
> does set the connection timeout of the configured value. But it passes 
> timeout value to SalesforceSession instead of ConnectionTimeout value. So it 
> still gets failed with a Timeout error.
> Class : SalesforceComponent
> Method: doStart
> {code:java}
>  setupHttpClient(httpClient, getCamelContext(), httpClientProperties);
> // support restarts
> if (session == null) {
> session = new SalesforceSession(getCamelContext(), httpClient, 
> httpClient.getTimeout(), loginConfig);
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (CAMEL-17705) Camel Salesforce - Http Client timout is hardcoded

2022-03-25 Thread Jeremy Ross (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-17705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17512437#comment-17512437
 ] 

Jeremy Ross commented on CAMEL-17705:
-

[~jawwad124] ok I see the problem. There is not currently an option to set the 
request timeout. I pushed a commit that adds this option [1]. 

[1] 
https://github.com/apache/camel/commit/91848c1114f60e2242b356805439bcf9ff5903c8

> Camel Salesforce - Http Client timout is hardcoded
> --
>
> Key: CAMEL-17705
> URL: https://issues.apache.org/jira/browse/CAMEL-17705
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-salesforce
>Affects Versions: 3.14.0, 3.15.0
>Reporter: Jawad Ahmad
>Assignee: Ramu
>Priority: Major
>
> I am using Bulk V2 API to upload large files to Salesforce. I have noticed 
> that on creating the job from Producer it times out with Timeout exception. I 
> tried to change the timeout configuration but noticed its always gets set to 
> a hardcoded one.
> Class : SalesforceComponent
> {code:java}
> static SalesforceHttpClient createHttpClient(
> Object source, final SslContextFactory sslContextFactory, final 
> CamelContext context, int workerPoolSize,
> int workerPoolMaxSize) {
> SecurityUtils.adaptToIBMCipherNames(sslContextFactory);
> final SalesforceHttpClient httpClient = new SalesforceHttpClient(
> context, 
> context.getExecutorServiceManager().newThreadPool(source, 
> "SalesforceHttpClient", workerPoolSize,
> workerPoolMaxSize),
> sslContextFactory);
> // default settings, use httpClientProperties to set other
> // properties
> httpClient.setConnectTimeout(CONNECTION_TIMEOUT);
> httpClient.setIdleTimeout(IDLE_TIMEOUT);
> return httpClient;
> }
> {code}
> As suggested by Claus to use httpClientProperties. In that case, HTTP client 
> does set the connection timeout of the configured value. But it passes 
> timeout value to SalesforceSession instead of ConnectionTimeout value. So it 
> still gets failed with a Timeout error.
> Class : SalesforceComponent
> Method: doStart
> {code:java}
>  setupHttpClient(httpClient, getCamelContext(), httpClientProperties);
> // support restarts
> if (session == null) {
> session = new SalesforceSession(getCamelContext(), httpClient, 
> httpClient.getTimeout(), loginConfig);
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (CAMEL-17846) add tests in camel-aws2-ddb-starter

2022-03-25 Thread Jiri Ondrusek (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-17846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17512424#comment-17512424
 ] 

Jiri Ondrusek commented on CAMEL-17846:
---

PR https://github.com/apache/camel-spring-boot/pull/481

> add tests in camel-aws2-ddb-starter
> ---
>
> Key: CAMEL-17846
> URL: https://issues.apache.org/jira/browse/CAMEL-17846
> Project: Camel
>  Issue Type: Test
>  Components: camel-aws2, camel-spring-boot-starters, tests
>Reporter: Jiri Ondrusek
>Assignee: Jiri Ondrusek
>Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Created] (CAMEL-17857) camel-validator: remote xsd import not usable

2022-03-25 Thread Federico Mariani (Jira)
Federico Mariani created CAMEL-17857:


 Summary: camel-validator: remote xsd import not usable
 Key: CAMEL-17857
 URL: https://issues.apache.org/jira/browse/CAMEL-17857
 Project: Camel
  Issue Type: Bug
  Components: camel-validator
Affects Versions: 3.16.0
Reporter: Federico Mariani


camel-validator concat imports from xsd to the base endpoint, ex.
{code:java}
http://www.w3.org/2001/XMLSchema;
targetNamespace="http://example.org/ord;
xmlns="http://example.org/ord;
xmlns:prod="http://example.org/prod;>
  https://raw.githubusercontent.com/Croway/test-xsd/main/chapter04ord2.xsd"/>
  https://raw.githubusercontent.com/Croway/test-xsd/main/chapter04cust.xsd"/>
  http://example.org/prod;
 
schemaLocation="https://raw.githubusercontent.com/Croway/test-xsd/main/chapter04prod.xsd"/>
...
{code}
with a route like 
{code:java}
...
.toD("validator:https://raw.githubusercontent.com/Croway/test-xsd/main/chapter04ord1.xsd;)
...
{code}
the validator component concat the base endpoint with the import one, for 
example: 
_https://raw.githubusercontent.com/Croway/test-xsd/main/https://raw.githubusercontent.com/Croway/test-xsd/main/chapter04prod.xsd
 _ and the following exception is thrown
{code}
Caused by: java.io.FileNotFoundException: 
https://raw.githubusercontent.com/Croway/test-xsd/main/https:/raw.githubusercontent.com/Croway/test-xsd/main/chapter04ord2.xsd
at 
java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)
at 
java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
at 
java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at 
org.apache.camel.impl.engine.DefaultResourceResolvers$HttpsResolver$1.getInputStream(DefaultResourceResolvers.java:202)
...
{code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Assigned] (CAMEL-17051) camel-kafka: Need the ability to pause kafka consumer

2022-03-25 Thread Otavio Rodolfo Piske (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-17051?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Otavio Rodolfo Piske reassigned CAMEL-17051:


Assignee: Otavio Rodolfo Piske

> camel-kafka: Need the ability to pause kafka consumer
> -
>
> Key: CAMEL-17051
> URL: https://issues.apache.org/jira/browse/CAMEL-17051
> Project: Camel
>  Issue Type: New Feature
>  Components: camel-kafka
>Affects Versions: 3.12.0
>Reporter: Zachariah Young
>Assignee: Otavio Rodolfo Piske
>Priority: Minor
> Fix For: Future
>
>
> When handling transient errors that have exhausted retry limits, sometimes 
> pausing the Kafka consumer is the best way to handle an outage.  A great 
> example of this would be the Facebook outage that happen this week.
> One might suggest that stopping the consumer work would for this use case.  
> This would of course work but would require a manual restart.  Also, you want 
> to try to avoid a rebalance of the consumer.
> I would like to see a new strategy be created that would allow for pause and 
> resume to be configured.
> Ideally, the resume could be configured based on a health check.
>  
> Example code: 
> [https://github.com/jeanlouisboudart/retriable-consumer/blob/master/consumer/src/main/java/com/sample/InfiniteRetriesConsumer.java]
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (CAMEL-17719) camel-saleforce: allow to retrieve CDC json schema from meta service

2022-03-25 Thread Luca Burgazzoli (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-17719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17512366#comment-17512366
 ] 

Luca Burgazzoli commented on CAMEL-17719:
-

You can get a schema for pretty much any object and that's already leveraged by 
the SalesforceMetaDataExtension [1]
However, the schema that is generated by salesforce is not a json schema so it 
cannot be used as example in camel-kafka-connector or in any other tool that 
require a json schema so yes, the raw operation can be used but it does not 
help in retrieving the json schema so it would be nice to extend the 
SalesforceMetaDataExtension [1] to support also computing the json schema for 
CDC


 [1] 
https://github.com/apache/camel/blob/main/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceMetaDataExtension.java

> camel-saleforce: allow to retrieve CDC json schema from meta service
> 
>
> Key: CAMEL-17719
> URL: https://issues.apache.org/jira/browse/CAMEL-17719
> Project: Camel
>  Issue Type: New Feature
>  Components: camel-salesforce
>Reporter: Luca Burgazzoli
>Priority: Minor
>
> To get the full schema of a change event message, it it possible to make a 
> GET request to the REST API that includes the schema ID sent in the event 
> message, as example:
> {code}
> /vXX.X/event/eventSchema/
> {code}
> or by using the event name:
> {code}
> /vXX.X/sobjects//eventSchema
> {code}
> It would be nice if the meta data extension would be able to return the json 
> schema of the 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (CAMEL-17802) Check whether we need to manually commit offset upon stop when auto commit is enabled

2022-03-25 Thread Jira


[ 
https://issues.apache.org/jira/browse/CAMEL-17802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17512362#comment-17512362
 ] 

Rafał Gała commented on CAMEL-17802:


I did some tests today. I set up consumer with:

 
{noformat}
enable.auto.commit=true
auto.commit.interval.ms=12{noformat}
and ran the code which polled for 1 record, then called close() on consumer and 
left JVM with System.exit(0). The offset was commited after callingclose(). I 
check both kafka-clients 0.11.0.1 (pretty old) and latest 3.1.0 versions and 
both commit on closing.

> Check whether we need to manually commit offset upon stop when auto commit is 
> enabled
> -
>
> Key: CAMEL-17802
> URL: https://issues.apache.org/jira/browse/CAMEL-17802
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-kafka
>Reporter: Rafał Gała
>Priority: Minor
>
> As requested by [~orpiske] in CAMEL-17798.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Created] (CAMEL-17856) camel-jackson - Upgrade to 2.14.x

2022-03-25 Thread Claus Ibsen (Jira)
Claus Ibsen created CAMEL-17856:
---

 Summary: camel-jackson - Upgrade to 2.14.x
 Key: CAMEL-17856
 URL: https://issues.apache.org/jira/browse/CAMEL-17856
 Project: Camel
  Issue Type: Dependency upgrade
  Components: camel-jackson
Reporter: Claus Ibsen
 Fix For: 3.x


We should upgrade, but would be good to have it aligned with SB and Quarkus as 
well with the version they use.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (CAMEL-17705) Camel Salesforce - Http Client timout is hardcoded

2022-03-25 Thread Jawad Ahmad (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-17705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17512340#comment-17512340
 ] 

Jawad Ahmad commented on CAMEL-17705:
-

[~jeremyross] You can see from the description code it's hardcoding both idle 
timeout and connection time out. I have tried both properties using 
httpClientProperties and setting directly on the component level. None of it 
works.

> Camel Salesforce - Http Client timout is hardcoded
> --
>
> Key: CAMEL-17705
> URL: https://issues.apache.org/jira/browse/CAMEL-17705
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-salesforce
>Affects Versions: 3.14.0, 3.15.0
>Reporter: Jawad Ahmad
>Assignee: Ramu
>Priority: Major
>
> I am using Bulk V2 API to upload large files to Salesforce. I have noticed 
> that on creating the job from Producer it times out with Timeout exception. I 
> tried to change the timeout configuration but noticed its always gets set to 
> a hardcoded one.
> Class : SalesforceComponent
> {code:java}
> static SalesforceHttpClient createHttpClient(
> Object source, final SslContextFactory sslContextFactory, final 
> CamelContext context, int workerPoolSize,
> int workerPoolMaxSize) {
> SecurityUtils.adaptToIBMCipherNames(sslContextFactory);
> final SalesforceHttpClient httpClient = new SalesforceHttpClient(
> context, 
> context.getExecutorServiceManager().newThreadPool(source, 
> "SalesforceHttpClient", workerPoolSize,
> workerPoolMaxSize),
> sslContextFactory);
> // default settings, use httpClientProperties to set other
> // properties
> httpClient.setConnectTimeout(CONNECTION_TIMEOUT);
> httpClient.setIdleTimeout(IDLE_TIMEOUT);
> return httpClient;
> }
> {code}
> As suggested by Claus to use httpClientProperties. In that case, HTTP client 
> does set the connection timeout of the configured value. But it passes 
> timeout value to SalesforceSession instead of ConnectionTimeout value. So it 
> still gets failed with a Timeout error.
> Class : SalesforceComponent
> Method: doStart
> {code:java}
>  setupHttpClient(httpClient, getCamelContext(), httpClientProperties);
> // support restarts
> if (session == null) {
> session = new SalesforceSession(getCamelContext(), httpClient, 
> httpClient.getTimeout(), loginConfig);
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Created] (CAMEL-17855) camel-test-infra: enable singleton instances for supported services/tests

2022-03-25 Thread Otavio Rodolfo Piske (Jira)
Otavio Rodolfo Piske created CAMEL-17855:


 Summary: camel-test-infra: enable singleton instances for 
supported services/tests
 Key: CAMEL-17855
 URL: https://issues.apache.org/jira/browse/CAMEL-17855
 Project: Camel
  Issue Type: Test
Reporter: Otavio Rodolfo Piske


Implement the same changes on [https://github.com/apache/camel/pull/7254] to 
the other test infra services.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Comment Edited] (CAMEL-17849) camel-kafka: invalid log message on shutdown when using topic patterns

2022-03-25 Thread Otavio Rodolfo Piske (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-17849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17512328#comment-17512328
 ] 

Otavio Rodolfo Piske edited comment on CAMEL-17849 at 3/25/22, 11:14 AM:
-

Fixed with https://github.com/apache/camel/pull/7264.


was (Author: orpiske):
Fixed.

> camel-kafka: invalid log message on shutdown when using topic patterns
> --
>
> Key: CAMEL-17849
> URL: https://issues.apache.org/jira/browse/CAMEL-17849
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-kafka
>Reporter: Otavio Rodolfo Piske
>Assignee: Otavio Rodolfo Piske
>Priority: Major
> Fix For: 3.17.0
>
>
> During shutdown the consumer logs: "Stopping Kafka consumer on topic: {}". 
> This is confusing when using topic patterns



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Resolved] (CAMEL-17850) camel-kafka: lock concurrency issue in the record fetcher

2022-03-25 Thread Otavio Rodolfo Piske (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-17850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Otavio Rodolfo Piske resolved CAMEL-17850.
--
Resolution: Fixed

Fixed with https://github.com/apache/camel/pull/7264

> camel-kafka: lock concurrency issue in the record fetcher
> -
>
> Key: CAMEL-17850
> URL: https://issues.apache.org/jira/browse/CAMEL-17850
> Project: Camel
>  Issue Type: Bug
>  Components: camel-kafka
>Reporter: Otavio Rodolfo Piske
>Assignee: Otavio Rodolfo Piske
>Priority: Major
> Fix For: 3.17.0
>
>
> During stop the code tries to unlock the lock even if trying to lock it 
> previously has failed (ie.: by failling a call to tryLock). This can cause 
> the code to throw a IllegalMonitorStateException.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Resolved] (CAMEL-17849) camel-kafka: invalid log message on shutdown when using topic patterns

2022-03-25 Thread Otavio Rodolfo Piske (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-17849?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Otavio Rodolfo Piske resolved CAMEL-17849.
--
Resolution: Fixed

Fixed.

> camel-kafka: invalid log message on shutdown when using topic patterns
> --
>
> Key: CAMEL-17849
> URL: https://issues.apache.org/jira/browse/CAMEL-17849
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-kafka
>Reporter: Otavio Rodolfo Piske
>Assignee: Otavio Rodolfo Piske
>Priority: Major
> Fix For: 3.17.0
>
>
> During shutdown the consumer logs: "Stopping Kafka consumer on topic: {}". 
> This is confusing when using topic patterns



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Resolved] (CAMEL-17844) camel-bean: @Handler annotation doesn't work with FunctionalInterfaces

2022-03-25 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-17844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-17844.
-
Fix Version/s: 3.17.0
   (was: 3.x)
   Resolution: Fixed

> camel-bean: @Handler annotation doesn't work with FunctionalInterfaces
> --
>
> Key: CAMEL-17844
> URL: https://issues.apache.org/jira/browse/CAMEL-17844
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-bean
>Affects Versions: 3.4.1
>Reporter: Bjørn Ole Myrold
>Priority: Minor
> Fix For: 3.17.0
>
>
> Version 3.4.1 introduced fixes in regards to how BeanInfo gets built, this 
> seems to break beans which are @FunctionalInterfaces.
> I believe it was introduced with 
> https://issues.apache.org/jira/browse/CAMEL-15278
> The fix created in the above case only handles super classes, and does not 
> look at interfaces. A lambda cast to a FunctionalInterface will only provide 
> Object as super class, and BeanInfo will then not find any methods marked 
> with @Handler in the interface.
>  
> This works in 3.4.0, but not in 3.4.1 or higher
> {code:java}
> public class TestRoute extends RouteBuilder {
> @Override public void configure() throws Exception {
> from("direct:testRoute").id("TestRoute")
> .bean((Formatter) a -> String.format("%s %s", a.getName(), 
> a.getOtherName()))
> .to("direct:testEndpoint");
> }
> @FunctionalInterface
> public interface Formatter {
> @Handler String test(@Body RandomPojo t);
> }
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Updated] (CAMEL-17844) camel-bean: @Handler annotation doesn't work with FunctionalInterfaces

2022-03-25 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-17844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-17844:

Fix Version/s: 3.x
   (was: 3.17.0)

> camel-bean: @Handler annotation doesn't work with FunctionalInterfaces
> --
>
> Key: CAMEL-17844
> URL: https://issues.apache.org/jira/browse/CAMEL-17844
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-bean
>Affects Versions: 3.4.1
>Reporter: Bjørn Ole Myrold
>Priority: Minor
> Fix For: 3.x
>
>
> Version 3.4.1 introduced fixes in regards to how BeanInfo gets built, this 
> seems to break beans which are @FunctionalInterfaces.
> I believe it was introduced with 
> https://issues.apache.org/jira/browse/CAMEL-15278
> The fix created in the above case only handles super classes, and does not 
> look at interfaces. A lambda cast to a FunctionalInterface will only provide 
> Object as super class, and BeanInfo will then not find any methods marked 
> with @Handler in the interface.
>  
> This works in 3.4.0, but not in 3.4.1 or higher
> {code:java}
> public class TestRoute extends RouteBuilder {
> @Override public void configure() throws Exception {
> from("direct:testRoute").id("TestRoute")
> .bean((Formatter) a -> String.format("%s %s", a.getName(), 
> a.getOtherName()))
> .to("direct:testEndpoint");
> }
> @FunctionalInterface
> public interface Formatter {
> @Handler String test(@Body RandomPojo t);
> }
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Updated] (CAMEL-17844) camel-bean: @Handler annotation doesn't work with FunctionalInterfaces

2022-03-25 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-17844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-17844:

Issue Type: Improvement  (was: Bug)

> camel-bean: @Handler annotation doesn't work with FunctionalInterfaces
> --
>
> Key: CAMEL-17844
> URL: https://issues.apache.org/jira/browse/CAMEL-17844
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-bean
>Affects Versions: 3.4.1
>Reporter: Bjørn Ole Myrold
>Priority: Minor
> Fix For: 3.17.0
>
>
> Version 3.4.1 introduced fixes in regards to how BeanInfo gets built, this 
> seems to break beans which are @FunctionalInterfaces.
> I believe it was introduced with 
> https://issues.apache.org/jira/browse/CAMEL-15278
> The fix created in the above case only handles super classes, and does not 
> look at interfaces. A lambda cast to a FunctionalInterface will only provide 
> Object as super class, and BeanInfo will then not find any methods marked 
> with @Handler in the interface.
>  
> This works in 3.4.0, but not in 3.4.1 or higher
> {code:java}
> public class TestRoute extends RouteBuilder {
> @Override public void configure() throws Exception {
> from("direct:testRoute").id("TestRoute")
> .bean((Formatter) a -> String.format("%s %s", a.getName(), 
> a.getOtherName()))
> .to("direct:testEndpoint");
> }
> @FunctionalInterface
> public interface Formatter {
> @Handler String test(@Body RandomPojo t);
> }
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (CAMEL-17823) UUID generator in the Simple language

2022-03-25 Thread Claus Ibsen (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-17823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17512250#comment-17512250
 ] 

Claus Ibsen commented on CAMEL-17823:
-

Sure that is a good and fun issue to try to implement.

To add custom functions to simple language it is around here
org.apache.camel.language.simple.ast.SimpleFunctionExpression#createSimpleExpressionMisc

And you can add unit tests to 
org.apache.camel.language.simple.SimpleTest

See for example how the random function is implemented

And for docs then add it to simple-language.adoc file



> UUID generator in the Simple language
> -
>
> Key: CAMEL-17823
> URL: https://issues.apache.org/jira/browse/CAMEL-17823
> Project: Camel
>  Issue Type: New Feature
>Affects Versions: 3.15.0
>Reporter: Raymond
>Priority: Minor
>
> One common use case I see a lot is to set a unique ID (UUID). There are 
> several ways to do this. For example:
> 1) Reuse a Camel generated id (exchangeid, breadcrumbid, messageid). For 
> example: ${exchangeId}
> 2) Use 'generate-id' function in XSLT on a node-set 
> ([https://www.w3schools.com/xml/func_generateid.asp)]
> 3) Create bean (and create UUID directly in Java) or with help of the 
> UUIDGenerator ([https://camel.apache.org/manual/uuidgenerator.html)].
> 4) Create a Groovy expression
> I think, however, it would be more convenient and easier for users to have a 
> function directly within the Simple language. Something like:   
> generate-id(type)
> Where type is one of "Classic, Default, Short, Simple". When none is used, 
> the default should be used.
> Source: 
>         
> [https://camel.apache.org/manual/uuidgenerator.html|https://camel.apache.org/manual/uuidgenerator.html)]
> [https://www.designingbuildings.co.uk/wiki/Global_Unique_IDs_(GUIDs)]
>    



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (CAMEL-17823) UUID generator in the Simple language

2022-03-25 Thread Raymond (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-17823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17512244#comment-17512244
 ] 

Raymond commented on CAMEL-17823:
-

I like to give it a try. Note that I haven't worked on such a large code 
base/large OSS projects (outside very small fixes/documentation). So I first 
need to read a bit about the contribution guidelines, investigate the code base 
and the problem...

> UUID generator in the Simple language
> -
>
> Key: CAMEL-17823
> URL: https://issues.apache.org/jira/browse/CAMEL-17823
> Project: Camel
>  Issue Type: New Feature
>Affects Versions: 3.15.0
>Reporter: Raymond
>Priority: Minor
>
> One common use case I see a lot is to set a unique ID (UUID). There are 
> several ways to do this. For example:
> 1) Reuse a Camel generated id (exchangeid, breadcrumbid, messageid). For 
> example: ${exchangeId}
> 2) Use 'generate-id' function in XSLT on a node-set 
> ([https://www.w3schools.com/xml/func_generateid.asp)]
> 3) Create bean (and create UUID directly in Java) or with help of the 
> UUIDGenerator ([https://camel.apache.org/manual/uuidgenerator.html)].
> 4) Create a Groovy expression
> I think, however, it would be more convenient and easier for users to have a 
> function directly within the Simple language. Something like:   
> generate-id(type)
> Where type is one of "Classic, Default, Short, Simple". When none is used, 
> the default should be used.
> Source: 
>         
> [https://camel.apache.org/manual/uuidgenerator.html|https://camel.apache.org/manual/uuidgenerator.html)]
> [https://www.designingbuildings.co.uk/wiki/Global_Unique_IDs_(GUIDs)]
>    



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Created] (CAMEL-17854) Camel-AWS-SNS: support byte arrays when mapping camel headers to sns attribute

2022-03-25 Thread Andrea Cosentino (Jira)
Andrea Cosentino created CAMEL-17854:


 Summary: Camel-AWS-SNS: support byte arrays when mapping camel 
headers to sns attribute
 Key: CAMEL-17854
 URL: https://issues.apache.org/jira/browse/CAMEL-17854
 Project: Camel
  Issue Type: Improvement
Reporter: Andrea Cosentino
Assignee: Andrea Cosentino
 Fix For: 3.17.0


Same as CAMEL-17816 but for SNS



--
This message was sent by Atlassian Jira
(v8.20.1#820001)