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/01/26 15:19:34 UTC

[GitHub] [camel] omarsmak opened a new pull request #4936: CAMEL-15933: Add Stitch component to Camel

omarsmak opened a new pull request #4936:
URL: https://github.com/apache/camel/pull/4936


   - [ ] 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] davsclaus commented on a change in pull request #4936: CAMEL-15933: Add Stitch component to Camel

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



##########
File path: components/camel-stitch/src/main/java/org/apache/camel/component/stitch/StitchConfiguration.java
##########
@@ -0,0 +1,163 @@
+/*
+ * 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.component.stitch;
+
+import java.util.Collection;
+import java.util.HashSet;
+
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.component.stitch.client.StitchClient;
+import org.apache.camel.component.stitch.client.StitchRegion;
+import org.apache.camel.component.stitch.client.models.StitchSchema;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.apache.camel.spi.UriPath;
+import reactor.netty.http.client.HttpClient;
+import reactor.netty.resources.ConnectionProvider;
+
+@UriParams
+public class StitchConfiguration implements Cloneable {
+
+    @UriPath
+    private String tableName;
+    @UriParam(label = "security", secret = true)
+    @Metadata(required = true)
+    private String token;
+    @UriParam(label = "producer", defaultValue = "europe")
+    private StitchRegion region = StitchRegion.EUROPE;
+    @UriParam(label = "producer")
+    @Metadata(autowired = true)
+    private StitchSchema stitchSchema;
+    @UriParam(label = "producer")
+    private Collection<String> keyNames = new HashSet<>();

Review comment:
       It would be good to also allow to set keyNames as a string value, where they keys are seperated with comma, then its easier to configure in endpoint uri. Some components offer that.

##########
File path: components/camel-stitch/src/main/java/org/apache/camel/component/stitch/StitchEndpoint.java
##########
@@ -0,0 +1,102 @@
+/*
+ * 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.component.stitch;
+
+import org.apache.camel.Category;
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.component.stitch.client.StitchClient;
+import org.apache.camel.component.stitch.client.StitchClientBuilder;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.support.DefaultEndpoint;
+
+/**
+ * Stitch is a cloud ETL service, developer-focused platform for rapidly moving and replicates data from more than 90

Review comment:
       All this becomes a too long description. Can you make a shorter one sentence in the top and end it with a dot. Then the tooling with grab the first sentence and use as description summary in the metadata. 
   
   Too long makes the component table looks bad etc.

##########
File path: components/camel-stitch/src/main/java/org/apache/camel/component/stitch/StitchConfiguration.java
##########
@@ -0,0 +1,163 @@
+/*
+ * 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.component.stitch;
+
+import java.util.Collection;
+import java.util.HashSet;
+
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.component.stitch.client.StitchClient;
+import org.apache.camel.component.stitch.client.StitchRegion;
+import org.apache.camel.component.stitch.client.models.StitchSchema;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.apache.camel.spi.UriPath;
+import reactor.netty.http.client.HttpClient;
+import reactor.netty.resources.ConnectionProvider;
+
+@UriParams
+public class StitchConfiguration implements Cloneable {
+
+    @UriPath
+    private String tableName;
+    @UriParam(label = "security", secret = true)
+    @Metadata(required = true)
+    private String token;
+    @UriParam(label = "producer", defaultValue = "europe")
+    private StitchRegion region = StitchRegion.EUROPE;
+    @UriParam(label = "producer")
+    @Metadata(autowired = true)
+    private StitchSchema stitchSchema;
+    @UriParam(label = "producer")
+    private Collection<String> keyNames = new HashSet<>();
+    @UriParam(label = "producer,advance")

Review comment:
       advanced

##########
File path: components/camel-stitch/src/main/java/org/apache/camel/component/stitch/StitchEndpoint.java
##########
@@ -0,0 +1,102 @@
+/*
+ * 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.component.stitch;
+
+import org.apache.camel.Category;
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.component.stitch.client.StitchClient;
+import org.apache.camel.component.stitch.client.StitchClientBuilder;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.support.DefaultEndpoint;
+
+/**
+ * Stitch is a cloud ETL service, developer-focused platform for rapidly moving and replicates data from more than 90
+ * applications and databases. It integrates various data sources into a central data warehouse. Stitch has integrations
+ * for many enterprise software data sources, and can receive data via WebHooks and an API (Stitch Import API) which
+ * Camel Stitch Component uses to produce the data to Stitch ETL.
+ */
+@UriEndpoint(firstVersion = "3.8.0", scheme = "stitch", title = "Stitch",
+             syntax = "stitch:tableName", producerOnly = true, category = {
+                     Category.CLOUD, Category.API, Category.COMPUTE, Category.BIGDATA })
+public class StitchEndpoint extends DefaultEndpoint {
+
+    @UriParam
+    private StitchConfiguration configuration = new StitchConfiguration();
+
+    private StitchClient stitchClient;
+
+    public StitchEndpoint() {
+    }
+
+    public StitchEndpoint(final String uri, final Component component, final StitchConfiguration configuration) {
+        super(uri, component);
+        this.configuration = configuration;
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
+
+        // since HttpClient.create() will create a pooled a connection when is called, hence placed in doStart
+        if (stitchClient == null) {

Review comment:
       should this stitch client not be stopped at some point?




----------------------------------------------------------------
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 #4936: CAMEL-15933: Add Stitch component to Camel

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



##########
File path: components/camel-stitch/src/main/java/org/apache/camel/component/stitch/StitchEndpoint.java
##########
@@ -0,0 +1,102 @@
+/*
+ * 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.component.stitch;
+
+import org.apache.camel.Category;
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.component.stitch.client.StitchClient;
+import org.apache.camel.component.stitch.client.StitchClientBuilder;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.support.DefaultEndpoint;
+
+/**
+ * Stitch is a cloud ETL service, developer-focused platform for rapidly moving and replicates data from more than 90
+ * applications and databases. It integrates various data sources into a central data warehouse. Stitch has integrations
+ * for many enterprise software data sources, and can receive data via WebHooks and an API (Stitch Import API) which
+ * Camel Stitch Component uses to produce the data to Stitch ETL.
+ */
+@UriEndpoint(firstVersion = "3.8.0", scheme = "stitch", title = "Stitch",
+             syntax = "stitch:tableName", producerOnly = true, category = {
+                     Category.CLOUD, Category.API, Category.COMPUTE, Category.BIGDATA })
+public class StitchEndpoint extends DefaultEndpoint {
+
+    @UriParam
+    private StitchConfiguration configuration = new StitchConfiguration();
+
+    private StitchClient stitchClient;
+
+    public StitchEndpoint() {
+    }
+
+    public StitchEndpoint(final String uri, final Component component, final StitchConfiguration configuration) {
+        super(uri, component);
+        this.configuration = configuration;
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
+
+        // since HttpClient.create() will create a pooled a connection when is called, hence placed in doStart
+        if (stitchClient == null) {

Review comment:
       I guess only when is not provided as configuration option, when it's created by the endpoint it should be stopped, like we did in aws




----------------------------------------------------------------
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] omarsmak commented on pull request #4936: CAMEL-15933: Add Stitch component to Camel

Posted by GitBox <gi...@apache.org>.
omarsmak commented on pull request #4936:
URL: https://github.com/apache/camel/pull/4936#issuecomment-768169818


   @davsclaus @oscerd I have addressed your comments, please take a second look


----------------------------------------------------------------
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] omarsmak merged pull request #4936: CAMEL-15933: Add Stitch component to Camel

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


   


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