Hi Cameleers,
I've created a PR[1], which I think fixes the problem, I encourage
folk to provide feedback and test on your end if possible.

I've tested with the `SubscriptionHelperIntegrationTest`. And manually by:

1/ Starting a streaming app with the route:

from("salesforce:Account?sObjectName=Account&rawPayload=true&sObjectQuery=SELECT
Id, Name FROM Account")¬
.log(LoggingLevel.INFO, "salesforce", "${body}")

2/ creating an Account record, and noticing the output in the
log/console from the `log` component

3/ rejecting traffic to Salesforce using iptables:
$ iptables -A OUTPUT -d 85.222.0.0/16 -j REJECT

4/ disrupting the established connection using ss:
$ ss -K dst 85.222.154.145 # or whatever IP was in the output of lsof
-p $PID -a -i 6 -n

5/ noticing the messages in the log with back-off like:

Connect failure: {failure={exception=java.io.EOFException:
HttpConnectionOverHTTP@45d7880c::DecryptedEndPoint@621bd87d{l=/192.168.1.76:43432,r=eu18.salesforce.com/85.222.155.145:443...
Restarting on unexpected disconnect from Salesforce...
Handshake failure: {failure={exception=java.net.ConnectException:
Connection refused, message={...
Handshake failure: {failure={exception=java.net.ConnectException:
Connection refused, message={...

5/ allowing traffic to Salesforce (removing the rule):
$ iptables -D OUTPUT 4 # happens to be 4th rule that I've added in 3/,
check with iptables -L OUTPUT --line-numbers

6/ seeing consumer reconnecting:

Set Replay extension to replay from `-1` for channel `/topic/Account`
Subscribing to channel /topic/Account...
Successfully restarted!
Subscribed to channel /topic/Account

7/ creating a new Account record, and seeing the message logged from
the `log` component.

zoran

[1] https://github.com/apache/camel/pull/4778

--
Zoran Regvart

Reply via email to