You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/04/08 17:06:17 UTC

[GitHub] [camel] hokutor opened a new pull request #5319: CAMEL-16471 - Enable URL endpoint based Client Initialization

hokutor opened a new pull request #5319:
URL: https://github.com/apache/camel/pull/5319


   - Enabling Endpoint URL based SmnClient initialization beside the Region based
   
   As of camel release version 3.9, camel-huaweicloud-smn component supports initializing the SMN client based on cloud region only.
   
   As an alternative option, Huaweicloud SDK now supports initializing the endpoint based on fully qualified endpoint url as per the documentation here.
   https://github.com/huaweicloud/huaweicloud-sdk-java-v3#31-initialize-the-serviceclient-with-specified-endpoint-top
   
   We should have the same feature enabled for camel-huaweicloud-smn too
   
   <!-- Uncomment and fill this section if your PR is not trivial
   - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
   - [ ] If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Run `mvn clean install -Psourcecheck` in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
   Below are the contribution guidelines:
   https://github.com/apache/camel/blob/master/CONTRIBUTING.md
   -->
   


-- 
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.

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



[GitHub] [camel] hokutor commented on a change in pull request #5319: CAMEL-16471 - Enable URL endpoint based Client Initialization

Posted by GitBox <gi...@apache.org>.
hokutor commented on a change in pull request #5319:
URL: https://github.com/apache/camel/pull/5319#discussion_r610665111



##########
File path: components/camel-huaweicloud-smn/src/main/docs/hwcloud-smn-component.adoc
##########
@@ -71,13 +71,15 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
 | *authKey* (producer) | *Required* Authentication key for the cloud user |  | String
+| *endpoint* (producer) | Fully qualified smn service url. Carries higher precedence than region parameter based client initialization|  | String

Review comment:
       Thanks @oscerd for the tip. Have checked in as per guidelines. We loved the entire documentation framework :) 




-- 
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.

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



[GitHub] [camel] oscerd commented on a change in pull request #5319: CAMEL-16471 - Enable URL endpoint based Client Initialization

Posted by GitBox <gi...@apache.org>.
oscerd commented on a change in pull request #5319:
URL: https://github.com/apache/camel/pull/5319#discussion_r610649941



##########
File path: components/camel-huaweicloud-smn/src/main/docs/hwcloud-smn-component.adoc
##########
@@ -71,13 +71,15 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
 | *authKey* (producer) | *Required* Authentication key for the cloud user |  | String
+| *endpoint* (producer) | Fully qualified smn service url. Carries higher precedence than region parameter based client initialization|  | String

Review comment:
       This is autogenerated, you need to update the description on the option, not change the table directly, once you build the module, it will be updated.




-- 
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.

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



[GitHub] [camel] oscerd commented on a change in pull request #5319: CAMEL-16471 - Enable URL endpoint based Client Initialization

Posted by GitBox <gi...@apache.org>.
oscerd commented on a change in pull request #5319:
URL: https://github.com/apache/camel/pull/5319#discussion_r610784578



##########
File path: core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
##########
@@ -28,14 +28,12 @@
 @Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
 public interface EndpointBuilderFactory
         extends
-            org.apache.camel.builder.endpoint.dsl.AMQPEndpointBuilderFactory.AMQPBuilders,
-            org.apache.camel.builder.endpoint.dsl.AS2EndpointBuilderFactory.AS2Builders,
-            org.apache.camel.builder.endpoint.dsl.AWS2EC2EndpointBuilderFactory.AWS2EC2Builders,
-            org.apache.camel.builder.endpoint.dsl.AWS2S3EndpointBuilderFactory.AWS2S3Builders,
             org.apache.camel.builder.endpoint.dsl.ActiveMQEndpointBuilderFactory.ActiveMQBuilders,
             org.apache.camel.builder.endpoint.dsl.AhcEndpointBuilderFactory.AhcBuilders,
+            org.apache.camel.builder.endpoint.dsl.AMQPEndpointBuilderFactory.AMQPBuilders,

Review comment:
       Here I guess you have a mix of empty folders or a git tree not clean.




-- 
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.

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



[GitHub] [camel] hokutor commented on a change in pull request #5319: CAMEL-16471 - Enable URL endpoint based Client Initialization

Posted by GitBox <gi...@apache.org>.
hokutor commented on a change in pull request #5319:
URL: https://github.com/apache/camel/pull/5319#discussion_r610902266



##########
File path: core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
##########
@@ -28,14 +28,12 @@
 @Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
 public interface EndpointBuilderFactory
         extends
