davsclaus commented on code in PR #28045:
URL: https://github.com/apache/camel/pull/28045#discussion_r4307398183
##########
components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java:
##########
@@ -445,14 +437,24 @@ public void dispose() {
}
}
+ /**
+ * @return the node ID with the namespace index of the server,
completed with null if its namespace URI is not
+ * in the namespace table of the server: such a node does not
exist on the server
+ */
private CompletableFuture<NodeId> lookupNamespace(final ExpandedNodeId
nodeId) {
LOG.trace("Expanded Node Id: {}", nodeId);
final String uri = nodeId.getNamespaceUri();
if (uri != null) {
LOG.trace("Looking up namespace: {}", uri);
- return lookupNamespaceIndex(uri).thenApply(index ->
toNodeId(index, nodeId));
+ return lookupNamespaceIndex(uri).thenApply(index -> {
+ if (index == null) {
Review Comment:
Nit: `lookupNamespaceIndex` also completes with `null` when the read of
`Server_NamespaceArray` returns a value that is not a `String[]`, for example a
bad status for that read. That case now looks like an unknown URI:
`Bad_NodeIdUnknown`, and this DEBUG line. It is rare, the result is not cached
so the next request tries again, and the consumer has behaved the same way
since CAMEL-25671. So it is fine to leave as it is. You could make
`lookupNamespaceIndex` fail the future on a bad status, so that a failed lookup
is not reported as an unknown namespace.
--
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]