gnodet-bot commented on code in PR #26805:
URL: https://github.com/apache/camel/pull/26805#discussion_r4085152925


##########
core/camel-api/src/main/java/org/apache/camel/spi/AsyncProcessorAwaitManager.java:
##########
@@ -122,6 +122,17 @@ interface AwaitThread {
         @Nullable
         String getNodeId();
 
+        /**
+         * Where the node is in the source, such as {@code 
orders.camel.yaml:18}
+         * <p/>
+         * Is <tt>null</tt> if message history or source location is disabled.
+         *
+         * @since 4.23
+         */
+        default String getNodeSource() {

Review Comment:
   ⚠️ **Missing `@Nullable`** — 
`InflightRepository.InflightExchange.getNodeSource()` correctly carries 
`@Nullable` (added on the same method in `InflightRepository.java`). The 
Javadoc already documents the null case; the annotation should be consistent so 
static-analysis tools and callers that process both interfaces identically get 
the same null-safety signal.
   
   ```suggestion
            */
           @Nullable
           default String getNodeSource() {
   ```



##########
core/camel-core/src/test/java/org/apache/camel/impl/InflightRepositoryNodeSourceTest.java:
##########
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.impl;
+
+import java.util.Collection;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.regex.Pattern;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.spi.InflightRepository;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * An inflight exchange says where the node it sits at is in the source, so 
whoever reads the inflight list - the dev
+ * console, JMX, or the shutdown strategy naming what is holding the shutdown 
up - can go to the line (CAMEL-24975).
+ */
+public class InflightRepositoryNodeSourceTest extends ContextTestSupport {
+
+    /** Such as InflightRepositoryNodeSourceTest:73 */
+    private static final Pattern SOURCE = Pattern.compile("\\S+:\\d+");
+
+    private final AtomicReference<String> nodeSource = new AtomicReference<>();
+

Review Comment:
   💡 **No test for the blocked-thread path** — the PR covers 
`InflightRepository` (this test) and JMX 
(`ManagedInflightRepositoryNodeSourceTest`), but there is no test asserting 
that `AsyncProcessorAwaitManager.AwaitThread.getNodeSource()` surfaces the 
right value when an exchange is actually blocked. `BlockedConsoleTest` only 
checks the empty-state case and is not updated.
   
   The `DefaultAsyncProcessorAwaitManager.AwaitThread` impl delegates to 
`exchange.getExchangeExtension().getHistoryNodeSource()` — same backing field, 
so it likely works — but the path is untested. A simple test that parks an 
exchange behind a `CountDownLatch` inside a processor, calls 
`awaitManager.browse()`, asserts `getNodeSource()` is non-null, then releases 
the latch would provide the missing coverage.



-- 
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