James Netherton created CAMEL-27900:
---------------------------------------
Summary: camel-salesforce: streaming consumer does not retry a
failed subscription after a successful reconnect
Key: CAMEL-27900
URL: https://issues.apache.org/jira/browse/CAMEL-27900
Project: Camel
Issue Type: Bug
Components: camel-salesforce
Reporter: James Netherton
Assignee: James Netherton
{{SubscriptionHelperManualIT.shouldResubscribeOnSubscriptionFailure}} fails
consistently:
{noformat}
ConditionTimeoutException: Condition with Lambda expression in
org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelperManualIT
was not fulfilled within 10 seconds.
at
...SubscriptionHelperManualIT.shouldResubscribeOnSubscriptionFailure(SubscriptionHelperManualIT.java:405)
{noformat}
The test runs against a local stub server, so it does not need a Salesforce
org, and it fails on every run, not only under load. It:
# answers the first {{/meta/subscribe}} for {{/topic/Contact}} with
{{"successful": false}} and no error
# sends a successful {{/meta/connect}}
# expects {{SubscriptionHelper}} to subscribe to {{/topic/Contact}} again
The helper never retries. {{subscriptionFailed}} does not treat the failure as
temporary, so it gives up and passes the error to the consumer's exception
handler. A successful {{/meta/connect}} only subscribes the channels in
{{channelsToSubscribe}}, and the failed channel is never added back to it.
Suspected cause, not confirmed by bisecting: CAMEL-23391 (commit d758b2d18347)
removed {{channelsToSubscribe.add()}} from {{subscribe()}} to stop duplicate
event delivery. Before that, a channel stayed in {{channelsToSubscribe}} until
a subscription succeeded, so the next successful connect retried it.
Impact: a streaming consumer whose subscription is rejected stays unsubscribed
after the connection recovers, until the next handshake or a restart of the
route.
The failure went unnoticed because {{*ManualIT}} tests do not run in CI. As
this test only needs the stub server, it could run as a regular unit test.
To be decided: whether the retry should come back without bringing back the
duplicate delivery fixed by CAMEL-23391, or whether giving up is now the
intended behaviour and the test should change.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)