You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/07/25 12:49:03 UTC
[camel] branch camel-3.18.x updated (154d14ae117 -> 2c0d6054ed4)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a change to branch camel-3.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
from 154d14ae117 [CAMEL-18285] Lazy-loading for file length and last modified attributes (#8019)
new 9135d91996c CAMEL-18278: Get outputs from last abstract parent (#8013)
new 6b00bab3d7f CAMEL-18291: SSLContextParameters parsePropertyValue support for certAlias property. (#8020)
new 6cda20af062 Updated docs for master component to be a bit betteR
new 2c0d6054ed4 Polish clustering docs (#8027)
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.
Summary of changes:
.../src/main/docs/master-component.adoc | 13 ++++---
...t.java => AdviceWithOnExceptionTransacted.java} | 43 ++++++++++++++++------
.../issues/AdviceWithOnExceptionTransacted.xml} | 17 +++++++--
.../camel/support/jsse/SSLContextParameters.java | 2 +-
.../org/apache/camel/builder/AdviceWithTasks.java | 13 +++++--
.../user-manual/modules/ROOT/pages/clustering.adoc | 3 +-
6 files changed, 65 insertions(+), 26 deletions(-)
copy components/camel-test/camel-test-spring-junit5/src/test/java/org/apache/camel/test/issues/{AdviceWithOnCompletionTest.java => AdviceWithOnExceptionTransacted.java} (50%)
copy components/camel-test/{camel-test-spring/src/test/resources/org/apache/camel/test/issues/AdviceWithInterceptSendToEndpointWithLoadbalancerTest.xml => camel-test-spring-junit5/src/test/resources/org/apache/camel/test/issues/AdviceWithOnExceptionTransacted.xml} (75%)
[camel] 02/04: CAMEL-18291: SSLContextParameters parsePropertyValue support for certAlias property. (#8020)
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 6b00bab3d7fa2df9fd44376507ec2638fdd6bc80
Author: robinvish2794 <10...@users.noreply.github.com>
AuthorDate: Mon Jul 25 13:58:35 2022 +0300
CAMEL-18291: SSLContextParameters parsePropertyValue support for certAlias property. (#8020)
---
.../main/java/org/apache/camel/support/jsse/SSLContextParameters.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/camel-api/src/main/java/org/apache/camel/support/jsse/SSLContextParameters.java b/core/camel-api/src/main/java/org/apache/camel/support/jsse/SSLContextParameters.java
index eb92f670dbd..8e24aad9691 100644
--- a/core/camel-api/src/main/java/org/apache/camel/support/jsse/SSLContextParameters.java
+++ b/core/camel-api/src/main/java/org/apache/camel/support/jsse/SSLContextParameters.java
@@ -276,7 +276,7 @@ public class SSLContextParameters extends BaseSSLContextParameters {
if (keyManagers[idx] instanceof X509KeyManager) {
try {
keyManagers[idx] = new AliasedX509ExtendedKeyManager(
- this.getCertAlias(),
+ this.parsePropertyValue(this.getCertAlias()),
(X509KeyManager) keyManagers[idx]);
} catch (Exception e) {
throw new GeneralSecurityException(e);
[camel] 01/04: CAMEL-18278: Get outputs from last abstract parent (#8013)
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 9135d91996ca8377b909d98e7bf84f4f72b5b9a2
Author: Benjamin Graf <gr...@users.noreply.github.com>
AuthorDate: Mon Jul 25 13:01:32 2022 +0200
CAMEL-18278: Get outputs from last abstract parent (#8013)
---
.../issues/AdviceWithOnExceptionTransacted.java | 76 ++++++++++++++++++++++
.../issues/AdviceWithOnExceptionTransacted.xml | 41 ++++++++++++
.../org/apache/camel/builder/AdviceWithTasks.java | 13 +++-
3 files changed, 127 insertions(+), 3 deletions(-)
diff --git a/components/camel-test/camel-test-spring-junit5/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionTransacted.java b/components/camel-test/camel-test-spring-junit5/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionTransacted.java
new file mode 100644
index 00000000000..5e605af9493
--- /dev/null
+++ b/components/camel-test/camel-test-spring-junit5/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionTransacted.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.issues;
+
+import org.apache.camel.builder.AdviceWith;
+import org.apache.camel.spi.Registry;
+import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.TransactionDefinition;
+import org.springframework.transaction.TransactionException;
+import org.springframework.transaction.TransactionStatus;
+
+import static org.apache.camel.builder.Builder.constant;
+
+public class AdviceWithOnExceptionTransacted extends CamelSpringTestSupport {
+
+ @Override
+ protected AbstractApplicationContext createApplicationContext() {
+ return new ClassPathXmlApplicationContext("org/apache/camel/test/issues/AdviceWithOnExceptionTransacted.xml");
+ }
+
+ @Override
+ public boolean isUseAdviceWith() {
+ return true;
+ }
+
+ @Override
+ protected void bindToRegistry(Registry registry) throws Exception {
+ registry.bind("tx", new PlatformTransactionManager() {
+ @Override
+ public TransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException {
+ return null;
+ }
+
+ @Override
+ public void commit(TransactionStatus status) throws TransactionException {
+ }
+
+ @Override
+ public void rollback(TransactionStatus status) throws TransactionException {
+ }
+ });
+ }
+
+ @Test
+ public void testAddFirstWithOnException() throws Exception {
+ AdviceWith.adviceWith(context, "advice-with-on-exception-transacted-test-route", a -> {
+ a.weaveAddFirst().transform(constant("Bye World"));
+ });
+
+ context.start();
+
+ getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+}
diff --git a/components/camel-test/camel-test-spring-junit5/src/test/resources/org/apache/camel/test/issues/AdviceWithOnExceptionTransacted.xml b/components/camel-test/camel-test-spring-junit5/src/test/resources/org/apache/camel/test/issues/AdviceWithOnExceptionTransacted.xml
new file mode 100644
index 00000000000..aecea8c9c05
--- /dev/null
+++ b/components/camel-test/camel-test-spring-junit5/src/test/resources/org/apache/camel/test/issues/AdviceWithOnExceptionTransacted.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:camel="http://camel.apache.org/schema/spring"
+ xsi:schemaLocation="
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+ <route id="advice-with-on-exception-transacted-test-route">
+ <from uri="direct:start"/>
+ <onException>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ </onException>
+ <transacted/>
+ <log message="${body}"/>
+ <to uri="mock:result"/>
+ </route>
+ </camelContext>
+</beans>
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/builder/AdviceWithTasks.java b/core/camel-core-model/src/main/java/org/apache/camel/builder/AdviceWithTasks.java
index 959d887a4f9..0a42743c6f9 100644
--- a/core/camel-core-model/src/main/java/org/apache/camel/builder/AdviceWithTasks.java
+++ b/core/camel-core-model/src/main/java/org/apache/camel/builder/AdviceWithTasks.java
@@ -465,9 +465,16 @@ public final class AdviceWithTasks {
return node.getOutputs();
}
List<ProcessorDefinition<?>> outputs = parent.getOutputs();
- if (outputs.size() == 1 && outputs.get(0).isAbstract()) {
- // if the output is abstract then get its output, as
- outputs = outputs.get(0).getOutputs();
+ boolean allAbstract = true;
+ for (ProcessorDefinition<?> def : outputs) {
+ allAbstract &= def.isAbstract();
+ if (!allAbstract) {
+ break;
+ }
+ }
+ if (outputs.size() >= 1 && allAbstract) {
+ // if all outputs are abstract then get its last output, as
+ outputs = outputs.get(outputs.size() - 1).getOutputs();
}
return outputs;
}
[camel] 03/04: Updated docs for master component to be a bit betteR
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 6cda20af06221742b9f62d8db0bfaf66c9280c42
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Jul 25 11:45:53 2022 +0200
Updated docs for master component to be a bit betteR
---
components/camel-master/src/main/docs/master-component.adoc | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/components/camel-master/src/main/docs/master-component.adoc b/components/camel-master/src/main/docs/master-component.adoc
index e361f81c65a..c3d77dce89d 100644
--- a/components/camel-master/src/main/docs/master-component.adoc
+++ b/components/camel-master/src/main/docs/master-component.adoc
@@ -26,12 +26,17 @@ used to acquire the master lock. e.g.
[source,java]
----
-from("master:cheese:jms:foo").to("activemq:wine");
+from("master:cheese:jms:foo")
+ .to("activemq:wine");
----
-The above simulates the [Exclusive Consumers](http://activemq.apache.org/exclusive-consumer.html) type feature in
-ActiveMQ; but on any third party JMS provider which maybe doesn't support exclusive consumers.
+In this example, there master component ensures that the route is only active in one node, at any given time, in the cluster.
+So if there are 8 nodes in the cluster, then the master component will elect one route to be the leader, and only
+this route will be active, and hence only this route will consume messages from `jms:foo`.
+In case this route is stopped or unexpected terminated, then the master component will detect this,
+and re-elect another node to be active, which will then become active and start consuming messages from `jms:foo`.
+TIP: Apache ActiveMQ 5.x has such feature out of the box called https://activemq.apache.org/exclusive-consumer.html[Exclusive Consumers].
== URI format
@@ -129,7 +134,6 @@ camel.component.zookeeper.cluster.service.nodes = myzk:2181
Camel provides the following ClusterService implementations:
-- camel-atomix
- camel-consul
- camel-file
- camel-infinispan
@@ -139,5 +143,4 @@ Camel provides the following ClusterService implementations:
- camel-zookeeper
-
include::spring-boot:partial$starter.adoc[]
[camel] 04/04: Polish clustering docs (#8027)
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 2c0d6054ed4250693040badd076fddbdee093244
Author: llowinge <ll...@redhat.com>
AuthorDate: Mon Jul 25 12:53:25 2022 +0200
Polish clustering docs (#8027)
---
docs/user-manual/modules/ROOT/pages/clustering.adoc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/docs/user-manual/modules/ROOT/pages/clustering.adoc b/docs/user-manual/modules/ROOT/pages/clustering.adoc
index 7cfd3d19e6d..a1065347d0a 100644
--- a/docs/user-manual/modules/ROOT/pages/clustering.adoc
+++ b/docs/user-manual/modules/ROOT/pages/clustering.adoc
@@ -35,9 +35,8 @@ Out of the box camel provides the following implementations:
[cols="1,1,2", options="header"]
|====
|Type |Module | Class
-|atomix |camel-atomix | org.apache.camel.component.atomix.cluster.AtomixClusterService
|consul |camel-consul | org.apache.camel.component.consul.cluster.ConsulClusterService
-|file |camel-core | org.apache.camel.component.file.cluster.FileLockClusterService
+|file |camel-file | org.apache.camel.component.file.cluster.FileLockClusterService
|infinispan |camel-infinispan | org.apache.camel.component.infinispan.cluster.InfinispanClusterService
|jgroups |camel-jgroups | org.apache.camel.component.jgroups.cluster.JGroupsLockClusterService
|jgroups-raft |camel-jgroups-raft | org.apache.camel.component.jgroups.raft.cluster.JGroupsRaftClusterService