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

davsclaus pushed a commit to branch camel-4.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-4.22.x by this push:
     new ac30946fe619 [backport camel-4.22.x] CAMEL-26779: camel-snmp - the 
consumer can run its first poll before it is started (#29502)
ac30946fe619 is described below

commit ac30946fe61983bbe70ff7b592c608eaac4fe8f8
Author: Salvatore Mongiardo <[email protected]>
AuthorDate: Tue Nov 10 07:45:37 2026 +0100

    [backport camel-4.22.x] CAMEL-26779: camel-snmp - the consumer can run its 
first poll before it is started (#29502)
---
 .../src/main/java/org/apache/camel/component/snmp/SnmpOIDPoller.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpOIDPoller.java
 
b/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpOIDPoller.java
index 71a24ebe25ac..8fed161bcbff 100644
--- 
a/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpOIDPoller.java
+++ 
b/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpOIDPoller.java
@@ -58,8 +58,6 @@ public class SnmpOIDPoller extends ScheduledPollConsumer 
implements ResponseList
 
     @Override
     protected void doStart() throws Exception {
-        super.doStart();
-
         this.targetAddress = 
GenericAddress.parse(this.endpoint.getServerAddress());
 
         // either tcp or udp
@@ -84,6 +82,9 @@ public class SnmpOIDPoller extends ScheduledPollConsumer 
implements ResponseList
         if (LOG.isInfoEnabled()) {
             LOG.info("Started OID poller on {} using {} protocol", 
endpoint.getServerAddress(), endpoint.getProtocol());
         }
+
+        // start the scheduler last, so the first poll cannot run before snmp, 
the target and the transport are ready
+        super.doStart();
     }
 
     @Override

Reply via email to