You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2023/03/30 08:17:41 UTC
[camel] branch main created (now 1dd31f04459)
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
at 1dd31f04459 (chores) camel-cassandra: prevent a few potential NPEs
This branch includes the following new commits:
new 78a7dccddf5 Regen for commit 7b5426af654a04744458d82f3758f5e4e0902097
new 8d28aa9b7ab Regen for commit e4414f26df1f4d6ba6c35d0fa70e763d0f21c1e4 (#9709)
new 8dd4de12b4d (chores) camel-cassandra: use a logger instead of standard error output
new 1dd31f04459 (chores) camel-cassandra: prevent a few potential NPEs
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[camel] 04/04: (chores) camel-cassandra: prevent a few potential NPEs
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 1dd31f044599f2ff2d2d99b807185ddab19a1444
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Wed Mar 29 10:24:05 2023 +0200
(chores) camel-cassandra: prevent a few potential NPEs
---
.../camel/utils/cassandra/CassandraUtils.java | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/components/camel-cassandraql/src/main/java/org/apache/camel/utils/cassandra/CassandraUtils.java b/components/camel-cassandraql/src/main/java/org/apache/camel/utils/cassandra/CassandraUtils.java
index 6bf6aedc0cd..953a65427f0 100644
--- a/components/camel-cassandraql/src/main/java/org/apache/camel/utils/cassandra/CassandraUtils.java
+++ b/components/camel-cassandraql/src/main/java/org/apache/camel/utils/cassandra/CassandraUtils.java
@@ -103,20 +103,27 @@ public final class CassandraUtils {
*/
public static Insert generateInsert(String table, String[] columns, boolean ifNotExists, Integer ttl) {
InsertInto into = insertInto(table);
- RegularInsert regularInsert = null;
+ final RegularInsert regularInsert = createRegularInsert(columns, into);
+
Insert insert = null;
- for (String column : columns) {
- regularInsert = (regularInsert != null ? regularInsert : into).value(column, bindMarker());
- }
- if (ifNotExists) {
+ if (ifNotExists && regularInsert != null) {
insert = regularInsert.ifNotExists();
}
- if (ttl != null) {
+ if (ttl != null && insert != null) {
insert = (insert != null ? insert : regularInsert).usingTtl(ttl);
}
return insert != null ? insert : regularInsert;
}
+ private static RegularInsert createRegularInsert(String[] columns, InsertInto into) {
+ RegularInsert regularInsert = null;
+
+ for (String column : columns) {
+ regularInsert = (regularInsert != null ? regularInsert : into).value(column, bindMarker());
+ }
+ return regularInsert;
+ }
+
/**
* Generate select where columns = ? CQL.
*/
@@ -170,7 +177,7 @@ public final class CassandraUtils {
+ "To delete all records, use Truncate");
}
- if (ifExists) {
+ if (ifExists && delete != null) {
delete = delete.ifExists();
}
return delete;
[camel] 03/04: (chores) camel-cassandra: use a logger instead of standard error output
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 8dd4de12b4d906d7014a2670c79fb16dcef3b40a
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Wed Mar 29 10:09:58 2023 +0200
(chores) camel-cassandra: use a logger instead of standard error output
---
.../apache/camel/component/cassandra/CassandraEndpoint.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/components/camel-cassandraql/src/main/java/org/apache/camel/component/cassandra/CassandraEndpoint.java b/components/camel-cassandraql/src/main/java/org/apache/camel/component/cassandra/CassandraEndpoint.java
index 371260fc5b2..c1843875670 100644
--- a/components/camel-cassandraql/src/main/java/org/apache/camel/component/cassandra/CassandraEndpoint.java
+++ b/components/camel-cassandraql/src/main/java/org/apache/camel/component/cassandra/CassandraEndpoint.java
@@ -17,6 +17,7 @@
package org.apache.camel.component.cassandra;
import java.net.InetSocketAddress;
+import java.util.Arrays;
import com.datastax.oss.driver.api.core.ConsistencyLevel;
import com.datastax.oss.driver.api.core.CqlSession;
@@ -41,6 +42,8 @@ import org.apache.camel.support.ScheduledPollEndpoint;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.utils.cassandra.CassandraExtraCodecs;
import org.apache.camel.utils.cassandra.CassandraSessionHolder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Integrate with Cassandra 2.0+ using the CQL3 API (not the Thrift API). Based on Cassandra Java Driver provided by
@@ -49,6 +52,7 @@ import org.apache.camel.utils.cassandra.CassandraSessionHolder;
@UriEndpoint(firstVersion = "2.15.0", scheme = "cql", title = "Cassandra CQL", syntax = "cql:beanRef:hosts:port/keyspace",
category = { Category.DATABASE, Category.NOSQL }, headersClass = CassandraConstants.class)
public class CassandraEndpoint extends ScheduledPollEndpoint {
+ private static final Logger LOG = LoggerFactory.getLogger(CassandraEndpoint.class);
private volatile CassandraSessionHolder sessionHolder;
@@ -165,7 +169,11 @@ public class CassandraEndpoint extends ScheduledPollEndpoint {
if (extraTypeCodecs != null) {
String[] c = extraTypeCodecs.split(",");
- System.err.println(c.toString());
+
+ if (LOG.isDebugEnabled()) {
+ LOG.debug(Arrays.toString(c));
+ }
+
for (String codec : c) {
if (ObjectHelper.isNotEmpty(CassandraExtraCodecs.valueOf(codec))) {
sessionBuilder.addTypeCodecs(CassandraExtraCodecs.valueOf(codec).codec());
[camel] 02/04: Regen for commit e4414f26df1f4d6ba6c35d0fa70e763d0f21c1e4 (#9709)
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 8d28aa9b7ab87c866a062738d6d720002248c3cc
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Thu Mar 30 09:59:47 2023 +0200
Regen for commit e4414f26df1f4d6ba6c35d0fa70e763d0f21c1e4 (#9709)
Signed-off-by: GitHub <no...@github.com>
Co-authored-by: davsclaus <da...@users.noreply.github.com>
---
.../camel-api/src/main/java/org/apache/camel/CamelContext.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/core/camel-api/src/main/java/org/apache/camel/CamelContext.java b/core/camel-api/src/main/java/org/apache/camel/CamelContext.java
index ed740e19aa7..565930039f3 100644
--- a/core/camel-api/src/main/java/org/apache/camel/CamelContext.java
+++ b/core/camel-api/src/main/java/org/apache/camel/CamelContext.java
@@ -599,11 +599,11 @@ public interface CamelContext extends CamelContextLifecycle, RuntimeConfiguratio
* Camel end users should favour using {@link org.apache.camel.builder.TemplatedRouteBuilder} which is a fluent
* builder with more functionality than this API.
*
- * @param routeId the id of the new route to add (optional)
- * @param routeTemplateId the id of the route template (mandatory)
- * @param parameters parameters to use for the route template when creating the new route
- * @return the id of the route added (for example when an id was auto assigned)
- * @throws Exception is thrown if error creating and adding the new route
+ * @param routeId the id of the new route to add (optional)
+ * @param routeTemplateId the id of the route template (mandatory)
+ * @param parameters parameters to use for the route template when creating the new route
+ * @return the id of the route added (for example when an id was auto assigned)
+ * @throws Exception is thrown if error creating and adding the new route
*/
String addRouteFromTemplate(String routeId, String routeTemplateId, Map<String, Object> parameters) throws Exception;
[camel] 01/04: Regen for commit 7b5426af654a04744458d82f3758f5e4e0902097
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 78a7dccddf58a3ef96c6b8e37aae9ced3dd96b4e
Author: oscerd <os...@users.noreply.github.com>
AuthorDate: Thu Mar 30 07:20:05 2023 +0000
Regen for commit 7b5426af654a04744458d82f3758f5e4e0902097
Signed-off-by: GitHub <no...@github.com>
---
.../resources/org/apache/camel/catalog/others.properties | 1 +
.../org/apache/camel/catalog/others/componentdsl.json | 15 +++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties
index 2377361ba4b..ae3a8d69eeb 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties
@@ -4,6 +4,7 @@ cli-connector
cloud
cloudevents
cluster
+componentdsl
console
csimple-joor
debug
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others/componentdsl.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others/componentdsl.json
new file mode 100644
index 00000000000..3799e772735
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others/componentdsl.json
@@ -0,0 +1,15 @@
+{
+ "other": {
+ "kind": "other",
+ "name": "componentdsl",
+ "title": "Java Component DSL",
+ "description": "The Camel Component DSL",
+ "deprecated": false,
+ "firstVersion": "3.1.0",
+ "label": "dsl",
+ "supportLevel": "Stable",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-componentdsl",
+ "version": "4.0.0-SNAPSHOT"
+ }
+}