-            org.apache.camel.builder.endpoint.dsl.AMQPEndpointBuilderFactory.AMQPBuilders,
-            org.apache.camel.builder.endpoint.dsl.AS2EndpointBuilderFactory.AS2Builders,
-            org.apache.camel.builder.endpoint.dsl.AWS2EC2EndpointBuilderFactory.AWS2EC2Builders,
-            org.apache.camel.builder.endpoint.dsl.AWS2S3EndpointBuilderFactory.AWS2S3Builders,
             org.apache.camel.builder.endpoint.dsl.ActiveMQEndpointBuilderFactory.ActiveMQBuilders,
             org.apache.camel.builder.endpoint.dsl.AhcEndpointBuilderFactory.AhcBuilders,
+            org.apache.camel.builder.endpoint.dsl.AMQPEndpointBuilderFactory.AMQPBuilders,

Review comment:
       > Here I guess you have a mix of empty folders or a git tree not clean.
   
   I did a revert, complete cleanup and applied changes and did  a mvn build. I see the same set of changes again. Could it be extensions getting re-ordered inside the same file? I see ```org.apache.camel.builder.endpoint.dsl.AMQPEndpointBuilderFactory.AMQPBuilders``` removed from upper portion of the file and moved down ?
   
   ![image](https://user-images.githubusercontent.com/81697586/114240094-f7e1b900-9954-11eb-9185-a9abe2f18af4.png)
   
    




-- 
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.

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



[GitHub] [camel] hokutor commented on a change in pull request #5319: CAMEL-16471 - Enable URL endpoint based Client Initialization

Posted by GitBox <gi...@apache.org>.
hokutor commented on a change in pull request #5319:
URL: https://github.com/apache/camel/pull/5319#discussion_r610651652



##########
File path: components/camel-huaweicloud-smn/src/main/docs/hwcloud-smn-component.adoc
##########
@@ -71,13 +71,15 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
 | *authKey* (producer) | *Required* Authentication key for the cloud user |  | String
+| *endpoint* (producer) | Fully qualified smn service url. Carries higher precedence than region parameter based client initialization|  | String

Review comment:
       @oscerd - oh i see. let me autogenerated again and update it on the option. 




-- 
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.

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



[GitHub] [camel] hokutor commented on a change in pull request #5319: CAMEL-16471 - Enable URL endpoint based Client Initialization

Posted by GitBox <gi...@apache.org>.
hokutor commented on a change in pull request #5319:
URL: https://github.com/apache/camel/pull/5319#discussion_r610894933



##########
File path: core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
##########
@@ -28,14 +28,12 @@
 @Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
 public interface EndpointBuilderFactory
         extends
-            org.apache.camel.builder.endpoint.dsl.AMQPEndpointBuilderFactory.AMQPBuilders,
-            org.apache.camel.builder.endpoint.dsl.AS2EndpointBuilderFactory.AS2Builders,
-            org.apache.camel.builder.endpoint.dsl.AWS2EC2EndpointBuilderFactory.AWS2EC2Builders,
-            org.apache.camel.builder.endpoint.dsl.AWS2S3EndpointBuilderFactory.AWS2S3Builders,
             org.apache.camel.builder.endpoint.dsl.ActiveMQEndpointBuilderFactory.ActiveMQBuilders,
             org.apache.camel.builder.endpoint.dsl.AhcEndpointBuilderFactory.AhcBuilders,
+            org.apache.camel.builder.endpoint.dsl.AMQPEndpointBuilderFactory.AMQPBuilders,

Review comment:
       Strange. I cleaned up my local branches and reverted the changes on EndpointBuilderFactory and EndpointBuilders file. Let me do a check-in with reverted state. 




-- 
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.

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



[GitHub] [camel] oscerd commented on a change in pull request #5319: CAMEL-16471 - Enable URL endpoint based Client Initialization

Posted by GitBox <gi...@apache.org>.
oscerd commented on a change in pull request #5319:
URL: https://github.com/apache/camel/pull/5319#discussion_r610118445



##########
File path: components/camel-huaweicloud-smn/src/main/java/org/apache/camel/component/huaweicloud/smn/SimpleNotificationProducer.java
##########
@@ -204,15 +205,20 @@ private void validateAndInitializeSmnClient(SimpleNotificationEndpoint simpleNot
             clientConfigurations.setProjectId(simpleNotificationEndpoint.getProjectId());
         }
 
-        //checking for region
-        String endpointUrl = SimpleNotificationUtils.resolveSmnServiceEndpoint(simpleNotificationEndpoint.getRegion());
-        if (endpointUrl == null) {
-            if (LOG.isErrorEnabled()) {
-                LOG.error("Valid region not found");
-            }
-            throw new IllegalArgumentException("enter a valid region");
+        //checking for endpoint
+        if (StringUtils.isNotEmpty(simpleNotificationEndpoint.getEndpoint())) {
+            clientConfigurations.setServiceEndpoint(simpleNotificationEndpoint.getEndpoint());
         } else {
-            clientConfigurations.setServiceEndpoint(endpointUrl);
+            //checking for region
+            String endpointUrl = SimpleNotificationUtils.resolveSmnServiceEndpoint(simpleNotificationEndpoint.getRegion());

Review comment:
       Here you're changing the basic behavior. So I think we need a note on the migration guide about endpoint with precedence on region. 




-- 
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.

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



[GitHub] [camel] hokutor commented on a change in pull request #5319: CAMEL-16471 - Enable URL endpoint based Client Initialization

Posted by GitBox <gi...@apache.org>.
hokutor commented on a change in pull request #5319:
URL: https://github.com/apache/camel/pull/5319#discussion_r610902266



##########
File path: core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
##########
@@ -28,14 +28,12 @@
 @Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
 public interface EndpointBuilderFactory
         extends
-            org.apache.camel.builder.endpoint.dsl.AMQPEndpointBuilderFactory.AMQPBuilders,
-            org.apache.camel.builder.endpoint.dsl.AS2EndpointBuilderFactory.AS2Builders,
-            org.apache.camel.builder.endpoint.dsl.AWS2EC2EndpointBuilderFactory.AWS2EC2Builders,
-            org.apache.camel.builder.endpoint.dsl.AWS2S3EndpointBuilderFactory.AWS2S3Builders,
             org.apache.camel.builder.endpoint.dsl.ActiveMQEndpointBuilderFactory.ActiveMQBuilders,
             org.apache.camel.builder.endpoint.dsl.AhcEndpointBuilderFactory.AhcBuilders,
+            org.apache.camel.builder.endpoint.dsl.AMQPEndpointBuilderFactory.AMQPBuilders,

Review comment:
       > Here I guess you have a mix of empty folders or a git tree not clean.
   
   I did a revert, complete cleanup and applied changes and did  a mvn build. I see the same set of changes again. Could it be extensions getting re-ordered inside the same file? I see ```org.apache.camel.builder.endpoint.dsl.AMQPEndpointBuilderFactory.AMQPBuilders``` removed from upper portion of the file and moved down ?
   
   ![image](https://user-images.githubusercontent.com/81697586/114240094-f7e1b900-9954-11eb-9185-a9abe2f18af4.png)
   
    @oscerd 




-- 
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.

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



[GitHub] [camel] hokutor commented on a change in pull request #5319: CAMEL-16471 - Enable URL endpoint based Client Initialization

Posted by GitBox <gi...@apache.org>.
hokutor commented on a change in pull request #5319:
URL: https://github.com/apache/camel/pull/5319#discussion_r610651652



##########
File path: components/camel-huaweicloud-smn/src/main/docs/hwcloud-smn-component.adoc
##########
@@ -71,13 +71,15 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
 | *authKey* (producer) | *Required* Authentication key for the cloud user |  | String
+| *endpoint* (producer) | Fully qualified smn service url. Carries higher precedence than region parameter based client initialization|  | String

Review comment:
       @oscerd - thanks for the note. Updates done to the migration guide and also mentioned the same in component documentations.




-- 
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.

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



[GitHub] [camel] oscerd commented on a change in pull request #5319: CAMEL-16471 - Enable URL endpoint based Client Initialization

Posted by GitBox <gi...@apache.org>.
oscerd commented on a change in pull request #5319:
URL: https://github.com/apache/camel/pull/5319#discussion_r610904555



##########
File path: core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
##########
@@ -28,14 +28,12 @@
 @Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
 public interface EndpointBuilderFactory
         extends
-            org.apache.camel.builder.endpoint.dsl.AMQPEndpointBuilderFactory.AMQPBuilders,
-            org.apache.camel.builder.endpoint.dsl.AS2EndpointBuilderFactory.AS2Builders,
-            org.apache.camel.builder.endpoint.dsl.AWS2EC2EndpointBuilderFactory.AWS2EC2Builders,
-            org.apache.camel.builder.endpoint.dsl.AWS2S3EndpointBuilderFactory.AWS2S3Builders,
             org.apache.camel.builder.endpoint.dsl.ActiveMQEndpointBuilderFactory.ActiveMQBuilders,
             org.apache.camel.builder.endpoint.dsl.AhcEndpointBuilderFactory.AhcBuilders,
+            org.apache.camel.builder.endpoint.dsl.AMQPEndpointBuilderFactory.AMQPBuilders,

Review comment:
       It could be. The important point is not losing builders




-- 
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.

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



[GitHub] [camel] davsclaus merged pull request #5319: CAMEL-16471 - Enable URL endpoint based Client Initialization

Posted by GitBox <gi...@apache.org>.
davsclaus merged pull request #5319:
URL: https://github.com/apache/camel/pull/5319


   


-- 
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.

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