You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2024/08/01 06:27:00 UTC
(camel) branch main updated: [CAMEL-19665] Switch JIRA to using ScheduledBatchPollingConsumer
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 35939dbb5c3 [CAMEL-19665] Switch JIRA to using ScheduledBatchPollingConsumer
35939dbb5c3 is described below
commit 35939dbb5c3e15276e842e7a2d145370d0a7e52c
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Jul 18 15:58:51 2024 +0200
[CAMEL-19665] Switch JIRA to using ScheduledBatchPollingConsumer
...and give a bit of love to the whole code
---
.../org/apache/camel/catalog/components/jira.json | 4 +-
.../org/apache/camel/component/jira/jira.json | 4 +-
.../camel/component/jira/JiraConfiguration.java | 2 +-
.../apache/camel/component/jira/JiraEndpoint.java | 44 ++++++--------
.../jira/consumer/AbstractJiraConsumer.java | 52 ++++++++++++++---
.../jira/consumer/NewCommentsConsumer.java | 50 +++++++---------
.../component/jira/consumer/NewIssuesConsumer.java | 28 ++++-----
.../jira/consumer/WatchUpdatesConsumer.java | 20 +++----
.../oauth/OAuthAsynchronousHttpClientFactory.java | 4 +-
.../jira/producer/AddCommentProducer.java | 2 +-
.../component/jira/producer/AddIssueProducer.java | 4 +-
.../jira/producer/DeleteIssueProducer.java | 2 +-
.../jira/producer/TransitionIssueProducer.java | 4 +-
.../jira/producer/UpdateIssueProducer.java | 2 +-
.../component/jira/producer/WatcherProducer.java | 6 +-
.../jira/consumer/NewCommentsConsumerTest.java | 67 +++++++---------------
.../component/dsl/JiraComponentBuilderFactory.java | 2 +-
.../endpoint/dsl/JiraEndpointBuilderFactory.java | 6 +-
.../apache/camel/kotlin/components/JiraUriDsl.kt | 2 +-
19 files changed, 144 insertions(+), 161 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jira.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jira.json
index e140035b32f..295498eac5f 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jira.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jira.json
@@ -24,7 +24,7 @@
},
"componentProperties": {
"delay": { "index": 0, "kind": "property", "displayName": "Delay", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "6000", "configurationClass": "org.apache.camel.component.jira.JiraConfiguration", "configurationField": "configuration", "description": "Time in milliseconds to elapse for the next poll." },
- "jiraUrl": { "index": 1, "kind": "property", "displayName": "Jira Url", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.jira.JiraConfiguration", "configurationField": "configuration", "description": "The Jira server url, example: http:\/\/my_jira.com:8081" },
+ "jiraUrl": { "index": 1, "kind": "property", "displayName": "Jira Url", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.jira.JiraConfiguration", "configurationField": "configuration", "description": "The Jira server url, for example http:\/\/my_jira.com:8081." },
"bridgeErrorHandler": { "index": 2, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...]
"lazyStartProducer": { "index": 3, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...]
"autowiredEnabled": { "index": 4, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...]
@@ -62,7 +62,7 @@
"properties": {
"type": { "index": 0, "kind": "path", "displayName": "Type", "group": "common", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.jira.JiraType", "enum": [ "ADDCOMMENT", "ADDISSUE", "ATTACH", "DELETEISSUE", "NEWISSUES", "NEWCOMMENTS", "WATCHUPDATES", "UPDATEISSUE", "TRANSITIONISSUE", "WATCHERS", "ADDISSUELINK", "ADDWORKLOG", "FETCHISSUE", "FETCHCOMMENTS" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "descrip [...]
"delay": { "index": 1, "kind": "parameter", "displayName": "Delay", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "6000", "configurationClass": "org.apache.camel.component.jira.JiraConfiguration", "configurationField": "configuration", "description": "Time in milliseconds to elapse for the next poll." },
- "jiraUrl": { "index": 2, "kind": "parameter", "displayName": "Jira Url", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.jira.JiraConfiguration", "configurationField": "configuration", "description": "The Jira server url, example: http:\/\/my_jira.com:8081" },
+ "jiraUrl": { "index": 2, "kind": "parameter", "displayName": "Jira Url", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.jira.JiraConfiguration", "configurationField": "configuration", "description": "The Jira server url, for example http:\/\/my_jira.com:8081." },
"jql": { "index": 3, "kind": "parameter", "displayName": "Jql", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "JQL is the query language from JIRA which allows you to retrieve the data you want. For example jql=project=MyProject Where MyProject is the product key in Jira. It is important to use the RAW() and set the JQL inside it to prevent camel p [...]
"maxResults": { "index": 4, "kind": "parameter", "displayName": "Max Results", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "50", "description": "Max number of issues to search for" },
"sendOnlyUpdatedField": { "index": 5, "kind": "parameter", "displayName": "Send Only Updated Field", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Indicator for sending only changed fields in exchange body or issue object. By default consumer sends only changed fields." },
diff --git a/components/camel-jira/src/generated/resources/META-INF/org/apache/camel/component/jira/jira.json b/components/camel-jira/src/generated/resources/META-INF/org/apache/camel/component/jira/jira.json
index e140035b32f..295498eac5f 100644
--- a/components/camel-jira/src/generated/resources/META-INF/org/apache/camel/component/jira/jira.json
+++ b/components/camel-jira/src/generated/resources/META-INF/org/apache/camel/component/jira/jira.json
@@ -24,7 +24,7 @@
},
"componentProperties": {
"delay": { "index": 0, "kind": "property", "displayName": "Delay", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "6000", "configurationClass": "org.apache.camel.component.jira.JiraConfiguration", "configurationField": "configuration", "description": "Time in milliseconds to elapse for the next poll." },
- "jiraUrl": { "index": 1, "kind": "property", "displayName": "Jira Url", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.jira.JiraConfiguration", "configurationField": "configuration", "description": "The Jira server url, example: http:\/\/my_jira.com:8081" },
+ "jiraUrl": { "index": 1, "kind": "property", "displayName": "Jira Url", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.jira.JiraConfiguration", "configurationField": "configuration", "description": "The Jira server url, for example http:\/\/my_jira.com:8081." },
"bridgeErrorHandler": { "index": 2, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...]
"lazyStartProducer": { "index": 3, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...]
"autowiredEnabled": { "index": 4, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...]
@@ -62,7 +62,7 @@
"properties": {
"type": { "index": 0, "kind": "path", "displayName": "Type", "group": "common", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.jira.JiraType", "enum": [ "ADDCOMMENT", "ADDISSUE", "ATTACH", "DELETEISSUE", "NEWISSUES", "NEWCOMMENTS", "WATCHUPDATES", "UPDATEISSUE", "TRANSITIONISSUE", "WATCHERS", "ADDISSUELINK", "ADDWORKLOG", "FETCHISSUE", "FETCHCOMMENTS" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "descrip [...]
"delay": { "index": 1, "kind": "parameter", "displayName": "Delay", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "6000", "configurationClass": "org.apache.camel.component.jira.JiraConfiguration", "configurationField": "configuration", "description": "Time in milliseconds to elapse for the next poll." },
- "jiraUrl": { "index": 2, "kind": "parameter", "displayName": "Jira Url", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.jira.JiraConfiguration", "configurationField": "configuration", "description": "The Jira server url, example: http:\/\/my_jira.com:8081" },
+ "jiraUrl": { "index": 2, "kind": "parameter", "displayName": "Jira Url", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.jira.JiraConfiguration", "configurationField": "configuration", "description": "The Jira server url, for example http:\/\/my_jira.com:8081." },
"jql": { "index": 3, "kind": "parameter", "displayName": "Jql", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "JQL is the query language from JIRA which allows you to retrieve the data you want. For example jql=project=MyProject Where MyProject is the product key in Jira. It is important to use the RAW() and set the JQL inside it to prevent camel p [...]
"maxResults": { "index": 4, "kind": "parameter", "displayName": "Max Results", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "50", "description": "Max number of issues to search for" },
"sendOnlyUpdatedField": { "index": 5, "kind": "parameter", "displayName": "Send Only Updated Field", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Indicator for sending only changed fields in exchange body or issue object. By default consumer sends only changed fields." },
diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/JiraConfiguration.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/JiraConfiguration.java
index a5d2e4177f9..f9041104397 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/JiraConfiguration.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/JiraConfiguration.java
@@ -98,7 +98,7 @@ public class JiraConfiguration implements Cloneable {
}
/**
- * The Jira server url, example: http://my_jira.com:8081
+ * The Jira server url, for example <tt>http://my_jira.com:8081</tt>.
*/
public void setJiraUrl(String jiraUrl) {
this.jiraUrl = jiraUrl;
diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/JiraEndpoint.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/JiraEndpoint.java
index 48589615aae..8a69850774d 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/JiraEndpoint.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/JiraEndpoint.java
@@ -25,6 +25,7 @@ import org.apache.camel.Category;
import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
+import org.apache.camel.component.jira.consumer.AbstractJiraConsumer;
import org.apache.camel.component.jira.consumer.NewCommentsConsumer;
import org.apache.camel.component.jira.consumer.NewIssuesConsumer;
import org.apache.camel.component.jira.consumer.WatchUpdatesConsumer;
@@ -178,37 +179,25 @@ public class JiraEndpoint extends DefaultEndpoint implements EndpointServiceLoca
@Override
public Producer createProducer() {
- switch (type) {
- case ADDISSUE:
- return new AddIssueProducer(this);
- case ATTACH:
- return new AttachFileProducer(this);
- case ADDCOMMENT:
- return new AddCommentProducer(this);
- case WATCHERS:
- return new WatcherProducer(this);
- case DELETEISSUE:
- return new DeleteIssueProducer(this);
- case UPDATEISSUE:
- return new UpdateIssueProducer(this);
- case TRANSITIONISSUE:
- return new TransitionIssueProducer(this);
- case ADDISSUELINK:
- return new AddIssueLinkProducer(this);
- case ADDWORKLOG:
- return new AddWorkLogProducer(this);
- case FETCHISSUE:
- return new FetchIssueProducer(this);
- case FETCHCOMMENTS:
- return new FetchCommentsProducer(this);
- default:
- throw new IllegalArgumentException("Producer does not support type: " + type);
- }
+ return switch (type) {
+ case ADDISSUE -> new AddIssueProducer(this);
+ case ATTACH -> new AttachFileProducer(this);
+ case ADDCOMMENT -> new AddCommentProducer(this);
+ case WATCHERS -> new WatcherProducer(this);
+ case DELETEISSUE -> new DeleteIssueProducer(this);
+ case UPDATEISSUE -> new UpdateIssueProducer(this);
+ case TRANSITIONISSUE -> new TransitionIssueProducer(this);
+ case ADDISSUELINK -> new AddIssueLinkProducer(this);
+ case ADDWORKLOG -> new AddWorkLogProducer(this);
+ case FETCHISSUE -> new FetchIssueProducer(this);
+ case FETCHCOMMENTS -> new FetchCommentsProducer(this);
+ default -> throw new IllegalArgumentException("Producer does not support type: " + type);
+ };
}
@Override
public Consumer createConsumer(Processor processor) throws Exception {
- Consumer consumer;
+ AbstractJiraConsumer consumer;
if (type == JiraType.NEWCOMMENTS) {
consumer = new NewCommentsConsumer(this, processor);
} else if (type == JiraType.NEWISSUES) {
@@ -218,6 +207,7 @@ public class JiraEndpoint extends DefaultEndpoint implements EndpointServiceLoca
} else {
throw new IllegalArgumentException("Consumer does not support type: " + type);
}
+ consumer.setMaxMessagesPerPoll(getMaxResults());
configureConsumer(consumer);
return consumer;
}
diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/AbstractJiraConsumer.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/AbstractJiraConsumer.java
index 407409d26cc..5329a1a64f4 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/AbstractJiraConsumer.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/AbstractJiraConsumer.java
@@ -16,9 +16,9 @@
*/
package org.apache.camel.component.jira.consumer;
-import java.util.ArrayList;
import java.util.LinkedHashSet;
-import java.util.List;
+import java.util.LinkedList;
+import java.util.Queue;
import java.util.Set;
import com.atlassian.jira.rest.client.api.JiraRestClient;
@@ -26,14 +26,20 @@ import com.atlassian.jira.rest.client.api.RestClientException;
import com.atlassian.jira.rest.client.api.SearchRestClient;
import com.atlassian.jira.rest.client.api.domain.Issue;
import com.atlassian.jira.rest.client.api.domain.SearchResult;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePropertyKey;
import org.apache.camel.Processor;
import org.apache.camel.component.jira.JiraEndpoint;
-import org.apache.camel.support.ScheduledPollConsumer;
+import org.apache.camel.support.EmptyAsyncCallback;
+import org.apache.camel.support.ScheduledBatchPollingConsumer;
import org.apache.camel.util.ObjectHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public abstract class AbstractJiraConsumer extends ScheduledPollConsumer {
+public abstract class AbstractJiraConsumer extends ScheduledBatchPollingConsumer {
+
+ protected static final int SEARCH_START_AT = 0;
+ protected static final int SEARCH_MAX_PER_QUERY = 50;
private static final Logger LOG = LoggerFactory.getLogger(AbstractJiraConsumer.class);
@@ -73,12 +79,42 @@ public abstract class AbstractJiraConsumer extends ScheduledPollConsumer {
}
}
- protected List<Issue> getIssues() {
- return getIssues(endpoint.getJql(), 0, 50, endpoint.getMaxResults());
+ @Override
+ public int processBatch(Queue<Object> objects) throws Exception {
+ int total = objects.size();
+
+ for (int index = 0; index < total && isBatchAllowed(); index++) {
+ // only loop if we are started (allowed to run)
+ Object body = objects.poll();
+ final Exchange exchange = createExchange(true);
+ exchange.getIn().setBody(body);
+ // add current index and total as properties
+ exchange.setProperty(ExchangePropertyKey.BATCH_INDEX, index);
+ exchange.setProperty(ExchangePropertyKey.BATCH_SIZE, total);
+ exchange.setProperty(ExchangePropertyKey.BATCH_COMPLETE, index == total - 1);
+
+ // update pending number of exchanges
+ pendingExchanges = total - index - 1;
+
+ getAsyncProcessor().process(exchange, EmptyAsyncCallback.get());
+ }
+ return total;
+ }
+
+ protected Queue<Issue> getIssues() {
+ return getIssues(endpoint.getJql());
+ }
+
+ protected Queue<Issue> getIssues(String jql) {
+ return getIssues(jql, endpoint.getMaxResults());
+ }
+
+ protected Queue<Issue> getIssues(String jql, int maxResults) {
+ return getIssues(jql, SEARCH_START_AT, SEARCH_MAX_PER_QUERY, maxResults);
}
// Ignore maxResults if it's <= 0.
- protected List<Issue> getIssues(String jql, int start, int maxPerQuery, int maxResults) {
+ protected Queue<Issue> getIssues(String jql, int start, int maxPerQuery, int maxResults) {
LOG.debug("Start indexing current JIRA issues...");
if (maxResults < maxPerQuery) {
@@ -107,7 +143,7 @@ public abstract class AbstractJiraConsumer extends ScheduledPollConsumer {
start += maxPerQuery;
}
LOG.debug("End indexing current JIRA issues. {} issues indexed.", issues.size());
- return new ArrayList<>(issues);
+ return new LinkedList<>(issues);
}
protected JiraRestClient client() {
diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/NewCommentsConsumer.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/NewCommentsConsumer.java
index 78dd7c865dc..e12d034c815 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/NewCommentsConsumer.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/NewCommentsConsumer.java
@@ -16,14 +16,17 @@
*/
package org.apache.camel.component.jira.consumer;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.Queue;
+import java.util.stream.Collectors;
+import java.util.stream.StreamSupport;
+import com.atlassian.jira.rest.client.api.IssueRestClient;
import com.atlassian.jira.rest.client.api.domain.Comment;
-import com.atlassian.jira.rest.client.api.domain.Issue;
-import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.component.jira.JiraEndpoint;
+import org.apache.camel.util.CastUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -47,15 +50,8 @@ public class NewCommentsConsumer extends AbstractJiraConsumer {
@Override
protected int doPoll() throws Exception {
- List<Comment> newComments = getComments();
- int max = newComments.size() - 1;
- // retrieve from last to first item LIFO
- for (int i = max; i > -1; i--) {
- Comment newComment = newComments.get(i);
- Exchange e = createExchange(true);
- e.getIn().setBody(newComment);
- getProcessor().process(e);
- }
+ Queue<Comment> newComments = getComments();
+ processBatch(CastUtils.cast(newComments));
return newComments.size();
}
@@ -68,23 +64,19 @@ public class NewCommentsConsumer extends AbstractJiraConsumer {
// In the end, we want *new* comments oldest to newest.
@SuppressWarnings("ConstantConditions")
- private List<Comment> getComments() {
+ private Queue<Comment> getComments() {
LOG.debug("Start: Jira NewCommentsConsumer: retrieving issue comments. Last comment id: {}", lastCommentId);
- List<Comment> newComments = new ArrayList<>();
- List<Issue> issues = getIssues();
- for (Issue issue : issues) {
- Issue fullIssue = client().getIssueClient().getIssue(issue.getKey()).claim();
- for (Comment comment : fullIssue.getComments()) {
- if (comment.getId() > lastCommentId) {
- newComments.add(comment);
- }
- }
- }
- for (Comment c : newComments) {
- if (c.getId() > lastCommentId) {
- lastCommentId = c.getId();
- }
- }
+ IssueRestClient client = getEndpoint().getClient().getIssueClient();
+
+ LinkedList<Comment> newComments = getIssues().stream()
+ .map(issue -> client.getIssue(issue.getKey()).claim())
+ .flatMap(issue -> StreamSupport.stream(issue.getComments().spliterator(), false))
+ .filter(comment -> comment.getId() > lastCommentId)
+ .collect(Collectors.toCollection(LinkedList::new));
+
+ Collections.reverse(newComments);
+
+ lastCommentId = newComments.stream().mapToLong(Comment::getId).max().orElse(lastCommentId);
LOG.debug("End: Jira NewCommentsConsumer: retrieving issue comments. {} new comments since last run.",
newComments.size());
return newComments;
diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/NewIssuesConsumer.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/NewIssuesConsumer.java
index 4347da19342..ea2ee3a7f9c 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/NewIssuesConsumer.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/NewIssuesConsumer.java
@@ -16,14 +16,14 @@
*/
package org.apache.camel.component.jira.consumer;
-import java.util.Collections;
-import java.util.List;
+import java.util.LinkedList;
+import java.util.Queue;
import com.atlassian.jira.rest.client.api.RestClientException;
import com.atlassian.jira.rest.client.api.domain.Issue;
-import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.component.jira.JiraEndpoint;
+import org.apache.camel.util.CastUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -57,10 +57,10 @@ public class NewIssuesConsumer extends AbstractJiraConsumer {
// read the actual issues, the next poll outputs only the new issues added after the route start
// grab only the top
try {
- List<Issue> issues = getIssues(jql, 0, 1, 1);
+ Queue<Issue> issues = getIssues(jql, 1);
if (!issues.isEmpty()) {
// Issues returned are ordered descendant so this is the newest issue
- return issues.get(0).getId();
+ return issues.peek().getId();
}
} catch (Exception e) {
// ignore
@@ -72,17 +72,13 @@ public class NewIssuesConsumer extends AbstractJiraConsumer {
protected int doPoll() throws Exception {
// it may happen the poll() is called while the route is doing the initial load,
// this way we need to wait for the latestIssueId being associated to the last indexed issue id
- List<Issue> newIssues = getNewIssues();
+ Queue<Issue> newIssues = getNewIssues();
// In the end, we want only *new* issues oldest to newest. New issues returned are ordered descendant already.
- for (Issue newIssue : newIssues) {
- Exchange e = createExchange(true);
- e.getIn().setBody(newIssue);
- getProcessor().process(e);
- }
+ processBatch(CastUtils.cast(newIssues));
return newIssues.size();
}
- private List<Issue> getNewIssues() {
+ private Queue<Issue> getNewIssues() {
String jqlFilter;
if (latestIssueId > -1) {
// search only for issues created after the latest id
@@ -91,9 +87,9 @@ public class NewIssuesConsumer extends AbstractJiraConsumer {
jqlFilter = jql;
}
// the last issue may be deleted, so to recover we re-find it and go from there
- List<Issue> issues;
+ Queue<Issue> issues;
try {
- issues = getIssues(jqlFilter, 0, 50, getEndpoint().getMaxResults());
+ issues = getIssues(jqlFilter);
} catch (RestClientException e) {
if (e.getStatusCode().isPresent()) {
int code = e.getStatusCode().get();
@@ -104,7 +100,7 @@ public class NewIssuesConsumer extends AbstractJiraConsumer {
+ " Will recover by fetching last issue id from JIRA and try again on next poll",
latestIssueId);
latestIssueId = findLatestIssueId();
- return Collections.emptyList();
+ return new LinkedList<>();
}
}
}
@@ -114,7 +110,7 @@ public class NewIssuesConsumer extends AbstractJiraConsumer {
if (!issues.isEmpty()) {
// remember last id we have processed
// issues are ordered descendant so save the first issue in the list as the newest
- latestIssueId = issues.get(0).getId();
+ latestIssueId = issues.element().getId();
}
return issues;
}
diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/WatchUpdatesConsumer.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/WatchUpdatesConsumer.java
index 5ba757a8c5c..00f6572de66 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/WatchUpdatesConsumer.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/WatchUpdatesConsumer.java
@@ -19,10 +19,10 @@ package org.apache.camel.component.jira.consumer;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
-import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
import com.atlassian.jira.rest.client.api.domain.Issue;
@@ -36,8 +36,6 @@ import org.slf4j.LoggerFactory;
public class WatchUpdatesConsumer extends AbstractJiraConsumer {
private static final Logger LOG = LoggerFactory.getLogger(WatchUpdatesConsumer.class);
- private static final int SEARCH_MAX_PER_QUERY = 50;
- private static final int SEARCH_START_AT = 0;
final HashMap<Long, Issue> watchedIssues = new HashMap<>();
List<String> watchedFieldsList;
String watchedIssuesKeys;
@@ -51,12 +49,11 @@ public class WatchUpdatesConsumer extends AbstractJiraConsumer {
@Override
protected void doStart() throws Exception {
super.doStart();
- List<Issue> issues = getIssues(getEndpoint().getJql(), SEARCH_START_AT, SEARCH_MAX_PER_QUERY,
- getEndpoint().getMaxResults());
+ Collection<Issue> issues = getIssues(getEndpoint().getJql());
initIssues(issues);
}
- private void initIssues(List<Issue> issues) {
+ private void initIssues(Collection<Issue> issues) {
watchedIssues.clear();
issues.forEach(i -> watchedIssues.put(i.getId(), i));
watchedIssuesKeys = issues.stream()
@@ -66,8 +63,7 @@ public class WatchUpdatesConsumer extends AbstractJiraConsumer {
@Override
protected int doPoll() throws Exception {
- List<Issue> issues = getIssues(getEndpoint().getJql(), SEARCH_START_AT, SEARCH_MAX_PER_QUERY,
- getEndpoint().getMaxResults());
+ Collection<Issue> issues = getIssues();
for (Issue issue : issues) {
checkIfIssueChanged(issue);
}
@@ -80,14 +76,12 @@ public class WatchUpdatesConsumer extends AbstractJiraConsumer {
private void checkIfIssueChanged(Issue issue) throws Exception {
Issue original = watchedIssues.get(issue.getId());
- AtomicBoolean issueChanged = new AtomicBoolean();
if (original != null) {
+ boolean issueChanged = false;
for (String field : this.watchedFieldsList) {
- if (hasFieldChanged(issue, original, field)) {
- issueChanged.set(true);
- }
+ issueChanged |= hasFieldChanged(issue, original, field);
}
- if (issueChanged.get()) {
+ if (issueChanged) {
watchedIssues.put(issue.getId(), issue);
}
}
diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/oauth/OAuthAsynchronousHttpClientFactory.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/oauth/OAuthAsynchronousHttpClientFactory.java
index cda79cd300f..20efcc90e87 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/oauth/OAuthAsynchronousHttpClientFactory.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/oauth/OAuthAsynchronousHttpClientFactory.java
@@ -48,10 +48,10 @@ public class OAuthAsynchronousHttpClientFactory {
public DisposableHttpClient createClient(final URI serverUri, final AuthenticationHandler authenticationHandler) {
final HttpClientOptions options = new HttpClientOptions();
- final DefaultHttpClientFactory defaultHttpClientFactory = new DefaultHttpClientFactory(
+ final DefaultHttpClientFactory<?> defaultHttpClientFactory = new DefaultHttpClientFactory<>(
new NoOpEventPublisher(),
new RestClientApplicationProperties(serverUri),
- new ThreadLocalContextManager() {
+ new ThreadLocalContextManager<>() {
@Override
public Object getThreadLocalContext() {
return null;
diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/AddCommentProducer.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/AddCommentProducer.java
index bada49e89ea..9f3b238d545 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/AddCommentProducer.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/AddCommentProducer.java
@@ -41,7 +41,7 @@ public class AddCommentProducer extends DefaultProducer {
String commentStr = exchange.getIn().getBody(String.class);
if (issueKey == null) {
throw new IllegalArgumentException(
- "Missing exchange input header named \'IssueKey\', it should specify the issue key to add the comment to.");
+ "Missing exchange input header named 'IssueKey', it should specify the issue key to add the comment to.");
}
if (commentStr == null) {
throw new IllegalArgumentException("Missing exchange body, it should specify the string comment.");
diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/AddIssueProducer.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/AddIssueProducer.java
index 82d3f29654e..9ccd3c9a393 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/AddIssueProducer.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/AddIssueProducer.java
@@ -98,7 +98,7 @@ public class AddIssueProducer extends DefaultProducer {
List<String> comps = new ArrayList<>(compArr.length);
for (String s : compArr) {
String c = s.trim();
- if (c.length() > 0) {
+ if (!c.isEmpty()) {
comps.add(c);
}
}
@@ -121,7 +121,7 @@ public class AddIssueProducer extends DefaultProducer {
String[] watArr = watchers.split(",");
for (String s : watArr) {
String watcher = s.trim();
- if (watcher.length() > 0) {
+ if (!watcher.isEmpty()) {
issueClient.addWatcher(issue.getWatchers().getSelf(), watcher);
}
}
diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/DeleteIssueProducer.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/DeleteIssueProducer.java
index 23a49fef4e5..887bd835ec0 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/DeleteIssueProducer.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/DeleteIssueProducer.java
@@ -35,7 +35,7 @@ public class DeleteIssueProducer extends DefaultProducer {
String issueKey = exchange.getIn().getHeader(ISSUE_KEY, String.class);
if (issueKey == null) {
throw new IllegalArgumentException(
- "Missing exchange input header named \'IssueKey\', it should specify the issue key to remove it.");
+ "Missing exchange input header named 'IssueKey', it should specify the issue key to remove it.");
}
JiraRestClient client = ((JiraEndpoint) getEndpoint()).getClient();
IssueRestClient issueClient = client.getIssueClient();
diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/TransitionIssueProducer.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/TransitionIssueProducer.java
index ad34eecf396..10afffeb7dc 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/TransitionIssueProducer.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/TransitionIssueProducer.java
@@ -44,11 +44,11 @@ public class TransitionIssueProducer extends DefaultProducer {
Integer transitionId = exchange.getIn().getHeader(ISSUE_TRANSITION_ID, Integer.class);
if (issueKey == null) {
throw new IllegalArgumentException(
- "Missing exchange input header named \'IssueKey\', it should specify the issue key to add the comment to.");
+ "Missing exchange input header named 'IssueKey', it should specify the issue key to add the comment to.");
}
if (transitionId == null) {
throw new IllegalArgumentException(
- "Missing exchange input header named \'IssueTransitionId\', it should specify the transition id.");
+ "Missing exchange input header named 'IssueTransitionId', it should specify the transition id.");
}
JiraRestClient client = ((JiraEndpoint) getEndpoint()).getClient();
IssueRestClient issueClient = client.getIssueClient();
diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/UpdateIssueProducer.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/UpdateIssueProducer.java
index f54a15647a7..087d9da59a3 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/UpdateIssueProducer.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/UpdateIssueProducer.java
@@ -54,7 +54,7 @@ public class UpdateIssueProducer extends DefaultProducer {
String issueKey = exchange.getIn().getHeader(ISSUE_KEY, String.class);
if (issueKey == null) {
throw new IllegalArgumentException(
- "Missing exchange input header named \'IssueKey\', it should specify the issue key.");
+ "Missing exchange input header named 'IssueKey', it should specify the issue key.");
}
Long issueTypeId = exchange.getIn().getHeader(ISSUE_TYPE_ID, Long.class);
String issueTypeName = exchange.getIn().getHeader(ISSUE_TYPE_NAME, String.class);
diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/WatcherProducer.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/WatcherProducer.java
index 6c9119826fa..7175ab4bc54 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/WatcherProducer.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/producer/WatcherProducer.java
@@ -41,7 +41,7 @@ public class WatcherProducer extends DefaultProducer {
String watchersRemove = exchange.getIn().getHeader(ISSUE_WATCHERS_REMOVE, String.class);
if (issueKey == null) {
throw new IllegalArgumentException(
- "Missing exchange input header named \'IssueKey\', it should specify the issue key to add/remove watchers to.");
+ "Missing exchange input header named 'IssueKey', it should specify the issue key to add/remove watchers to.");
}
JiraRestClient client = ((JiraEndpoint) getEndpoint()).getClient();
boolean hasWatchersToAdd = ObjectHelper.isNotEmpty(watchersAdd);
@@ -53,7 +53,7 @@ public class WatcherProducer extends DefaultProducer {
String[] watArr = watchersAdd.split(",");
for (String s : watArr) {
String watcher = s.trim();
- if (watcher.length() > 0) {
+ if (!watcher.isEmpty()) {
issueClient.addWatcher(issue.getWatchers().getSelf(), watcher);
}
}
@@ -62,7 +62,7 @@ public class WatcherProducer extends DefaultProducer {
String[] watArr = watchersRemove.split(",");
for (String s : watArr) {
String watcher = s.trim();
- if (watcher.length() > 0) {
+ if (!watcher.isEmpty()) {
issueClient.removeWatcher(issue.getWatchers().getSelf(), watcher);
}
}
diff --git a/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewCommentsConsumerTest.java b/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewCommentsConsumerTest.java
index 485c46a2a0b..c56852e85d7 100644
--- a/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewCommentsConsumerTest.java
+++ b/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewCommentsConsumerTest.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.jira.consumer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import java.util.concurrent.atomic.AtomicInteger;
import com.atlassian.jira.rest.client.api.IssueRestClient;
import com.atlassian.jira.rest.client.api.JiraRestClient;
@@ -50,8 +49,7 @@ import static org.apache.camel.component.jira.JiraTestConstants.PROJECT;
import static org.apache.camel.component.jira.Utils.createIssue;
import static org.apache.camel.component.jira.Utils.createIssueWithComments;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.Mockito.reset;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;
@ExtendWith(MockitoExtension.class)
@@ -88,15 +86,14 @@ public class NewCommentsConsumerTest extends CamelTestSupport {
public void setMocks() {
SearchResult result = new SearchResult(0, 50, 100, ISSUES);
- Promise<SearchResult> promiseSearchResult = Promises.promise(result);
- Issue issue = createIssueWithComments(4L, 1);
- Promise<Issue> promiseIssue = Promises.promise(issue);
+ Promise<SearchResult> searchResultPromise = Promises.promise(result);
when(jiraClient.getSearchClient()).thenReturn(searchRestClient);
when(jiraClient.getIssueClient()).thenReturn(issueRestClient);
when(jiraRestClientFactory.createWithBasicHttpAuthentication(any(), any(), any())).thenReturn(jiraClient);
- when(searchRestClient.searchJql(any(), any(), any(), any())).thenReturn(promiseSearchResult);
- when(issueRestClient.getIssue(anyString())).thenReturn(promiseIssue);
+ when(searchRestClient.searchJql(any(), any(), any(), any())).thenReturn(searchResultPromise);
+ ISSUES.forEach(issue -> when(issueRestClient.getIssue(eq(issue.getKey())))
+ .then(inv -> Promises.promise(issue)));
}
@Override
@@ -129,23 +126,18 @@ public class NewCommentsConsumerTest extends CamelTestSupport {
@Test
public void singleIssueCommentsTest() throws Exception {
- Issue issueWithCommends = createIssueWithComments(11L, 3000);
+ Issue issueWithComments = createIssueWithComments(11L, 3000);
Issue issueWithNoComments = createIssue(51L);
+ List<Issue> newIssues = List.of(issueWithComments, issueWithNoComments);
- reset(issueRestClient);
- AtomicInteger regulator = new AtomicInteger();
- when(issueRestClient.getIssue(anyString())).then(inv -> {
- int idx = regulator.getAndIncrement();
- Issue issue = issueWithNoComments;
- if (idx < 1) {
- issue = issueWithCommends;
- }
- return Promises.promise(issue);
- });
+ SearchResult result = new SearchResult(0, 50, 2, newIssues);
+ when(searchRestClient.searchJql(any(), any(), any(), any())).thenReturn(Promises.promise(result));
+ newIssues.forEach(issue -> when(issueRestClient.getIssue(eq(issue.getKey())))
+ .then(inv -> Promises.promise(issue)));
+
+ //clearInvocations(issueRestClient);
List<Comment> comments = new ArrayList<>();
- for (Comment c : issueWithCommends.getComments()) {
- comments.add(c);
- }
+ newIssues.forEach(issue -> issue.getComments().forEach(comments::add));
// reverse the order, from oldest comment to recent
Collections.reverse(comments);
// expect 3000 comments
@@ -158,32 +150,15 @@ public class NewCommentsConsumerTest extends CamelTestSupport {
Issue issue1 = createIssueWithComments(20L, 2000);
Issue issue2 = createIssueWithComments(21L, 3000);
Issue issue3 = createIssueWithComments(22L, 1000);
- List<Issue> newIssues = new ArrayList<>();
- newIssues.add(issue3);
- newIssues.add(issue2);
- newIssues.add(issue1);
- Issue issueWithNoComments = createIssue(31L);
-
- reset(searchRestClient);
- reset(issueRestClient);
+ List<Issue> newIssues = List.of(issue3, issue2, issue1);
+
SearchResult searchResult = new SearchResult(0, 50, 3, newIssues);
- Promise<SearchResult> searchResultPromise = Promises.promise(searchResult);
- when(searchRestClient.searchJql(anyString(), any(), any(), any())).thenReturn(searchResultPromise);
- AtomicInteger regulator = new AtomicInteger();
- when(issueRestClient.getIssue(anyString())).then(inv -> {
- int idx = regulator.getAndIncrement();
- Issue issue = issueWithNoComments;
- if (idx < newIssues.size()) {
- issue = newIssues.get(idx);
- }
- return Promises.promise(issue);
- });
+ when(searchRestClient.searchJql(any(), any(), any(), any())).thenReturn(Promises.promise(searchResult));
+ newIssues.forEach(issue -> when(issueRestClient.getIssue(eq(issue.getKey())))
+ .then(inv -> Promises.promise(issue)));
+
List<Comment> comments = new ArrayList<>();
- for (Issue issue : newIssues) {
- for (Comment c : issue.getComments()) {
- comments.add(c);
- }
- }
+ newIssues.forEach(issue -> issue.getComments().forEach(comments::add));
// reverse the order, from oldest comment to recent
Collections.reverse(comments);
// expect 6000 comments
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JiraComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JiraComponentBuilderFactory.java
index 384c219ccbb..58de2c2f95f 100644
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JiraComponentBuilderFactory.java
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JiraComponentBuilderFactory.java
@@ -68,7 +68,7 @@ public interface JiraComponentBuilderFactory {
}
/**
- * The Jira server url, example: http://my_jira.com:8081.
+ * The Jira server url, for example http://my_jira.com:8081.
*
* The option is a: <code>java.lang.String</code> type.
*
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JiraEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JiraEndpointBuilderFactory.java
index a65b0c5baf8..9cf06bec9d3 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JiraEndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JiraEndpointBuilderFactory.java
@@ -75,7 +75,7 @@ public interface JiraEndpointBuilderFactory {
return this;
}
/**
- * The Jira server url, example: http://my_jira.com:8081.
+ * The Jira server url, for example http://my_jira.com:8081.
*
* The option is a: <code>java.lang.String</code> type.
*
@@ -450,7 +450,7 @@ public interface JiraEndpointBuilderFactory {
return this;
}
/**
- * The Jira server url, example: http://my_jira.com:8081.
+ * The Jira server url, for example http://my_jira.com:8081.
*
* The option is a: <code>java.lang.String</code> type.
*
@@ -657,7 +657,7 @@ public interface JiraEndpointBuilderFactory {
return this;
}
/**
- * The Jira server url, example: http://my_jira.com:8081.
+ * The Jira server url, for example http://my_jira.com:8081.
*
* The option is a: <code>java.lang.String</code> type.
*
diff --git a/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/JiraUriDsl.kt b/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/JiraUriDsl.kt
index 33c4b0315a6..df41551dcb9 100644
--- a/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/JiraUriDsl.kt
+++ b/dsl/camel-kotlin-api/src/generated/kotlin/org/apache/camel/kotlin/components/JiraUriDsl.kt
@@ -68,7 +68,7 @@ public class JiraUriDsl(
}
/**
- * The Jira server url, example: http://my_jira.com:8081
+ * The Jira server url, for example http://my_jira.com:8081.
*/
public fun jiraUrl(jiraUrl: String) {
it.property("jiraUrl", jiraUrl)