gnodet-bot commented on code in PR #27906:
URL: https://github.com/apache/camel/pull/27906#discussion_r4284889391
##########
components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java:
##########
@@ -281,29 +283,17 @@ public List<PendingValue> putSubscriptions(final
Map<UInteger, Subscription> sub
}
}
- if (!this.badSubscriptions.isEmpty()) {
- SubscriptionManager.this.executor.schedule(this::resubscribe,
SubscriptionManager.this.reconnectTimeout,
- TimeUnit.MILLISECONDS);
- }
-
return pendingValues;
}
- private void handleSubscriptionError(
- final StatusCode statusCode, final UInteger clientHandle,
final Subscription s,
- final List<PendingValue> pendingValues) {
- this.badSubscriptions.put(clientHandle, s);
- pendingValues.add(new PendingValue(s.getValueConsumer(), new
DataValue(statusCode)));
- }
-
- private void resubscribe() {
- final Map<UInteger, Subscription> subscriptions = new
HashMap<>(this.badSubscriptions);
- this.badSubscriptions.clear();
- try {
- putSubscriptions(subscriptions).forEach(PendingValue::deliver);
- } catch (final Exception e) {
- handleConnectionFailure(e);
- }
+ /**
+ * @return the node ID with the namespace index of the server, or null
if its namespace URI is not in the
+ * namespace table of the server
+ */
+ private NodeId lookupMonitoredNode(final ExpandedNodeId nodeId) throws
Exception {
+ final String uri = nodeId.getNamespaceUri();
+ final UShort index = uri == null ? nodeId.getNamespaceIndex() :
lookupNamespaceIndex(uri).get();
Review Comment:
💡 **Minor (no regression):** `lookupNamespaceIndex(uri).get()` blocks the
calling thread. Same pattern as the old `lookupNamespace(...).get()` — no
change in behaviour here — but if this executes on an OPC-UA I/O thread, a
follow-up to make the call async could improve responsiveness.
--
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]