Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15117

camel-salesforce - Consuming a subscribed message during shutdown causes NPE

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.0
    • Component/s: camel-salesforce
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      It seems that, sporadically, the code may throw an NPE.

       

      I am speculating*because I cannot confirm entirely due to the sporadic nature of the issue, but by looking at the logs and the behavior, it seems that the onMessage handler for subscriptions can still be called during the shutdown.

       

      2020-05-27 09:19:21,017 [orceConnector-0] INFO org.apache.camel.impl.engine.DefaultShutdownStrategy - Graceful shutdown of 1 routes completed in 0 seconds
      2020-05-27 09:19:21,018 [orceConnector-0] DEBUG org.cometd.client.BayeuxClient.67a9cb3f - State updated: CONNECTED -> DISCONNECTING
      2020-05-27 09:19:21,018 [orceConnector-0] DEBUG org.cometd.client.BayeuxClient.67a9cb3f - Sending messages [\{clientId=hr1cjxz3pqn37al6x32wuz369e0, channel=/meta/disconnect, id=19}]
      2020-05-27 09:19:21,018 [orceConnector-0] DEBUG org.cometd.client.BayeuxClient.67a9cb3f - Sent disconnect {clientId=hr1cjxz3pqn37al6x32wuz369e0, channel=/meta/disconnect, id=19}
      2020-05-27 09:19:21,018 [orceConnector-0] DEBUG org.cometd.client.BayeuxClient.67a9cb3f - Notifying threads in waitFor()
      2020-05-27 09:19:21,018 [orceConnector-0] DEBUG org.cometd.client.BayeuxClient.67a9cb3f - Waiting 60000ms for [DISCONNECTED]
      2020-05-27 09:19:21,147 [nt@4ae82baa-204] DEBUG org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper$5 - Received messages [\{clientId=hr1cjxz3pqn37al6x32wuz369e0, channel=/meta/disconnect, id=19, successful=true}]09:19:21,147 [nt@4ae82baa-204] DEBUG org.cometd.client.BayeuxClient.67a9cb3f - Processing {clientId=hr1cjxz3pqn37al6x32wuz369e0, channel=/meta/disconnect, id=19, successful=true}
      2020-05-27 09:19:21,147 [nt@4ae82baa-204] DEBUG org.cometd.client.BayeuxClient.67a9cb3f - State updated: DISCONNECTING -> TERMINATING
      2020-05-27 09:19:21,147 [nt@4ae82baa-203] DEBUG org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper$5 - Received messages [\{clientId=hr1cjxz3pqn37al6x32wuz369e0, channel=/meta/connect, id=17, successful=true}]27 09:19:21,147 [nt@4ae82baa-203] DEBUG org.cometd.client.BayeuxClient.67a9cb3f - Processing {clientId=hr1cjxz3pqn37al6x32wuz369e0, channel=/meta/connect, id=17, successful=true}
      2020-05-27 09:19:21,148 [nt@4ae82baa-204] DEBUG org.cometd.client.BayeuxClient.67a9cb3f - State updated: TERMINATING -> DISCONNECTED
      2020-05-27 09:19:21,148 [nt@4ae82baa-204] DEBUG org.cometd.client.BayeuxClient.67a9cb3f - Notifying threads in waitFor()
      2020-05-27 09:19:21,148 [orceConnector-0] DEBUG org.cometd.client.BayeuxClient.67a9cb3f - Waited 129/60000ms for [DISCONNECTED], state is DISCONNECTED
      2020-05-27 09:19:21,148 [nt@4ae82baa-203] DEBUG org.cometd.client.BayeuxClient.67a9cb3f - State not updated: DISCONNECTED -> CONNECTED
      2020-05-27 09:19:21,148 [nt@4ae82baa-203] DEBUG org.cometd.client.BayeuxClient.67a9cb3f - Notifying threads in waitFor()
      2020-05-27 09:19:21,169 [nt@4ae82baa-209] DEBUG org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper$5 - Received messages [\{clientId=hr1cjxz3pqn37al6x32wuz369e0, channel=/meta/subscribe, id=18, subscription=/topic/CamelKafkaConnectorTopic, successful=true}]td.client.BayeuxClient.67a9cb3f - Processing {clientId=hr1cjxz3pqn37al6x32wuz369e0, channel=/meta/subscribe, id=18, subscription=/topic/CamelKafkaConnectorTopic, successful=true}7 09:19:21,169 [nt@4ae82baa-209] DEBUG org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper - [CHANNEL:META_SUBSCRIBE]: {clientId=hr1cjxz3pqn37al6x32wuz369e0, channel=/meta/subscribe, id=18, subscription=/topic/CamelKafkaConnectorTopic, successful=true}mel.component.salesforce.internal.streaming.SubscriptionHelper - Subscribed to channel /topic/CamelKafkaConnectorTopic
      2020-05-27 09:19:21,169 [nt@4ae82baa-209] INFO org.cometd.bayeux.client.ClientSession - Exception while invoking listener org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper$7@62e79206
      java.lang.NullPointerException: null
      at org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper$7.onMessage(SubscriptionHelper.java:458) ~[camel-salesforce-3.3.0.jar:3.3.0]
      at org.cometd.common.AbstractClientSession$AbstractSessionChannel.notifyOnMessage(AbstractClientSession.java:583) ~[cometd-java-common-4.0.4.jar:4.0.4]
      at org.cometd.common.AbstractClientSession$AbstractSessionChannel.notifyMessageListeners(AbstractClientSession.java:568) ~[cometd-java-common-4.0.4.jar:4.0.4]
      at org.cometd.common.AbstractClientSession.notifyListeners(AbstractClientSession.java:308) ~[cometd-java-common-4.0.4.jar:4.0.4]
      at org.cometd.common.AbstractClientSession.lambda$receive$4(AbstractClientSession.java:269) ~[cometd-java-common-4.0.4.jar:4.0.4]
      at org.cometd.bayeux.Promise$2.succeed(Promise.java:103) [bayeux-api-4.0.4.jar:4.0.4]
      ...

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                orpiske Otavio Rodolfo Piske
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: