gnodet-bot commented on code in PR #31155:
URL: https://github.com/apache/camel/pull/31155#discussion_r4751212211
##########
components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java:
##########
@@ -125,78 +126,112 @@ public final class RestOpenApiEndpoint extends
DefaultEndpoint {
*/
Map<String, Object> parameters = Collections.emptyMap();
- @UriParam(description = "API basePath, for example \"`/v3`\". Default is
unset, if set overrides the value present in"
- + " OpenApi specification and in the component
configuration.",
+ @UriParam(description = "The base path of the API, for example `/v3`: the
producer puts it before the path of the operation, "
+ + "and the consumer serves the operations under
it. When not set: the component option, then the "
+ + "context path of the REST configuration, then
the path of the servers URL in the specification, then "
+ + "`/`.",
label = "common")
private String basePath;
- @UriParam(description = "Name of the Camel component that will perform the
requests. The component must be present"
- + " in Camel registry and it must implement
RestProducerFactory service provider interface. If not set"
- + " CLASSPATH is searched for single component
that implements RestProducerFactory SPI. Overrides"
- + " component configuration.",
+ @UriParam(description = "Name of the component that sends the HTTP
requests of the producer, which must implement "
+ + "RestProducerFactory, such as http, vertx-http,
undertow or netty-http; it is looked up in the "
+ + "registry, then as a component. When not set:
the component option, then the producerComponent of the"
+ + " REST configuration, then the first component
in the CamelContext that implements "
+ + "RestProducerFactory, then the only
RestProducerFactory in the registry, then the first of http, "
+ + "vertx-http, undertow and netty-http on the
classpath.",
label = "producer,advanced")
private String componentName;
- @UriParam(description = "Name of the Camel component that will service the
requests. The component must be present"
- + " in Camel registry and it must implement
RestOpenApiConsumerFactory service provider interface. If not set"
- + " CLASSPATH is searched for single component
that implements RestOpenApiConsumerFactory SPI. Overrides"
- + " component configuration.",
+ @UriParam(description = "Name of the component that receives the HTTP
requests of the consumer, which must implement "
+ + "RestOpenApiConsumerFactory, such as
platform-http; it is looked up in the registry, then as a "
+ + "component. When not set: the component option,
then the first component in the CamelContext that "
+ + "implements RestOpenApiConsumerFactory, then
platform-http if it is on the classpath, then the only "
+ + "RestOpenApiConsumerFactory in the registry.",
label = "consumer,advanced")
private String consumerComponentName;
- @UriParam(description = "Scheme hostname and port to direct the HTTP
requests to in the form of"
- + " `http[s]://hostname[:port]`. Can be configured
at the endpoint, component or in the corresponding"
- + " REST configuration in the Camel Context. If
you give this component a name (e.g. `petstore`) that"
- + " REST configuration is consulted first,
`rest-openapi` next, and global configuration last. If set"
- + " overrides any value found in the OpenApi
specification, RestConfiguration. Overrides all other "
- + " configuration.",
+ @UriParam(description = "The scheme, host and optional port of the server
the producer calls, in the form "
+ + "`http[s]://hostname[:port]`. When not set: the
component option, then an absolute URL of the servers"
+ + " of the operation or of the specification (with
the default values of the server variables), then "
+ + "the scheme, host and port of the REST
configuration, then the scheme, host and port of an http or "
+ + "https specificationUri. The producer fails to
start when none of them gives a host.",
label = "producer")
private String host;
- @UriPath(description = "ID of the operation from the OpenApi
specification. This is required when using producer",
+ @UriPath(description = "The operationId of the operation in the
specification that the producer calls. Required for the "
+ + "producer, which fails to start when the
specification has no such operation. The consumer does not "
+ + "use it: it serves all operations of the
specification. In the URI it follows `#`, or stands alone "
+ + "when the path does not end with .json, .yaml or
.yml.",
label = "producer")
private String operationId;
- @UriParam(description = "What payload type this component capable of
consuming. Could be one type, like `application/json`"
- + " or multiple types as `application/json,
application/xml; q=0.5` according to the RFC7231. This equates"
- + " or multiple types as `application/json,
application/xml; q=0.5` according to the RFC7231. This equates"
- + " to the value of `Accept` HTTP header. If set
overrides any value found in the OpenApi specification and."
- + " in the component configuration",
+ @UriParam(description = "The media types the producer accepts in the
response, which it sets as the Accept header when the "
+ + "message has none, such as `application/json` or
`application/json, application/xml;q=0.5` (RFC "
+ + "7231). When not set: the component option, then
the content types of the responses of the operation "
+ + "in the specification. The consumer does not use
it.",
label = "consumer")
Review Comment:
💡 **Nit (pre-existing):** The new description correctly identifies this as a
producer-only option ("The media types the **producer** accepts" / "The
consumer does not use it"), but the annotation's `label` is still `"consumer"`.
Since you're rewriting the description anyway, this is a good time to fix the
label to `label = "producer,advanced"` to match. Same mislabeling exists on the
component class.
##########
components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java:
##########
@@ -143,132 +155,180 @@ public class JmsConfiguration implements Cloneable {
@UriParam(description = "Sets the JMS client ID to use. Note that this
value, if specified, must be unique and can only be used by a single JMS
connection instance."
+ " It is typically only required for durable
topic subscriptions with JMS 1.1.")
private String clientId;
- @UriParam(description = "The durable subscriber name for specifying
durable topic subscriptions. The clientId option must be configured as well.")
+ @UriParam(description = "The name of a durable topic subscription. Setting
it makes the subscription durable, as "
+ + "subscriptionDurable together with
subscriptionName does (subscriptionName takes precedence for the "
+ + "name). A durable subscription that is not
shared also requires the clientId option.")
private String durableSubscriptionName;
@UriParam(defaultValue = "true", label = "consumer,advanced",
- description = "Specifies whether the listener session should be
exposed when consuming messages.")
+ description = "Whether the listener container exposes the JMS
session of the consumer to the Spring JmsTemplate "
+ + "calls on the same thread, so a producer in the
route that uses the same connection factory reuses "
+ + "that session (and its local transaction).
Disable it to use a new session of the same connection "
+ + "instead, which some JMS providers need. A
session of a transaction manager is always exposed.")
private boolean exposeListenerSession = true;
@UriParam(label = "consumer,advanced",
- description = "Allows you to specify a custom task executor for
consuming messages.")
+ description = "A custom Spring TaskExecutor that the listener
container of the consumer (and of the reply consumer "
+ + "of request/reply) runs its consumers with. When
not set, see defaultTaskExecutorType.")
private TaskExecutor taskExecutor;
@UriParam(label = "advanced",
description = "Specifies whether to inhibit the delivery of
messages published by its own connection.")
private boolean pubSubNoLocal;
@UriParam(defaultValue = "1", label = "consumer",
- description = "Specifies the default number of concurrent
consumers when consuming from JMS (not for request/reply over JMS)."
- + " See also the maxMessagesPerTask option to
control dynamic scaling up/down of threads."
- + " When doing request/reply over JMS then the
option replyToConcurrentConsumers is used to control number"
- + " of concurrent consumers on the reply message
listener."
- + " On a topic, each consumer has its own
subscription and receives every message,"
- + " unless subscriptionShared is enabled.")
+ description = "The number of concurrent consumers that consume
from the destination: the minimum number with the "
+ + "DefaultMessageListenerContainer, which scales
up to maxConcurrentConsumers. The "
+ + "SimpleMessageListenerContainer uses a fixed
number, which is maxConcurrentConsumers when that is "
+ + "set. Not used by the reply consumer of
request/reply over JMS (see replyToConcurrentConsumers). On a"
+ + " topic, each consumer has its own subscription
and receives every message, unless subscriptionShared"
+ + " is enabled.")
private int concurrentConsumers = 1;
@UriParam(defaultValue = "1", label = "producer",
- description = "Specifies the default number of concurrent
consumers when doing request/reply over JMS."
- + " See also the maxMessagesPerTask option to
control dynamic scaling up/down of threads.")
+ description = "The number of concurrent consumers of the reply
consumer of request/reply over JMS: the minimum "
+ + "number with the
DefaultMessageListenerContainer, which scales up to
replyToMaxConcurrentConsumers.")
private int replyToConcurrentConsumers = 1;
@UriParam(defaultValue = "-1", label = "advanced",
- description = "The number of messages per task. -1 is unlimited."
- + " If you use a range for concurrent consumers
(eg the minimum is lower than the maximum), then this option can be used to set"
- + " a value to eg 100 to control how fast the
consumers will shrink when less work is required.")
+ description = "The maximum number of receive attempts (including
those that time out without a message, see "
+ + "receiveTimeout) that a consumer task of the
DefaultMessageListenerContainer makes before it is "
+ + "released and scheduled again; also used by the
reply consumer of request/reply. With a range of "
+ + "concurrent consumers (maxConcurrentConsumers
higher than concurrentConsumers), a value such as 100 "
+ + "controls how fast the surplus consumers shrink
when less work is required. The default -1 leaves it "
+ + "to Spring JMS: unlimited, or 10 when the task
executor prefers short-lived tasks (such as with "
+ + "defaultTaskExecutorType ThreadPool).")
private int maxMessagesPerTask = -1;
@UriParam(label = "advanced",
- description = "Marks the consumer as idle after the specified
number of idle receives have been reached. An idle receive is counted from the
moment a null message is returned by the receiver after the potential
setReceiveTimeout elapsed. This gives the opportunity to check if the idle task
count exceeds setIdleTaskExecutionLimit and based on that decide if the task
needs to be re-scheduled or not, saving resources that would otherwise be held."
- + " This setting differs from
setMaxMessagesPerTask where the task is released and re-scheduled after this
limit is reached, no matter if the received messages were null or non-null
messages. This setting alone can be inflexible if one desires to have a large
enough batch for each task but requires a quick(er) release from the moment
there are no more messages to process."
- + " This setting differs from
setIdleTaskExecutionLimit where this limit decides after how many iterations of
being marked as idle, a task is released."
- + " For example: If setMaxMessagesPerTask is set
to '500' and #setIdleReceivesPerTaskLimit is set to '60' and setReceiveTimeout
is set to '1000' and setIdleTaskExecutionLimit is set to '1', then 500 messages
per task would be processed unless there is a subsequent number of 60 idle
messages received, the task would be marked as idle and released. This also
means that after the last message was processed, the task would be released
after 60 seconds as long as no new messages appear.")
+ description = "The number of consecutive receives without a
message (each waiting up to receiveTimeout) after which"
+ + " a consumer task of the
DefaultMessageListenerContainer is marked idle and released; also used by "
+ + "the reply consumer of request/reply. Unlike
maxMessagesPerTask, which releases a task after a number"
+ + " of receives whether they got a message or not,
this releases it once there are no more messages; "
+ + "idleTaskExecutionLimit then decides after how
many idle executions the consumer is shut down. On its"
+ + " own it applies only to the surplus consumers
above concurrentConsumers. For example, with "
+ + "receiveTimeout 1000 and
idleReceivesPerTaskLimit 60, a task is released after 60 seconds without "
+ + "messages. When not set, Spring JMS uses 10 for
the surplus consumers, unless the task executor "
+ + "prefers short-lived tasks.")
Review Comment:
💡 **Nit (STE):** The first two sentences each exceed 25 words (~34 and ~40
words respectively). Consider splitting:
```suggestion
description = "The number of consecutive receives without a
message after which a consumer task "
+ "of the DefaultMessageListenerContainer is
marked idle and released (each receive "
+ "waits up to receiveTimeout). Also used by the
reply consumer of request/reply. "
+ "Unlike maxMessagesPerTask, which releases a
task after N receives regardless of "
+ "whether they found a message, this option
releases the task only once there are no "
+ "more messages. idleTaskExecutionLimit then
decides after how many idle executions "
+ "the consumer is shut down. On its own it
applies only to the surplus consumers "
+ "above concurrentConsumers. For example, with
receiveTimeout 1000 and "
+ "idleReceivesPerTaskLimit 60, a task is
released after 60 seconds without messages. "
+ "When not set, Spring JMS uses 10 for the
surplus consumers, unless the task "
+ "executor prefers short-lived tasks.")
```
##########
components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java:
##########
@@ -281,120 +341,128 @@ public class JmsConfiguration implements Cloneable {
+ "the timestamp must be set to its normal value.")
private boolean messageTimestampEnabled = true;
@UriParam(defaultValue = "" + Message.DEFAULT_PRIORITY, enums =
"1,2,3,4,5,6,7,8,9", label = "producer",
- description = "Values greater than 1 specify the message
priority when sending (where 1 is the lowest priority and 9 is the highest)."
- + " The explicitQosEnabled option must also be
enabled in order for this option to have any effect.")
+ description = "The JMS priority of the messages sent, from 0
(lowest) to 9 (highest). Setting it enables "
Review Comment:
💡 **Nit:** The description says `from 0 (lowest) to 9 (highest)` but the
annotation's `enums` constraint is `"1,2,3,4,5,6,7,8,9"` (excludes 0). JMS spec
does allow priority 0, so the description is technically correct, but the enum
and the description are inconsistent. Either add `0` to `enums`, or change the
description to `from 1 (lowest) to 9 (highest)` to match what the UI actually
offers.
--
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]