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

Jesse Sightler commented on CAMEL-19409:
----------------------------------------

I made a few changes:
{{code}}
-                        } else if 
(failureReason.equals(AUTHENTICATION_INVALID)) {
+                        } else if (error != null && 
error.equals(AUTHENTICATION_INVALID)) {
+                            LOG.info(
+                                    "attempting login due to handshake error: 
403 -> 401::Authentication invalid");
+                            attemptLoginUntilSuccessful();
+                            subscribe(topicName, consumer, true);
+                        } else if (msg != null && 
msg.equals(AUTHENTICATION_INVALID)) {
+                            LOG.info(
+                                    "attempting login due to handshake error: 
403 -> 401::Authentication invalid");
+                            attemptLoginUntilSuccessful();
+                            subscribe(topicName, consumer, true);
+                        } else if (failureReason != null && 
failureReason.equals(AUTHENTICATION_INVALID)) {

{{code}}

With these changes, it seems to momentraily get stuck in a loop trying to auth. 
However, after some minutes it does seem to recover on its own. I guess that is 
an improvement? :)

IMO, the ideal response in this state is actually to restart the whole 
connection instead of just subscribing again, though. Just subscribing again on 
the same connection doesn't seem to be enough, as the underlying connection has 
been invalidated by the other end.

> camel-salesforce - Can not re-subscribe to CDC channel data/ChangeEvents
> ------------------------------------------------------------------------
>
>                 Key: CAMEL-19409
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19409
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-salesforce
>    Affects Versions: 3.18.3, 3.19.0
>            Reporter: Iva
>            Priority: Major
>             Fix For: 3.20.7, 3.21.1, 4.0.0
>
>         Attachments: stack-with-pr.txt, stacktrace.txt
>
>
> Hello, I have problem with connection to the salesforce channel ChangeEvents. 
> I am using quarkus - version 2.13.7 and camel with version 3.18.3 and when an 
> error occurs my application is not re-subscribing to the channel after that. 
> Do you know if it is problem from the camel version or do you have any idea 
> how I can fix it? Thank you in advance
> Edit 1: You can find the stacktrace of the exception in this file 
> [^stacktrace.txt] 
> The problem seems to be fixed after a restart of the pod but it is not 
> relevant solution. I have seen similar issue that is said to be fixed in 
> version 3.14  but it looks like now I have the same problem in latest version 
> https://issues.apache.org/jira/browse/CAMEL-16370 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to