You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "jsight (via GitHub)" <gi...@apache.org> on 2023/06/07 16:43:43 UTC

[GitHub] [camel] jsight opened a new pull request, #10286: CAMEL-19409: Allow clients to manually restart the subscription

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

   # Description
   
   <!--
   - Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   -->
   
   # 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).
   
   <!--
   # *Note*: trivial changes like, typos, minor documentation fixes and other small items do not require a JIRA issue. In this case your pull request should address just this issue, without pulling in other changes.
   -->
   
   # Apache Camel coding standards and style
   
   - [ ] I checked that each commit in the pull request has 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.
   -->
   
   - [ ] I formatted the code using `mvn -Pformat,fastinstall install && mvn -Psourcecheck`
   
   <!-- 
   You can run the aforementioned command in your module so that the build auto-formats your code and the source check verifies that is complies with our coding style. This will also be verified as part of the checks and your PR may be rejected if the checkstyle does not pass.
   
   You can learn more about the contribution guidelines at https://github.com/apache/camel/blob/main/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.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] jsight commented on a diff in pull request #10286: CAMEL-19409: Allow clients to manually restart the subscription

Posted by "jsight (via GitHub)" <gi...@apache.org>.
jsight commented on code in PR #10286:
URL: https://github.com/apache/camel/pull/10286#discussion_r1223208222


##########
components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java:
##########
@@ -290,6 +294,24 @@ protected void doStart() throws Exception {
         subscribed = true;
     }
 
+    /**
+     * If alsoStopSubscription is added, any underlying subscriptions will be stopped as well.
+     *
+     * SubscriptionHelper also logs out, so this will terminate the salesforce session as well.
+     *
+     * @param alsoStopSubscription
+     */
+    public void stop(boolean alsoStopSubscription) {
+        stop();
+        if (alsoStopSubscription) {
+            try {
+                subscriptionHelper.stop();
+            } catch (Exception e) {
+                LOG.warn("Failed to stop subscription due to: " + e.getMessage());

Review Comment:
   Thank you, that is an excellent point. I have updated the line.



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

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


[GitHub] [camel] davsclaus commented on a diff in pull request #10286: CAMEL-19409: Allow clients to manually restart the subscription

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #10286:
URL: https://github.com/apache/camel/pull/10286#discussion_r1225763608


##########
components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java:
##########
@@ -290,6 +294,24 @@ protected void doStart() throws Exception {
         subscribed = true;
     }
 
+    /**
+     * If alsoStopSubscription is added, any underlying subscriptions will be stopped as well.
+     *
+     * SubscriptionHelper also logs out, so this will terminate the salesforce session as well.
+     *
+     * @param alsoStopSubscription
+     */
+    public void stop(boolean alsoStopSubscription) {
+        stop();
+        if (alsoStopSubscription) {
+            try {

Review Comment:
   We could add a LOG.info here about manually stopping invoked - this may be good to have in the logs so end users can see this was invoked on purpose



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

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


[GitHub] [camel] github-actions[bot] commented on pull request #10286: CAMEL-19409: Allow clients to manually restart the subscription

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10286:
URL: https://github.com/apache/camel/pull/10286#issuecomment-1581183719

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :warning: Please note that the changes on this PR may be **tested automatically**. 
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


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

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


[GitHub] [camel] github-actions[bot] commented on pull request #10286: CAMEL-19409: Allow clients to manually restart the subscription

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10286:
URL: https://github.com/apache/camel/pull/10286#issuecomment-1581264468

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 1 | 1 | 0 | 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-unsubscribe@camel.apache.org

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


[GitHub] [camel] jsight commented on a diff in pull request #10286: CAMEL-19409: Allow clients to manually restart the subscription

Posted by "jsight (via GitHub)" <gi...@apache.org>.
jsight commented on code in PR #10286:
URL: https://github.com/apache/camel/pull/10286#discussion_r1223285207


##########
components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java:
##########
@@ -290,6 +294,24 @@ protected void doStart() throws Exception {
         subscribed = true;
     }
 
+    /**
+     * If alsoStopSubscription is added, any underlying subscriptions will be stopped as well.
+     *
+     * SubscriptionHelper also logs out, so this will terminate the salesforce session as well.
+     *
+     * @param alsoStopSubscription
+     */
+    public void stop(boolean alsoStopSubscription) {
+        stop();
+        if (alsoStopSubscription) {
+            try {
+                subscriptionHelper.stop();
+            } catch (Exception e) {
+                LOG.warn("Failed to stop subscription due to: " + e.getMessage());

Review Comment:
   Oh, of course. Sorry I overlooked that part. I have updated the code.



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

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


[GitHub] [camel] orpiske commented on a diff in pull request #10286: CAMEL-19409: Allow clients to manually restart the subscription

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on code in PR #10286:
URL: https://github.com/apache/camel/pull/10286#discussion_r1223221220


##########
components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java:
##########
@@ -290,6 +294,24 @@ protected void doStart() throws Exception {
         subscribed = true;
     }
 
+    /**
+     * If alsoStopSubscription is added, any underlying subscriptions will be stopped as well.
+     *
+     * SubscriptionHelper also logs out, so this will terminate the salesforce session as well.
+     *
+     * @param alsoStopSubscription
+     */
+    public void stop(boolean alsoStopSubscription) {
+        stop();
+        if (alsoStopSubscription) {
+            try {
+                subscriptionHelper.stop();
+            } catch (Exception e) {
+                LOG.warn("Failed to stop subscription due to: " + e.getMessage());

Review Comment:
   Thanks. Just a note: I meant without concatenating the log string at all.
   
   Use log marker like this:
   
   ```
   LOG.warn("Failed to stop subscription due to: {}", e.getMessage(), e);
   ```
   
   Instead of concatenating the last part of the log message:
   ```
   LOG.warn("Failed to stop subscription due to: " + e.getMessage(), e);
   ```
   
   
   



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

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


[GitHub] [camel] orpiske commented on a diff in pull request #10286: CAMEL-19409: Allow clients to manually restart the subscription

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on code in PR #10286:
URL: https://github.com/apache/camel/pull/10286#discussion_r1222500597


##########
components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java:
##########
@@ -290,6 +294,24 @@ protected void doStart() throws Exception {
         subscribed = true;
     }
 
+    /**
+     * If alsoStopSubscription is added, any underlying subscriptions will be stopped as well.
+     *
+     * SubscriptionHelper also logs out, so this will terminate the salesforce session as well.
+     *
+     * @param alsoStopSubscription
+     */
+    public void stop(boolean alsoStopSubscription) {
+        stop();
+        if (alsoStopSubscription) {
+            try {
+                subscriptionHelper.stop();
+            } catch (Exception e) {
+                LOG.warn("Failed to stop subscription due to: " + e.getMessage());

Review Comment:
   This should be: 
   
   ```
                   LOG.warn("Failed to stop subscription due to: {}", e.getMessage(), e);
   ```



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

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


[GitHub] [camel] davsclaus merged pull request #10286: CAMEL-19409: Allow clients to manually restart the subscription

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #10286:
URL: https://github.com/apache/camel/pull/10286


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

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