This is an automated email from the ASF dual-hosted git repository.

Croway pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 139c10fcf0ac camel-salesforce: Handle empty channel name in 
subscription listener
139c10fcf0ac is described below

commit 139c10fcf0acf466e15db95f112e6d3cc7dc6c77
Author: shaipan <[email protected]>
AuthorDate: Wed Apr 29 17:55:29 2026 +0530

    camel-salesforce: Handle empty channel name in subscription listener
---
 .../salesforce/internal/streaming/SubscriptionHelper.java      | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git 
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java
 
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java
index d62e539d3226..6035fb66676e 100644
--- 
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java
+++ 
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java
@@ -180,6 +180,16 @@ public class SubscriptionHelper extends ServiceSupport {
             LOG.debug("[CHANNEL:META_SUBSCRIBE]: {}", message);
             var channelName = message.getOrDefault(SUBSCRIPTION_FIELD, 
"").toString();
             if (!message.isSuccessful()) {
+                if (channelName.isEmpty()) {
+                    Map<String, Object> advice = message.getAdvice();
+                    if (advice != null && 
"handshake".equals(advice.get("reconnect"))) {
+                        LOG.warn("Subscription failure: empty channel, advice 
== handshake, so handshaking");
+                        client.handshake();
+                    } else {
+                        LOG.error("Subscription failure: empty channel and no 
handshake advice");
+                    }
+                    return;
+                }
                 LOG.warn("Subscription failure: {}", message);
                 var consumers = channelToConsumers.getOrDefault(channelName, 
emptySet());
                 consumers.stream().findFirst().ifPresent(salesforceConsumer -> 
subscriptionFailed(salesforceConsumer, message));

Reply via email to