etzel-mes opened a new pull request, #28212:
URL: https://github.com/apache/camel/pull/28212

   # Description
   
   A `milo-client` consumer whose monitored item the server refuses (for 
example `Bad_NodeIdUnknown`, or a namespace URI that is not in the namespace 
table yet) is reported once with the status of the refusal, and the item is not 
created again until the route restarts or the connection is rebuilt. In 
automation the node often arrives later: a PLC program or tag configuration 
deployed after the integration started, a server whose address space is built 
after it accepts sessions, a tag removed and added again by an engineering 
change.
   
   With this change the refused nodes of a connection are created again every 
10 seconds (the existing reconnect interval, no new option) in one 
`CreateMonitoredItems` request, while the connection lasts. A node that the 
server refuses again is logged at DEBUG and nothing is delivered; the created 
item delivers the current value of the node as its first value, which also ends 
the refusal. The attempt is skipped while the session is not active. A request 
that fails is made again 10 seconds later and never rebuilds the connection, so 
it cannot interrupt the nodes that are monitored; a lost session or 
subscription is recovered as before. A stopped consumer is not retried. The 
namespace table is read once per attempt, so a namespace that the server adds 
later is found.
   
   The issue proposed reusing the `badSubscriptions` resubscribe. CAMEL-25671 
removed it because it could not be reached, so the retry is new code on the 
executors of the connection from CAMEL-25713.
   
   Tests: `MonitoredItemRetryTest` (node added later, namespace added later, 
stopped consumer), the extended `MonitorItemLifecycleTest` (node removed and 
added again in the same session) and `CommunicationLossTest` (node refused 
across an outage; the skipped attempt holds no lock). The tests of the first 
three cases fail without the change (rerun=0); the stopped-consumer test pins 
that a stopped consumer is not created again. The behaviour was also run 
against a real OPC UA server (node-opcua): a node added later, a node removed 
and added again, a namespace added later, 20 s and 45 s silent network drops 
while a node is refused, a route stopped while its node is refused, and two 
nodes refused for 3 minutes (one request every 10 seconds).
   
   Docs: the component page ("Monitoring several nodes") and the 4.24 upgrade 
note on monitored items.
   
   Fixes CAMEL-25692.
   
   @davsclaus @oscerd
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [x] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
   
   _Claude Code on behalf of etzel-mes_
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to