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

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


The following commit(s) were added to refs/heads/main by this push:
     new b7290aee904 [create-pull-request] automated change
b7290aee904 is described below

commit b7290aee904a5348475e82aad439ad7a72ed40ae
Author: oscerd <osc...@users.noreply.github.com>
AuthorDate: Wed Sep 21 01:35:40 2022 +0000

    [create-pull-request] automated change
---
 .../springboot/catalog/components/telegram.json    |  7 +++---
 .../src/main/docs/telegram.json                    | 10 ++------
 .../springboot/TelegramComponentConfiguration.java | 27 +++++-----------------
 .../springboot/TelegramComponentConverter.java     |  6 ++---
 4 files changed, 13 insertions(+), 37 deletions(-)

diff --git 
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/telegram.json
 
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/telegram.json
index ce8c706dcef..b2c19ea11f8 100644
--- 
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/telegram.json
+++ 
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/telegram.json
@@ -26,8 +26,7 @@
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start 
Producer", "group": "producer", "label": "producer", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": false, "description": "Whether the producer 
should be started lazy (on the first message). By starting lazy you can use 
this to allow CamelContext and routes to startup in situations where a producer 
may otherwise fail during star [...]
     "autowiredEnabled": { "kind": "property", "displayName": "Autowired 
Enabled", "group": "advanced", "label": "advanced", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": true, "description": "Whether autowiring is 
enabled. This is used for automatic autowiring options (the option must be 
marked as autowired) by looking up in the registry to find if there is a single 
instance of matching type, which t [...]
     "baseUri": { "kind": "property", "displayName": "Base Uri", "group": 
"advanced", "label": "advanced", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "https:\/\/api.telegram.org", "description": 
"Can be used to set an alternative base URI, e.g. when you want to test the 
component against a mock Telegram API" },
-    "client": { "kind": "property", "displayName": "Client", "group": 
"advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": "org.asynchttpclient.AsyncHttpClient", "deprecated": false, 
"autowired": false, "secret": false, "description": "To use a custom 
AsyncHttpClient" },
-    "clientConfig": { "kind": "property", "displayName": "Client Config", 
"group": "advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": "org.asynchttpclient.AsyncHttpClientConfig", "deprecated": false, 
"autowired": false, "secret": false, "description": "To configure the 
AsyncHttpClient to use a custom com.ning.http.client.AsyncHttpClientConfig 
instance." },
+    "client": { "kind": "property", "displayName": "Client", "group": 
"advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": "java.net.http.HttpClient", "deprecated": false, "autowired": 
false, "secret": false, "description": "To use a custom 
java.net.http.HttpClient" },
     "authorizationToken": { "kind": "property", "displayName": "Authorization 
Token", "group": "security", "label": "security", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": true, "description": "The default Telegram authorization token 
to be used when the information is not provided in the endpoints." }
   },
   "headers": {
@@ -50,8 +49,8 @@
     "chatId": { "kind": "parameter", "displayName": "Chat Id", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.telegram.TelegramConfiguration", 
"configurationField": "configuration", "description": "The identifier of the 
chat that will receive the produced messages. Chat ids can be first obtained 
from incoming messages  [...]
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start 
Producer", "group": "producer (advanced)", "label": "producer,advanced", 
"required": false, "type": "boolean", "javaType": "boolean", "deprecated": 
false, "autowired": false, "secret": false, "defaultValue": false, 
"description": "Whether the producer should be started lazy (on the first 
message). By starting lazy you can use this to allow CamelContext and routes to 
startup in situations where a producer may other [...]
     "baseUri": { "kind": "parameter", "displayName": "Base Uri", "group": 
"advanced", "label": "advanced", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.telegram.TelegramConfiguration", 
"configurationField": "configuration", "description": "Can be used to set an 
alternative base URI, e.g. when you want to test the component against a mock 
Telegram API" },
-    "bufferSize": { "kind": "parameter", "displayName": "Buffer Size", 
"group": "advanced", "label": "advanced", "required": false, "type": "integer", 
"javaType": "int", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 4096, "description": "The initial in-memory buffer size used 
when transferring data between Camel and AHC Client." },
-    "clientConfig": { "kind": "parameter", "displayName": "Client Config", 
"group": "advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": "org.asynchttpclient.AsyncHttpClientConfig", "deprecated": false, 
"autowired": false, "secret": false, "description": "To configure the 
AsyncHttpClient to use a custom com.ning.http.client.AsyncHttpClientConfig 
instance." },
+    "bufferSize": { "kind": "parameter", "displayName": "Buffer Size", 
"group": "advanced", "label": "advanced", "required": false, "type": "integer", 
"javaType": "int", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 1048576, "description": "The initial in-memory buffer size used 
when transferring data between Camel and AHC Client." },
+    "client": { "kind": "parameter", "displayName": "Client", "group": 
"advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": "java.net.http.HttpClient", "deprecated": false, "autowired": 
false, "secret": false, "description": "To use a custom HttpClient" },
     "proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group": 
"proxy", "label": "proxy", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"configurationClass": 
"org.apache.camel.component.telegram.TelegramConfiguration", 
"configurationField": "configuration", "description": "HTTP proxy host which 
could be used when sending out the message." },
     "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": 
"proxy", "label": "proxy", "required": false, "type": "integer", "javaType": 
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, 
"configurationClass": 
"org.apache.camel.component.telegram.TelegramConfiguration", 
"configurationField": "configuration", "description": "HTTP proxy port which 
could be used when sending out the message." },
     "proxyType": { "kind": "parameter", "displayName": "Proxy Type", "group": 
"proxy", "label": "proxy", "required": false, "type": "object", "javaType": 
"org.apache.camel.component.telegram.TelegramProxyType", "enum": [ "HTTP", 
"SOCKS4", "SOCKS5" ], "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": "HTTP", "configurationClass": 
"org.apache.camel.component.telegram.TelegramConfiguration", 
"configurationField": "configuration", "description": "HTTP proxy type which 
[...]
diff --git 
a/components-starter/camel-telegram-starter/src/main/docs/telegram.json 
b/components-starter/camel-telegram-starter/src/main/docs/telegram.json
index ef7851d8b56..e825e9e3a19 100644
--- a/components-starter/camel-telegram-starter/src/main/docs/telegram.json
+++ b/components-starter/camel-telegram-starter/src/main/docs/telegram.json
@@ -42,14 +42,8 @@
     },
     {
       "name": "camel.component.telegram.client",
-      "type": "org.asynchttpclient.AsyncHttpClient",
-      "description": "To use a custom AsyncHttpClient. The option is a 
org.asynchttpclient.AsyncHttpClient type.",
-      "sourceType": 
"org.apache.camel.component.telegram.springboot.TelegramComponentConfiguration"
-    },
-    {
-      "name": "camel.component.telegram.client-config",
-      "type": "org.asynchttpclient.AsyncHttpClientConfig",
-      "description": "To configure the AsyncHttpClient to use a custom 
com.ning.http.client.AsyncHttpClientConfig instance. The option is a 
org.asynchttpclient.AsyncHttpClientConfig type.",
+      "type": "java.net.http.HttpClient",
+      "description": "To use a custom java.net.http.HttpClient. The option is 
a java.net.http.HttpClient type.",
       "sourceType": 
"org.apache.camel.component.telegram.springboot.TelegramComponentConfiguration"
     },
     {
diff --git 
a/components-starter/camel-telegram-starter/src/main/java/org/apache/camel/component/telegram/springboot/TelegramComponentConfiguration.java
 
b/components-starter/camel-telegram-starter/src/main/java/org/apache/camel/component/telegram/springboot/TelegramComponentConfiguration.java
index b07aa27815c..ee3f2f143d8 100644
--- 
a/components-starter/camel-telegram-starter/src/main/java/org/apache/camel/component/telegram/springboot/TelegramComponentConfiguration.java
+++ 
b/components-starter/camel-telegram-starter/src/main/java/org/apache/camel/component/telegram/springboot/TelegramComponentConfiguration.java
@@ -16,10 +16,9 @@
  */
 package org.apache.camel.component.telegram.springboot;
 
+import java.net.http.HttpClient;
 import javax.annotation.Generated;
 import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
-import org.asynchttpclient.AsyncHttpClient;
-import org.asynchttpclient.AsyncHttpClientConfig;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
 /**
@@ -73,16 +72,10 @@ public class TelegramComponentConfiguration
      */
     private String baseUri = "https://api.telegram.org";;
     /**
-     * To use a custom AsyncHttpClient. The option is a
-     * org.asynchttpclient.AsyncHttpClient type.
+     * To use a custom java.net.http.HttpClient. The option is a
+     * java.net.http.HttpClient type.
      */
-    private AsyncHttpClient client;
-    /**
-     * To configure the AsyncHttpClient to use a custom
-     * com.ning.http.client.AsyncHttpClientConfig instance. The option is a
-     * org.asynchttpclient.AsyncHttpClientConfig type.
-     */
-    private AsyncHttpClientConfig clientConfig;
+    private HttpClient client;
     /**
      * The default Telegram authorization token to be used when the information
      * is not provided in the endpoints.
@@ -121,22 +114,14 @@ public class TelegramComponentConfiguration
         this.baseUri = baseUri;
     }
 
-    public AsyncHttpClient getClient() {
+    public HttpClient getClient() {
         return client;
     }
 
-    public void setClient(AsyncHttpClient client) {
+    public void setClient(HttpClient client) {
         this.client = client;
     }
 
-    public AsyncHttpClientConfig getClientConfig() {
-        return clientConfig;
-    }
-
-    public void setClientConfig(AsyncHttpClientConfig clientConfig) {
-        this.clientConfig = clientConfig;
-    }
-
     public String getAuthorizationToken() {
         return authorizationToken;
     }
diff --git 
a/components-starter/camel-telegram-starter/src/main/java/org/apache/camel/component/telegram/springboot/TelegramComponentConverter.java
 
b/components-starter/camel-telegram-starter/src/main/java/org/apache/camel/component/telegram/springboot/TelegramComponentConverter.java
index 010dd3f3306..b09560c7615 100644
--- 
a/components-starter/camel-telegram-starter/src/main/java/org/apache/camel/component/telegram/springboot/TelegramComponentConverter.java
+++ 
b/components-starter/camel-telegram-starter/src/main/java/org/apache/camel/component/telegram/springboot/TelegramComponentConverter.java
@@ -41,8 +41,7 @@ public class TelegramComponentConverter implements 
GenericConverter {
 
     public Set<ConvertiblePair> getConvertibleTypes() {
         Set<ConvertiblePair> answer = new LinkedHashSet<>();
-        answer.add(new ConvertiblePair(String.class, 
org.asynchttpclient.AsyncHttpClient.class));
-        answer.add(new ConvertiblePair(String.class, 
org.asynchttpclient.AsyncHttpClientConfig.class));
+        answer.add(new ConvertiblePair(String.class, 
java.net.http.HttpClient.class));
         return answer;
     }
 
@@ -59,8 +58,7 @@ public class TelegramComponentConverter implements 
GenericConverter {
         }
         ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
         switch (targetType.getName()) {
-            case "org.asynchttpclient.AsyncHttpClient": return 
applicationContext.getBean(ref, org.asynchttpclient.AsyncHttpClient.class);
-            case "org.asynchttpclient.AsyncHttpClientConfig": return 
applicationContext.getBean(ref, 
org.asynchttpclient.AsyncHttpClientConfig.class);
+            case "java.net.http.HttpClient": return 
applicationContext.getBean(ref, java.net.http.HttpClient.class);
         }
         return null;
     }

Reply via email to