gnodet-bot commented on code in PR #28819:
URL: https://github.com/apache/camel/pull/28819#discussion_r4504089903
##########
core/camel-api/src/main/java/org/apache/camel/ExchangeExtension.java:
##########
@@ -382,4 +382,21 @@ default void setSharedUnitOfWork(@Nullable UnitOfWork
unitOfWork) {
*/
boolean isExternalRedelivered(Message message);
+ /**
+ * The time from the {@code nanoTime} clock when the last node of this
exchange ended, or 0 if it must not be used.
+ * The statistics of the next node start at this time, which avoids
reading the clock. This is only for internal use
+ * by Camel.
+ *
+ * @since 4.24
+ */
+ long getLastNodeEndNanos();
+
+ /**
+ * Sets the time when the last node of this exchange ended, or 0 if it
must not be used. This is only for internal
+ * use by Camel.
+ *
+ * @see #getLastNodeEndNanos()
+ * @since 4.24
+ */
+ void setLastNodeEndNanos(long nanos);
Review Comment:
`setSharedUnitOfWork` (also `@since 4.24`, line 85 in this file) was added
as a `default` method — that's the established pattern for new
`ExchangeExtension` additions. These two methods are abstract, which breaks any
third-party code that implements `ExchangeExtension`. Since `0` / no-op are the
correct fallbacks for implementations that don't participate in the
optimization, `default` costs nothing here and is strictly safer.
```java
default long getLastNodeEndNanos() {
return 0;
}
/**
* Sets the time when the last node of this exchange ended, or 0 if it
must not be used. This is only for internal
* use by Camel.
*
* @see #getLastNodeEndNanos()
* @since 4.24
*/
default void setLastNodeEndNanos(long nanos) {
}
```
--
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]