You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/05/13 12:10:28 UTC
[PR] Improve Javadoc across camel-api: URLs, Exchange, SPI contracts, and exception constructors [camel]
gnodet opened a new pull request, #23193:
URL: https://github.com/apache/camel/pull/23193
## Summary
Third batch of Javadoc improvements for the camel-api module:
- **HTTPS URLs**: Update all 67 `http://camel.apache.org` URLs to `https://` across 39 files
- **Broken link fix**: Replace dead Spring 2.5.x API link in `Synchronization.java` with plain code reference
- **Exchange rewrite**: Rewrite class-level Javadoc to lead with `getMessage()` instead of deprecated `getIn()/getOut()` pattern
- **SPI contracts**: Add contract documentation to `Language`, `AggregationRepository`, and `DataFormatFactory` explaining lifecycle, thread-safety, and usage
- **Exception constructors**: Add `@param` tags to constructors of 20 most important exception classes (CamelExecutionException, NoSuchBeanException, FailedToCreateRouteException, PropertyBindingException, etc.)
- **StreamCacheException**: Add missing class-level Javadoc
All changes are Javadoc-only — no functional code modified. 64 files changed, 327 insertions, 105 deletions.
## Test plan
- [x] `mvn install -pl core/camel-api -DskipTests` passes
- [x] Formatter applied (`mvn formatter:format impsort:sort`)
- [x] No generated file changes needed
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve Javadoc across camel-api: URLs, Exchange, SPI contracts, and exception constructors [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23193:
URL: https://github.com/apache/camel/pull/23193#issuecomment-4440814210
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
* You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve Javadoc across camel-api: URLs, Exchange, SPI contracts, and exception constructors [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23193:
URL: https://github.com/apache/camel/pull/23193#issuecomment-4441560487
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `core/camel-api`
> :information_source: Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the `test-dependents` label to force testing all dependents.
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/25801261748)
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve Javadoc across camel-api: URLs, Exchange, SPI contracts, and exception constructors [camel]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #23193:
URL: https://github.com/apache/camel/pull/23193
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve Javadoc across camel-api: URLs, Exchange, SPI contracts, and exception constructors [camel]
Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier commented on code in PR #23193:
URL: https://github.com/apache/camel/pull/23193#discussion_r3234287157
##########
core/camel-api/src/main/java/org/apache/camel/package-info.java:
##########
@@ -18,7 +18,7 @@
* The core Camel API.
*/
@NullMarked
-@XmlSchema(namespace = "http://camel.apache.org/schema/spring",
+@XmlSchema(namespace = "https://camel.apache.org/schema/spring",
Review Comment:
I do not think that namespace can be changed
##########
core/camel-api/src/main/java/org/apache/camel/spi/Synchronization.java:
##########
@@ -22,8 +22,7 @@
/**
* Provides a hook for custom {@link org.apache.camel.Processor} or {@link org.apache.camel.Component} instances to
* respond to completed or failed processing of an {@link Exchange} rather like Spring's
- * <a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/transaction/
- * support/TransactionSynchronization.html">TransactionSynchronization</a>
+ * {@code TransactionSynchronization}
Review Comment:
it was pointing to Spring class, I guess that when using just @code without fqcn it expects to point ot an internal class in same package
##########
core/camel-api/src/main/java/org/apache/camel/InvalidPayloadRuntimeException.java:
##########
@@ -27,21 +27,41 @@ public class InvalidPayloadRuntimeException extends RuntimeExchangeException {
private final transient @Nullable Class<?> type;
+ /**
+ * @param exchange the exchange that caused the error
+ * @param type the expected body type
+ */
public InvalidPayloadRuntimeException(Exchange exchange, Class<?> type) {
this(exchange, type, exchange.getIn());
}
+ /**
+ * @param exchange the exchange that caused the error
+ * @param type the expected body type
+ * @param cause the cause of the failure
+ */
public InvalidPayloadRuntimeException(Exchange exchange, Class<?> type, Throwable cause) {
this(exchange, type, exchange.getIn(), cause);
}
+ /**
+ * @param exchange the exchange that caused the error
+ * @param type the expected body type
+ * @param message the message whose body could not be converted
Review Comment:
is it really only when the body cannot be converted? I understand from the class name that the payload is invalid but ther ei no assumption that it will be converted
##########
core/camel-api/src/main/java/org/apache/camel/Exchange.java:
##########
@@ -39,28 +39,14 @@
* An Exchange is created when a {@link Consumer} receives a request. A new {@link Message} is created, the request is
* set as the body of the {@link Message} and depending on the {@link Consumer} other {@link Endpoint} and protocol
* related information is added as headers on the {@link Message}. Then an Exchange is created and the newly created
- * {@link Message} is set as the in on the Exchange. Therefore, an Exchange starts its life in a {@link Consumer}. The
- * Exchange is then sent down the {@link Route} for processing along a {@link Processor} chain. The {@link Processor} as
- * the name suggests is what processes the {@link Message} in the Exchange and Camel, in addition to providing
- * out-of-the-box a large number of useful processors, it also allows you to create your own. The rule Camel uses is to
- * take the out {@link Message} produced by the previous {@link Processor} and set it as the in for the next
- * {@link Processor}. If the previous {@link Processor} did not produce an out, then the in of the previous
- * {@link Processor} is sent as the next in. At the end of the processing chain, depending on the {@link ExchangePattern
- * Message Exchange Pattern} (or MEP) the last out (or in of no out available) is sent by the {@link Consumer} back to
- * the original caller.
+ * {@link Message} is set on the Exchange. Therefore, an Exchange starts its life in a {@link Consumer}. The Exchange is
+ * then sent down the {@link Route} for processing along a {@link Processor} chain. The {@link Processor} as the name
+ * suggests is what processes the {@link Message} in the Exchange. Camel provides a large number of useful processors
+ * out-of-the-box, and it also allows you to create your own.
* <p/>
- * Camel, in addition to providing out-of-the-box a large number of useful processors, it also allows you to implement
- * and use your own. When the Exchange is passed to a {@link Processor}, it always contains an in {@link Message} and no
- * out {@link Message}. The {@link Processor} <b>may</b> produce an out, depending on the nature of the
- * {@link Processor}. The in {@link Message} can be accessed using the {@link #getIn()} method. Since the out message is
- * null when entering the {@link Processor}, the {@link #getOut()} method is actually a convenient factory method that
- * will lazily instantiate a {@link org.apache.camel.support.DefaultMessage} which you could populate. As an alternative
- * you could also instantiate your specialized {@link Message} and set it on the exchange using the
- * {@link #setOut(org.apache.camel.Message)} method. Please note that a {@link Message} contains not only the body but
- * also headers and attachments. If you are creating a new {@link Message} the headers and attachments of the in
- * {@link Message} are not automatically copied to the out by Camel, and you'll have to set the headers and attachments
- * you need yourself. If your {@link Processor} is not producing a different {@link Message} but only needs to slightly
- * modify the in, you can simply update the in {@link Message} returned by {@link #getIn()}.
+ * To access or modify the current message, use the {@link #getMessage()} method. Camel uses {@link #getMessage()} to
+ * obtain the current message during routing. If a {@link Processor} modifies the message, those changes are visible to
+ * subsequent processors.
Review Comment:
what is the reason to remove several details?
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve Javadoc across camel-api: URLs, Exchange, SPI contracts, and exception constructors [camel]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #23193:
URL: https://github.com/apache/camel/pull/23193#discussion_r3234500763
##########
core/camel-api/src/main/java/org/apache/camel/spi/Synchronization.java:
##########
@@ -22,8 +22,7 @@
/**
* Provides a hook for custom {@link org.apache.camel.Processor} or {@link org.apache.camel.Component} instances to
* respond to completed or failed processing of an {@link Exchange} rather like Spring's
- * <a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/transaction/
- * support/TransactionSynchronization.html">TransactionSynchronization</a>
+ * {@code TransactionSynchronization}
Review Comment:
_Claude Code on behalf of Guillaume Nodet_
Good point — updated to use the FQCN: `{@code org.springframework.transaction.support.TransactionSynchronization}` so it's clear this refers to a Spring class.
##########
core/camel-api/src/main/java/org/apache/camel/InvalidPayloadRuntimeException.java:
##########
@@ -27,21 +27,41 @@ public class InvalidPayloadRuntimeException extends RuntimeExchangeException {
private final transient @Nullable Class<?> type;
+ /**
+ * @param exchange the exchange that caused the error
+ * @param type the expected body type
+ */
public InvalidPayloadRuntimeException(Exchange exchange, Class<?> type) {
this(exchange, type, exchange.getIn());
}
+ /**
+ * @param exchange the exchange that caused the error
+ * @param type the expected body type
+ * @param cause the cause of the failure
+ */
public InvalidPayloadRuntimeException(Exchange exchange, Class<?> type, Throwable cause) {
this(exchange, type, exchange.getIn(), cause);
}
+ /**
+ * @param exchange the exchange that caused the error
+ * @param type the expected body type
+ * @param message the message whose body could not be converted
Review Comment:
_Claude Code on behalf of Guillaume Nodet_
You're right — the description was too narrow. Updated to: `@param message the message with the invalid or missing payload`. Same fix applied to `InvalidPayloadException`.
##########
core/camel-api/src/main/java/org/apache/camel/package-info.java:
##########
@@ -18,7 +18,7 @@
* The core Camel API.
*/
@NullMarked
-@XmlSchema(namespace = "http://camel.apache.org/schema/spring",
+@XmlSchema(namespace = "https://camel.apache.org/schema/spring",
Review Comment:
_Claude Code on behalf of Guillaume Nodet_
Good catch — the `@XmlSchema` namespace is an XML identifier, not a web URL. Changing `http://` to `https://` would break namespace matching. Reverted.
##########
core/camel-api/src/main/java/org/apache/camel/Exchange.java:
##########
@@ -39,28 +39,14 @@
* An Exchange is created when a {@link Consumer} receives a request. A new {@link Message} is created, the request is
* set as the body of the {@link Message} and depending on the {@link Consumer} other {@link Endpoint} and protocol
* related information is added as headers on the {@link Message}. Then an Exchange is created and the newly created
- * {@link Message} is set as the in on the Exchange. Therefore, an Exchange starts its life in a {@link Consumer}. The
- * Exchange is then sent down the {@link Route} for processing along a {@link Processor} chain. The {@link Processor} as
- * the name suggests is what processes the {@link Message} in the Exchange and Camel, in addition to providing
- * out-of-the-box a large number of useful processors, it also allows you to create your own. The rule Camel uses is to
- * take the out {@link Message} produced by the previous {@link Processor} and set it as the in for the next
- * {@link Processor}. If the previous {@link Processor} did not produce an out, then the in of the previous
- * {@link Processor} is sent as the next in. At the end of the processing chain, depending on the {@link ExchangePattern
- * Message Exchange Pattern} (or MEP) the last out (or in of no out available) is sent by the {@link Consumer} back to
- * the original caller.
+ * {@link Message} is set on the Exchange. Therefore, an Exchange starts its life in a {@link Consumer}. The Exchange is
+ * then sent down the {@link Route} for processing along a {@link Processor} chain. The {@link Processor} as the name
+ * suggests is what processes the {@link Message} in the Exchange. Camel provides a large number of useful processors
+ * out-of-the-box, and it also allows you to create your own.
* <p/>
- * Camel, in addition to providing out-of-the-box a large number of useful processors, it also allows you to implement
- * and use your own. When the Exchange is passed to a {@link Processor}, it always contains an in {@link Message} and no
- * out {@link Message}. The {@link Processor} <b>may</b> produce an out, depending on the nature of the
- * {@link Processor}. The in {@link Message} can be accessed using the {@link #getIn()} method. Since the out message is
- * null when entering the {@link Processor}, the {@link #getOut()} method is actually a convenient factory method that
- * will lazily instantiate a {@link org.apache.camel.support.DefaultMessage} which you could populate. As an alternative
- * you could also instantiate your specialized {@link Message} and set it on the exchange using the
- * {@link #setOut(org.apache.camel.Message)} method. Please note that a {@link Message} contains not only the body but
- * also headers and attachments. If you are creating a new {@link Message} the headers and attachments of the in
- * {@link Message} are not automatically copied to the out by Camel, and you'll have to set the headers and attachments
- * you need yourself. If your {@link Processor} is not producing a different {@link Message} but only needs to slightly
- * modify the in, you can simply update the in {@link Message} returned by {@link #getIn()}.
+ * To access or modify the current message, use the {@link #getMessage()} method. Camel uses {@link #getMessage()} to
+ * obtain the current message during routing. If a {@link Processor} modifies the message, those changes are visible to
+ * subsequent processors.
Review Comment:
_Claude Code on behalf of Guillaume Nodet_
The removed paragraphs described the in/out message model (`getIn()`/`getOut()`/`setOut()`) which was deprecated in Camel 3.0. The old Javadoc was teaching users a deprecated pattern. The replacement directs users to `getMessage()` which is the current API. I've also added back a mention of `ExchangePattern` since MEP is still an active concept.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org