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 2021/06/08 13:27:05 UTC
[camel] branch main updated (5b26348 -> a9deb52)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git.
from 5b26348 CAMEL-16519 - Remove Camel-APNS
new 2ce75eb CAMEL-16627: camel-core - Add common header for source timestamp
new f01afa3 CAMEL-16627: camel-core - Add common header for source timestamp
new 578ad27 Polished doc
new a9deb52 CAMEL-16627: camel-core - Add common header for source timestamp
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:
.../camel/catalog/docs/activemq-component.adoc | 4 ++--
.../apache/camel/catalog/docs/jms-component.adoc | 4 ++--
.../apache/camel/catalog/docs/simple-language.adoc | 8 ++++++++
.../apache/camel/component/activemq/activemq.json | 4 ++--
.../src/main/docs/activemq-component.adoc | 4 ++--
.../apache/camel/component/file/GenericFile.java | 1 +
.../org/apache/camel/component/jms/jms.json | 4 ++--
.../camel-jms/src/main/docs/jms-component.adoc | 4 ++--
.../camel/component/jms/JmsConfiguration.java | 8 ++++----
.../org/apache/camel/component/jms/JmsMessage.java | 5 +++++
...utateTest.java => JmsMessageTimestampTest.java} | 18 ++++++----------
.../camel/component/kafka/KafkaConsumer.java | 1 +
.../apache/camel/component/sjms/SjmsMessage.java | 5 +++++
.../component/sjms/JmsMessageTimestampTest.java} | 21 +++++++++----------
.../component/vertx/kafka/VertxKafkaConsumer.java | 1 +
.../org/apache/camel/ExchangeConstantProvider.java | 3 ++-
.../src/main/java/org/apache/camel/Exchange.java | 3 +++
.../src/main/java/org/apache/camel/Message.java | 15 ++++++++++++++
.../dsl/ActivemqComponentBuilderFactory.java | 4 ++--
.../component/dsl/JmsComponentBuilderFactory.java | 4 ++--
.../modules/languages/pages/simple-language.adoc | 8 ++++++++
.../simple/ast/SimpleFunctionExpression.java | 4 ++++
....java => FileConsumerMessageTimestampTest.java} | 14 ++++++-------
.../org/apache/camel/impl/MessageSupportTest.java | 13 ++++++++++++
.../apache/camel/language/simple/SimpleTest.java | 6 ++++++
.../dsl/ActiveMQEndpointBuilderFactory.java | 24 +++++++++++-----------
.../endpoint/dsl/JmsEndpointBuilderFactory.java | 24 +++++++++++-----------
.../org/apache/camel/support/MessageSupport.java | 10 +++++++++
.../camel/support/builder/ExpressionBuilder.java | 16 +++++++++++++++
.../modules/ROOT/pages/activemq-component.adoc | 4 ++--
.../modules/ROOT/pages/jms-component.adoc | 4 ++--
.../modules/languages/pages/simple-language.adoc | 8 ++++++++
32 files changed, 177 insertions(+), 79 deletions(-)
copy components/camel-jms/src/test/java/org/apache/camel/component/jms/{JmsSimpleInOnlyNoMutateTest.java => JmsMessageTimestampTest.java} (78%)
copy components/{camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerUnsafeCharsTest.java => camel-sjms/src/test/java/org/apache/camel/component/sjms/JmsMessageTimestampTest.java} (68%)
copy core/camel-core/src/test/java/org/apache/camel/component/file/{FileConsumeNoopIdempotentDisabledTest.java => FileConsumerMessageTimestampTest.java} (80%)
[camel] 01/04: CAMEL-16627: camel-core - Add common header for
source timestamp
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 2ce75ebb34dcb74c9bf5573108a7435e41f9b306
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Jun 8 12:06:12 2021 +0200
CAMEL-16627: camel-core - Add common header for source timestamp
---
.../apache/camel/component/file/GenericFile.java | 1 +
.../org/apache/camel/component/jms/JmsMessage.java | 5 ++
.../component/jms/JmsMessageTimestampTest.java | 63 ++++++++++++++++++++++
.../camel/component/kafka/KafkaConsumer.java | 1 +
.../apache/camel/component/sjms/SjmsMessage.java | 5 ++
.../component/sjms/JmsMessageTimestampTest.java | 46 ++++++++++++++++
.../component/vertx/kafka/VertxKafkaConsumer.java | 1 +
.../org/apache/camel/ExchangeConstantProvider.java | 3 +-
.../src/main/java/org/apache/camel/Exchange.java | 1 +
.../src/main/java/org/apache/camel/Message.java | 10 ++++
.../file/FileConsumerMessageTimestampTest.java | 48 +++++++++++++++++
.../org/apache/camel/impl/MessageSupportTest.java | 13 +++++
.../org/apache/camel/support/MessageSupport.java | 10 ++++
13 files changed, 206 insertions(+), 1 deletion(-)
diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFile.java b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFile.java
index 928f548..735e66f 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFile.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFile.java
@@ -187,6 +187,7 @@ public class GenericFile<T> implements WrappedFile<T> {
}
if (getLastModified() > 0) {
message.setHeader(Exchange.FILE_LAST_MODIFIED, getLastModified());
+ message.setHeader(Exchange.MESSAGE_TIMESTAMP, getLastModified());
}
}
}
diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
index c815e52..71169bb 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
@@ -240,6 +240,11 @@ public class JmsMessage extends DefaultMessage {
protected void populateInitialHeaders(Map<String, Object> map) {
if (jmsMessage != null && map != null) {
map.putAll(getBinding().extractHeadersFromJms(jmsMessage, getExchange()));
+ try {
+ map.put(Exchange.MESSAGE_TIMESTAMP, jmsMessage.getJMSTimestamp());
+ } catch (JMSException e) {
+ // ignore
+ }
}
}
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsMessageTimestampTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsMessageTimestampTest.java
new file mode 100644
index 0000000..6a7ef60
--- /dev/null
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsMessageTimestampTest.java
@@ -0,0 +1,63 @@
+/*
+ * 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.component.jms;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import javax.jms.ConnectionFactory;
+
+import static org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge;
+
+public class JmsMessageTimestampTest extends CamelTestSupport {
+
+ protected String componentName = "activemq";
+
+ @Test
+ public void testMessageTimestamp() throws Exception {
+ MockEndpoint result = getMockEndpoint("mock:result");
+ result.expectedMessageCount(1);
+ result.message(0).header(Exchange.MESSAGE_TIMESTAMP).isGreaterThan(0);
+
+ template.sendBody("activemq:queue:hello", "Hello World");
+
+ result.assertIsSatisfied();
+ }
+
+ @Override
+ protected CamelContext createCamelContext() throws Exception {
+ CamelContext camelContext = super.createCamelContext();
+
+ ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
+ camelContext.addComponent(componentName, jmsComponentAutoAcknowledge(connectionFactory));
+
+ return camelContext;
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ public void configure() throws Exception {
+ from("activemq:queue:hello").to("mock:result");
+ }
+ };
+ }
+}
diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
index ec1a8dc..c9217f4 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
@@ -660,6 +660,7 @@ public class KafkaConsumer extends DefaultConsumer {
message.setHeader(KafkaConstants.OFFSET, record.offset());
message.setHeader(KafkaConstants.HEADERS, record.headers());
message.setHeader(KafkaConstants.TIMESTAMP, record.timestamp());
+ message.setHeader(Exchange.MESSAGE_TIMESTAMP, record.timestamp());
if (record.key() != null) {
message.setHeader(KafkaConstants.KEY, record.key());
}
diff --git a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsMessage.java b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsMessage.java
index e683021..1f2bee4 100644
--- a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsMessage.java
+++ b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsMessage.java
@@ -258,6 +258,11 @@ public class SjmsMessage extends DefaultMessage {
protected void populateInitialHeaders(Map<String, Object> map) {
if (jmsMessage != null && map != null) {
map.putAll(getBinding().extractHeadersFromJms(jmsMessage, getExchange()));
+ try {
+ map.put(Exchange.MESSAGE_TIMESTAMP, jmsMessage.getJMSTimestamp());
+ } catch (JMSException e) {
+ // ignore
+ }
}
}
diff --git a/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/JmsMessageTimestampTest.java b/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/JmsMessageTimestampTest.java
new file mode 100644
index 0000000..a249ca5
--- /dev/null
+++ b/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/JmsMessageTimestampTest.java
@@ -0,0 +1,46 @@
+/*
+ * 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.component.sjms;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.sjms.support.JmsTestSupport;
+import org.junit.jupiter.api.Test;
+
+public class JmsMessageTimestampTest extends JmsTestSupport {
+
+ @Test
+ public void testMessageTimestamp() throws Exception {
+ MockEndpoint result = getMockEndpoint("mock:result");
+ result.expectedMessageCount(1);
+ result.message(0).header(Exchange.MESSAGE_TIMESTAMP).isGreaterThan(0);
+
+ template.sendBody("sjms:queue:hello", "Hello World");
+
+ result.assertIsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ public void configure() throws Exception {
+ from("sjms:queue:hello").to("mock:result");
+ }
+ };
+ }
+}
diff --git a/components/camel-vertx/camel-vertx-kafka/camel-vertx-kafka-component/src/main/java/org/apache/camel/component/vertx/kafka/VertxKafkaConsumer.java b/components/camel-vertx/camel-vertx-kafka/camel-vertx-kafka-component/src/main/java/org/apache/camel/component/vertx/kafka/VertxKafkaConsumer.java
index b1b79aa..45c292d 100644
--- a/components/camel-vertx/camel-vertx-kafka/camel-vertx-kafka-component/src/main/java/org/apache/camel/component/vertx/kafka/VertxKafkaConsumer.java
+++ b/components/camel-vertx/camel-vertx-kafka/camel-vertx-kafka-component/src/main/java/org/apache/camel/component/vertx/kafka/VertxKafkaConsumer.java
@@ -151,6 +151,7 @@ public class VertxKafkaConsumer extends DefaultConsumer implements Suspendable {
message.setHeader(VertxKafkaConstants.OFFSET, record.offset());
message.setHeader(VertxKafkaConstants.HEADERS, record.headers());
message.setHeader(VertxKafkaConstants.TIMESTAMP, record.timestamp());
+ message.setHeader(Exchange.MESSAGE_TIMESTAMP, record.timestamp());
message.setHeader(VertxKafkaConstants.MESSAGE_KEY, record.key());
// set headers for the manual offsets commit
diff --git a/core/camel-api/src/generated/java/org/apache/camel/ExchangeConstantProvider.java b/core/camel-api/src/generated/java/org/apache/camel/ExchangeConstantProvider.java
index 0c541a8..6f9b37b 100644
--- a/core/camel-api/src/generated/java/org/apache/camel/ExchangeConstantProvider.java
+++ b/core/camel-api/src/generated/java/org/apache/camel/ExchangeConstantProvider.java
@@ -11,7 +11,7 @@ public class ExchangeConstantProvider {
private static final Map<String, String> MAP;
static {
- Map<String, String> map = new HashMap<>(150);
+ Map<String, String> map = new HashMap<>(151);
map.put("ACCEPT_CONTENT_TYPE", "CamelAcceptContentType");
map.put("AGGREGATED_COLLECTION_GUARD", "CamelAggregatedCollectionGuard");
map.put("AGGREGATED_COMPLETED_BY", "CamelAggregatedCompletedBy");
@@ -109,6 +109,7 @@ public class ExchangeConstantProvider {
map.put("MESSAGE_HISTORY", "CamelMessageHistory");
map.put("MESSAGE_HISTORY_HEADER_FORMAT", "CamelMessageHistoryHeaderFormat");
map.put("MESSAGE_HISTORY_OUTPUT_FORMAT", "CamelMessageHistoryOutputFormat");
+ map.put("MESSAGE_TIMESTAMP", "CamelMessageTimestamp");
map.put("MULTICAST_COMPLETE", "CamelMulticastComplete");
map.put("MULTICAST_INDEX", "CamelMulticastIndex");
map.put("NOTIFY_EVENT", "CamelNotifyEvent");
diff --git a/core/camel-api/src/main/java/org/apache/camel/Exchange.java b/core/camel-api/src/main/java/org/apache/camel/Exchange.java
index a263a03..2b9c237 100644
--- a/core/camel-api/src/main/java/org/apache/camel/Exchange.java
+++ b/core/camel-api/src/main/java/org/apache/camel/Exchange.java
@@ -184,6 +184,7 @@ public interface Exchange {
String MESSAGE_HISTORY = "CamelMessageHistory";
String MESSAGE_HISTORY_HEADER_FORMAT = "CamelMessageHistoryHeaderFormat";
String MESSAGE_HISTORY_OUTPUT_FORMAT = "CamelMessageHistoryOutputFormat";
+ String MESSAGE_TIMESTAMP = "CamelMessageTimestamp";
String MULTICAST_INDEX = "CamelMulticastIndex";
String MULTICAST_COMPLETE = "CamelMulticastComplete";
diff --git a/core/camel-api/src/main/java/org/apache/camel/Message.java b/core/camel-api/src/main/java/org/apache/camel/Message.java
index a2db06f..53407e2 100644
--- a/core/camel-api/src/main/java/org/apache/camel/Message.java
+++ b/core/camel-api/src/main/java/org/apache/camel/Message.java
@@ -53,6 +53,16 @@ public interface Message {
String getMessageId();
/**
+ * Returns the timestamp that this messages originates from.
+ * <p/>
+ * Some systems like JMS, Kafka, AWS have a timestamp on the event/message, that Camel received. This method returns
+ * the timestamp, if a timestamp exists.
+ *
+ * @return the timestamp, or <tt>0</tt> if the message has no source timestamp.
+ */
+ long getMessageTimestamp();
+
+ /**
* Sets the id of the message
*
* @param messageId id of the message
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerMessageTimestampTest.java b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerMessageTimestampTest.java
new file mode 100644
index 0000000..a7350b1
--- /dev/null
+++ b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerMessageTimestampTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.component.file;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.Test;
+
+public class FileConsumerMessageTimestampTest extends ContextTestSupport {
+
+ @Test
+ public void testMessageTimestamp() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedMessageCount(1);
+ mock.message(0).header(Exchange.MESSAGE_TIMESTAMP).isGreaterThan(0L);
+
+ template.sendBodyAndHeader(fileUri(), "Hello World", Exchange.FILE_NAME, "hello.txt");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from(fileUri("?noop=true&initialDelay=0&delay=10")).convertBodyTo(String.class)
+ .to("mock:result");
+ }
+ };
+ }
+}
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/MessageSupportTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/MessageSupportTest.java
index 6a20553..273fa82 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/MessageSupportTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/MessageSupportTest.java
@@ -117,4 +117,17 @@ public class MessageSupportTest extends ContextTestSupport {
assertSame(exchange, three.getExchange());
}
+ @Test
+ public void testNoMessageTimestamp() throws Exception {
+ Exchange exchange = new DefaultExchange(context);
+ assertEquals(0L, exchange.getMessage().getMessageTimestamp());
+ }
+
+ @Test
+ public void testMessageTimestamp() throws Exception {
+ Exchange exchange = new DefaultExchange(context);
+ exchange.getMessage().setHeader(Exchange.MESSAGE_TIMESTAMP, 1234L);
+ assertEquals(1234L, exchange.getMessage().getMessageTimestamp());
+ }
+
}
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/MessageSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/MessageSupport.java
index d07a3f7..2148c5a 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/MessageSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/MessageSupport.java
@@ -39,6 +39,7 @@ public abstract class MessageSupport implements Message, CamelContextAware, Data
private Exchange exchange;
private Object body;
private String messageId;
+ private long messageTimestamp;
private DataType dataType;
@Override
@@ -279,6 +280,15 @@ public abstract class MessageSupport implements Message, CamelContextAware, Data
}
@Override
+ public long getMessageTimestamp() {
+ if (messageTimestamp == 0) {
+ // use -1 to indicate no timestamp exists
+ messageTimestamp = getHeader(Exchange.MESSAGE_TIMESTAMP, -1L, long.class);
+ }
+ return messageTimestamp <= 0 ? 0 : messageTimestamp;
+ }
+
+ @Override
public void setMessageId(String messageId) {
this.messageId = messageId;
}
[camel] 02/04: CAMEL-16627: camel-core - Add common header for
source timestamp
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit f01afa342064f2f37af7253247d72637beb70e06
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Jun 8 12:09:59 2021 +0200
CAMEL-16627: camel-core - Add common header for source timestamp
---
core/camel-api/src/main/java/org/apache/camel/Exchange.java | 2 ++
core/camel-api/src/main/java/org/apache/camel/Message.java | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/core/camel-api/src/main/java/org/apache/camel/Exchange.java b/core/camel-api/src/main/java/org/apache/camel/Exchange.java
index 2b9c237..e75d853 100644
--- a/core/camel-api/src/main/java/org/apache/camel/Exchange.java
+++ b/core/camel-api/src/main/java/org/apache/camel/Exchange.java
@@ -669,6 +669,8 @@ public interface Exchange {
/**
* Gets the timestamp in millis when this exchange was created.
+ *
+ * @see Message#getMessageTimestamp()
*/
long getCreated();
diff --git a/core/camel-api/src/main/java/org/apache/camel/Message.java b/core/camel-api/src/main/java/org/apache/camel/Message.java
index 53407e2..0164405 100644
--- a/core/camel-api/src/main/java/org/apache/camel/Message.java
+++ b/core/camel-api/src/main/java/org/apache/camel/Message.java
@@ -57,8 +57,13 @@ public interface Message {
* <p/>
* Some systems like JMS, Kafka, AWS have a timestamp on the event/message, that Camel received. This method returns
* the timestamp, if a timestamp exists.
+ * <p/>
+ * The message timestamp and exchange created are not the same. An exchange always have a created timestamp which is the
+ * local timestamp when Camel created the exchange. The message timestamp is only available in some Camel components
+ * when the consumer is able to extract the timestamp from the source event.
*
* @return the timestamp, or <tt>0</tt> if the message has no source timestamp.
+ * @see Exchange#getCreated()
*/
long getMessageTimestamp();
[camel] 03/04: Polished doc
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 578ad274abf84c878f9819328cfaec7ad02eb1d6
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Jun 8 13:48:35 2021 +0200
Polished doc
---
.../camel/catalog/docs/activemq-component.adoc | 4 ++--
.../apache/camel/catalog/docs/jms-component.adoc | 4 ++--
.../apache/camel/component/activemq/activemq.json | 4 ++--
.../src/main/docs/activemq-component.adoc | 4 ++--
.../org/apache/camel/component/jms/jms.json | 4 ++--
.../camel-jms/src/main/docs/jms-component.adoc | 4 ++--
.../camel/component/jms/JmsConfiguration.java | 8 ++++----
.../component/jms/JmsMessageTimestampTest.java | 4 ++--
.../dsl/ActivemqComponentBuilderFactory.java | 4 ++--
.../component/dsl/JmsComponentBuilderFactory.java | 4 ++--
.../dsl/ActiveMQEndpointBuilderFactory.java | 24 +++++++++++-----------
.../endpoint/dsl/JmsEndpointBuilderFactory.java | 24 +++++++++++-----------
.../modules/ROOT/pages/activemq-component.adoc | 4 ++--
.../modules/ROOT/pages/jms-component.adoc | 4 ++--
14 files changed, 50 insertions(+), 50 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/activemq-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/activemq-component.adoc
index fa20451..80d4e82 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/activemq-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/activemq-component.adoc
@@ -146,7 +146,7 @@ The ActiveMQ component supports 102 options, which are listed below.
| *requestTimeoutCheckerInterval* (advanced) | Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout. | 1000 | long
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used | false | boolean
| *transferException* (advanced) | If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a javax.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes preced [...]
-| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
+| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
| *trustAllPackages* (advanced) | Define if all Java packages are trusted or not (for Java object JMS message types). Notice its not recommended practice to send Java serialized objects over network. Setting this to true can expose security risks, so use this with care. | false | boolean
| *useMessageIDAsCorrelationID* (advanced) | Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. | false | boolean
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedCounter* (advanced) | Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled. | 50 | int
@@ -276,7 +276,7 @@ with the following path and query parameters:
| *requestTimeoutCheckerInterval* (advanced) | Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout. | 1000 | long
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used | false | boolean
| *transferException* (advanced) | If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a javax.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes preced [...]
-| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
+| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
| *useMessageIDAsCorrelationID* (advanced) | Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. | false | boolean
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedCounter* (advanced) | Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled. | 50 | int
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedThreadSleepingTime* (advanced) | Interval in millis to sleep each time while waiting for provisional correlation id to be updated. | 100 | long
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jms-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jms-component.adoc
index 78c9f0d..ab8da2b 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jms-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jms-component.adoc
@@ -277,7 +277,7 @@ The JMS component supports 98 options, which are listed below.
| *requestTimeoutCheckerInterval* (advanced) | Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout. | 1000 | long
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used | false | boolean
| *transferException* (advanced) | If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a javax.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes preced [...]
-| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
+| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
| *useMessageIDAsCorrelationID* (advanced) | Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. | false | boolean
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedCounter* (advanced) | Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled. | 50 | int
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedThreadSleepingTime* (advanced) | Interval in millis to sleep each time while waiting for provisional correlation id to be updated. | 100 | long
@@ -419,7 +419,7 @@ with the following path and query parameters:
| *requestTimeoutCheckerInterval* (advanced) | Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout. | 1000 | long
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used | false | boolean
| *transferException* (advanced) | If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a javax.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes preced [...]
-| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
+| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
| *useMessageIDAsCorrelationID* (advanced) | Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. | false | boolean
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedCounter* (advanced) | Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled. | 50 | int
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedThreadSleepingTime* (advanced) | Interval in millis to sleep each time while waiting for provisional correlation id to be updated. | 100 | long
diff --git a/components/camel-activemq/src/generated/resources/org/apache/camel/component/activemq/activemq.json b/components/camel-activemq/src/generated/resources/org/apache/camel/component/activemq/activemq.json
index 0470f81..65723f2 100644
--- a/components/camel-activemq/src/generated/resources/org/apache/camel/component/activemq/activemq.json
+++ b/components/camel-activemq/src/generated/resources/org/apache/camel/component/activemq/activemq.json
@@ -108,7 +108,7 @@
"requestTimeoutCheckerInterval": { "kind": "property", "displayName": "Request Timeout Checker Interval", "group": "advanced", "label": "advanced", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1000", "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Configures how often Camel should check for timed out Exchanges when do [...]
"synchronous": { "kind": "property", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Sets whether synchronous processing should be strictly used" },
"transferException": { "kind": "property", "displayName": "Transfer Exception", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consu [...]
- "transferExchange": { "kind": "property", "displayName": "Transfer Exchange", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "You can transfer the exchange over the wire instead of just the body and headers. The following fi [...]
+ "transferExchange": { "kind": "property", "displayName": "Transfer Exchange", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "You can transfer the exchange over the wire instead of just the body and headers. The following fi [...]
"trustAllPackages": { "kind": "property", "displayName": "Trust All Packages", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "description": "Define if all Java packages are trusted or not (for Java object JMS message types). Notice its not recommended practice to send Java serialized objects over network. Setting this to true [...]
"useMessageIDAsCorrelationID": { "kind": "property", "displayName": "Use Message IDAs Correlation ID", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Specifies whether JMSMessageID should always be used as JMSCorrelationID [...]
"waitForProvisionCorrelationToBeUpdatedCounter": { "kind": "property", "displayName": "Wait For Provision Correlation To Be Updated Counter", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 50, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Number of times to wait for provisional c [...]
@@ -210,7 +210,7 @@
"requestTimeoutCheckerInterval": { "kind": "parameter", "displayName": "Request Timeout Checker Interval", "group": "advanced", "label": "advanced", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1000", "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Configures how often Camel should check for timed out Exchanges when d [...]
"synchronous": { "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Sets whether synchronous processing should be strictly used" },
"transferException": { "kind": "parameter", "displayName": "Transfer Exception", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the cons [...]
- "transferExchange": { "kind": "parameter", "displayName": "Transfer Exchange", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "You can transfer the exchange over the wire instead of just the body and headers. The following f [...]
+ "transferExchange": { "kind": "parameter", "displayName": "Transfer Exchange", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "You can transfer the exchange over the wire instead of just the body and headers. The following f [...]
"useMessageIDAsCorrelationID": { "kind": "parameter", "displayName": "Use Message IDAs Correlation ID", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Specifies whether JMSMessageID should always be used as JMSCorrelationID [...]
"waitForProvisionCorrelationToBeUpdatedCounter": { "kind": "parameter", "displayName": "Wait For Provision Correlation To Be Updated Counter", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 50, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Number of times to wait for provisional [...]
"waitForProvisionCorrelationToBeUpdatedThreadSleepingTime": { "kind": "parameter", "displayName": "Wait For Provision Correlation To Be Updated Thread Sleeping Time", "group": "advanced", "label": "advanced", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "100", "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Interval in [...]
diff --git a/components/camel-activemq/src/main/docs/activemq-component.adoc b/components/camel-activemq/src/main/docs/activemq-component.adoc
index fa20451..80d4e82 100644
--- a/components/camel-activemq/src/main/docs/activemq-component.adoc
+++ b/components/camel-activemq/src/main/docs/activemq-component.adoc
@@ -146,7 +146,7 @@ The ActiveMQ component supports 102 options, which are listed below.
| *requestTimeoutCheckerInterval* (advanced) | Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout. | 1000 | long
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used | false | boolean
| *transferException* (advanced) | If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a javax.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes preced [...]
-| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
+| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
| *trustAllPackages* (advanced) | Define if all Java packages are trusted or not (for Java object JMS message types). Notice its not recommended practice to send Java serialized objects over network. Setting this to true can expose security risks, so use this with care. | false | boolean
| *useMessageIDAsCorrelationID* (advanced) | Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. | false | boolean
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedCounter* (advanced) | Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled. | 50 | int
@@ -276,7 +276,7 @@ with the following path and query parameters:
| *requestTimeoutCheckerInterval* (advanced) | Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout. | 1000 | long
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used | false | boolean
| *transferException* (advanced) | If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a javax.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes preced [...]
-| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
+| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
| *useMessageIDAsCorrelationID* (advanced) | Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. | false | boolean
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedCounter* (advanced) | Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled. | 50 | int
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedThreadSleepingTime* (advanced) | Interval in millis to sleep each time while waiting for provisional correlation id to be updated. | 100 | long
diff --git a/components/camel-jms/src/generated/resources/org/apache/camel/component/jms/jms.json b/components/camel-jms/src/generated/resources/org/apache/camel/component/jms/jms.json
index 03e9fc7..e085f9f 100644
--- a/components/camel-jms/src/generated/resources/org/apache/camel/component/jms/jms.json
+++ b/components/camel-jms/src/generated/resources/org/apache/camel/component/jms/jms.json
@@ -106,7 +106,7 @@
"requestTimeoutCheckerInterval": { "kind": "property", "displayName": "Request Timeout Checker Interval", "group": "advanced", "label": "advanced", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1000", "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Configures how often Camel should check for timed out Exchanges when do [...]
"synchronous": { "kind": "property", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Sets whether synchronous processing should be strictly used" },
"transferException": { "kind": "property", "displayName": "Transfer Exception", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consu [...]
- "transferExchange": { "kind": "property", "displayName": "Transfer Exchange", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "You can transfer the exchange over the wire instead of just the body and headers. The following fi [...]
+ "transferExchange": { "kind": "property", "displayName": "Transfer Exchange", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "You can transfer the exchange over the wire instead of just the body and headers. The following fi [...]
"useMessageIDAsCorrelationID": { "kind": "property", "displayName": "Use Message IDAs Correlation ID", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Specifies whether JMSMessageID should always be used as JMSCorrelationID [...]
"waitForProvisionCorrelationToBeUpdatedCounter": { "kind": "property", "displayName": "Wait For Provision Correlation To Be Updated Counter", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 50, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Number of times to wait for provisional c [...]
"waitForProvisionCorrelationToBeUpdatedThreadSleepingTime": { "kind": "property", "displayName": "Wait For Provision Correlation To Be Updated Thread Sleeping Time", "group": "advanced", "label": "advanced", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "100", "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Interval in [...]
@@ -206,7 +206,7 @@
"requestTimeoutCheckerInterval": { "kind": "parameter", "displayName": "Request Timeout Checker Interval", "group": "advanced", "label": "advanced", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1000", "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Configures how often Camel should check for timed out Exchanges when d [...]
"synchronous": { "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Sets whether synchronous processing should be strictly used" },
"transferException": { "kind": "parameter", "displayName": "Transfer Exception", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the cons [...]
- "transferExchange": { "kind": "parameter", "displayName": "Transfer Exchange", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "You can transfer the exchange over the wire instead of just the body and headers. The following f [...]
+ "transferExchange": { "kind": "parameter", "displayName": "Transfer Exchange", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "You can transfer the exchange over the wire instead of just the body and headers. The following f [...]
"useMessageIDAsCorrelationID": { "kind": "parameter", "displayName": "Use Message IDAs Correlation ID", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Specifies whether JMSMessageID should always be used as JMSCorrelationID [...]
"waitForProvisionCorrelationToBeUpdatedCounter": { "kind": "parameter", "displayName": "Wait For Provision Correlation To Be Updated Counter", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 50, "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Number of times to wait for provisional [...]
"waitForProvisionCorrelationToBeUpdatedThreadSleepingTime": { "kind": "parameter", "displayName": "Wait For Provision Correlation To Be Updated Thread Sleeping Time", "group": "advanced", "label": "advanced", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "100", "configurationClass": "org.apache.camel.component.jms.JmsConfiguration", "configurationField": "configuration", "description": "Interval in [...]
diff --git a/components/camel-jms/src/main/docs/jms-component.adoc b/components/camel-jms/src/main/docs/jms-component.adoc
index 78c9f0d..ab8da2b 100644
--- a/components/camel-jms/src/main/docs/jms-component.adoc
+++ b/components/camel-jms/src/main/docs/jms-component.adoc
@@ -277,7 +277,7 @@ The JMS component supports 98 options, which are listed below.
| *requestTimeoutCheckerInterval* (advanced) | Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout. | 1000 | long
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used | false | boolean
| *transferException* (advanced) | If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a javax.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes preced [...]
-| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
+| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
| *useMessageIDAsCorrelationID* (advanced) | Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. | false | boolean
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedCounter* (advanced) | Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled. | 50 | int
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedThreadSleepingTime* (advanced) | Interval in millis to sleep each time while waiting for provisional correlation id to be updated. | 100 | long
@@ -419,7 +419,7 @@ with the following path and query parameters:
| *requestTimeoutCheckerInterval* (advanced) | Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout. | 1000 | long
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used | false | boolean
| *transferException* (advanced) | If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a javax.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes preced [...]
-| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
+| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
| *useMessageIDAsCorrelationID* (advanced) | Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. | false | boolean
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedCounter* (advanced) | Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled. | 50 | int
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedThreadSleepingTime* (advanced) | Interval in millis to sleep each time while waiting for provisional correlation id to be updated. | 100 | long
diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
index 939a70a..c8deda5 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
@@ -353,8 +353,8 @@ public class JmsConfiguration implements Cloneable {
+ " exchange properties, exchange exception."
+ " This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level."
+ " You must enable this option on both the producer and consumer side, so Camel knows the payloads is an Exchange and not a regular payload."
- + " Use this with caution as the data is using Java Object serialization and requires the received to be able to deserialize the data at Class level, "
- + " which forces a strong coupling between the producers and consumer having to use compatible Camel versions!")
+ + " Use this with caution as the data is using Java Object serialization and requires the receiver to be able to deserialize the data at Class level, "
+ + " which forces a strong coupling between the producers and consumers having to use compatible Camel versions!")
private boolean transferExchange;
@UriParam(label = "advanced",
description = "Controls whether or not to include serialized headers."
@@ -1911,8 +1911,8 @@ public class JmsConfiguration implements Cloneable {
* exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and
* log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the
* payloads is an Exchange and not a regular payload. Use this with caution as the data is using Java Object
- * serialization and requires the received to be able to deserialize the data at Class level, which forces a strong
- * coupling between the producers and consumer having to use compatible Camel versions!
+ * serialization and requires the receiver to be able to deserialize the data at Class level, which forces a strong
+ * coupling between the producers and consumers having to use compatible Camel versions!
*/
public void setTransferExchange(boolean transferExchange) {
this.transferExchange = transferExchange;
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsMessageTimestampTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsMessageTimestampTest.java
index 6a7ef60..ec90916 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsMessageTimestampTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsMessageTimestampTest.java
@@ -16,6 +16,8 @@
*/
package org.apache.camel.component.jms;
+import javax.jms.ConnectionFactory;
+
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
@@ -23,8 +25,6 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.junit.jupiter.api.Test;
-import javax.jms.ConnectionFactory;
-
import static org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge;
public class JmsMessageTimestampTest extends CamelTestSupport {
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ActivemqComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ActivemqComponentBuilderFactory.java
index 8ab7453..44ab050 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ActivemqComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ActivemqComponentBuilderFactory.java
@@ -1725,9 +1725,9 @@ public interface ActivemqComponentBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option is a: <code>boolean</code> type.
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JmsComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JmsComponentBuilderFactory.java
index fc53aa5..4b83eff 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JmsComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JmsComponentBuilderFactory.java
@@ -1652,9 +1652,9 @@ public interface JmsComponentBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option is a: <code>boolean</code> type.
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ActiveMQEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ActiveMQEndpointBuilderFactory.java
index 4f8361c..396f043 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ActiveMQEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ActiveMQEndpointBuilderFactory.java
@@ -2377,9 +2377,9 @@ public interface ActiveMQEndpointBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option is a: <code>boolean</code> type.
@@ -2404,9 +2404,9 @@ public interface ActiveMQEndpointBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option will be converted to a <code>boolean</code>
@@ -4870,9 +4870,9 @@ public interface ActiveMQEndpointBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option is a: <code>boolean</code> type.
@@ -4897,9 +4897,9 @@ public interface ActiveMQEndpointBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option will be converted to a <code>boolean</code>
@@ -6473,9 +6473,9 @@ public interface ActiveMQEndpointBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option is a: <code>boolean</code> type.
@@ -6500,9 +6500,9 @@ public interface ActiveMQEndpointBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option will be converted to a <code>boolean</code>
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JmsEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JmsEndpointBuilderFactory.java
index 6a032b8..5ca2ffc 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JmsEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JmsEndpointBuilderFactory.java
@@ -2321,9 +2321,9 @@ public interface JmsEndpointBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option is a: <code>boolean</code> type.
@@ -2348,9 +2348,9 @@ public interface JmsEndpointBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option will be converted to a <code>boolean</code>
@@ -4806,9 +4806,9 @@ public interface JmsEndpointBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option is a: <code>boolean</code> type.
@@ -4833,9 +4833,9 @@ public interface JmsEndpointBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option will be converted to a <code>boolean</code>
@@ -6400,9 +6400,9 @@ public interface JmsEndpointBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option is a: <code>boolean</code> type.
@@ -6427,9 +6427,9 @@ public interface JmsEndpointBuilderFactory {
* it at WARN level. You must enable this option on both the producer
* and consumer side, so Camel knows the payloads is an Exchange and not
* a regular payload. Use this with caution as the data is using Java
- * Object serialization and requires the received to be able to
+ * Object serialization and requires the receiver to be able to
* deserialize the data at Class level, which forces a strong coupling
- * between the producers and consumer having to use compatible Camel
+ * between the producers and consumers having to use compatible Camel
* versions!.
*
* The option will be converted to a <code>boolean</code>
diff --git a/docs/components/modules/ROOT/pages/activemq-component.adoc b/docs/components/modules/ROOT/pages/activemq-component.adoc
index 5025df1..5626204 100644
--- a/docs/components/modules/ROOT/pages/activemq-component.adoc
+++ b/docs/components/modules/ROOT/pages/activemq-component.adoc
@@ -148,7 +148,7 @@ The ActiveMQ component supports 102 options, which are listed below.
| *requestTimeoutCheckerInterval* (advanced) | Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout. | 1000 | long
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used | false | boolean
| *transferException* (advanced) | If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a javax.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes preced [...]
-| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
+| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
| *trustAllPackages* (advanced) | Define if all Java packages are trusted or not (for Java object JMS message types). Notice its not recommended practice to send Java serialized objects over network. Setting this to true can expose security risks, so use this with care. | false | boolean
| *useMessageIDAsCorrelationID* (advanced) | Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. | false | boolean
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedCounter* (advanced) | Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled. | 50 | int
@@ -278,7 +278,7 @@ with the following path and query parameters:
| *requestTimeoutCheckerInterval* (advanced) | Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout. | 1000 | long
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used | false | boolean
| *transferException* (advanced) | If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a javax.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes preced [...]
-| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
+| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
| *useMessageIDAsCorrelationID* (advanced) | Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. | false | boolean
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedCounter* (advanced) | Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled. | 50 | int
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedThreadSleepingTime* (advanced) | Interval in millis to sleep each time while waiting for provisional correlation id to be updated. | 100 | long
diff --git a/docs/components/modules/ROOT/pages/jms-component.adoc b/docs/components/modules/ROOT/pages/jms-component.adoc
index cc68f34..fdfa6ee 100644
--- a/docs/components/modules/ROOT/pages/jms-component.adoc
+++ b/docs/components/modules/ROOT/pages/jms-component.adoc
@@ -279,7 +279,7 @@ The JMS component supports 98 options, which are listed below.
| *requestTimeoutCheckerInterval* (advanced) | Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout. | 1000 | long
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used | false | boolean
| *transferException* (advanced) | If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a javax.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes preced [...]
-| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
+| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
| *useMessageIDAsCorrelationID* (advanced) | Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. | false | boolean
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedCounter* (advanced) | Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled. | 50 | int
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedThreadSleepingTime* (advanced) | Interval in millis to sleep each time while waiting for provisional correlation id to be updated. | 100 | long
@@ -421,7 +421,7 @@ with the following path and query parameters:
| *requestTimeoutCheckerInterval* (advanced) | Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout. | 1000 | long
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used | false | boolean
| *transferException* (advanced) | If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a javax.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes preced [...]
-| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
+| *transferExchange* (advanced) | You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an E [...]
| *useMessageIDAsCorrelationID* (advanced) | Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages. | false | boolean
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedCounter* (advanced) | Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled. | 50 | int
| *waitForProvisionCorrelationTo{zwsp}BeUpdatedThreadSleepingTime* (advanced) | Interval in millis to sleep each time while waiting for provisional correlation id to be updated. | 100 | long
[camel] 04/04: CAMEL-16627: camel-core - Add common header for
source timestamp
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit a9deb523db39907b1820f08ab7bf9a4d53ad16c0
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Jun 8 15:26:08 2021 +0200
CAMEL-16627: camel-core - Add common header for source timestamp
---
.../org/apache/camel/catalog/docs/simple-language.adoc | 8 ++++++++
.../src/main/java/org/apache/camel/Message.java | 8 ++++----
.../docs/modules/languages/pages/simple-language.adoc | 8 ++++++++
.../language/simple/ast/SimpleFunctionExpression.java | 4 ++++
.../org/apache/camel/language/simple/SimpleTest.java | 6 ++++++
.../apache/camel/support/builder/ExpressionBuilder.java | 16 ++++++++++++++++
.../modules/languages/pages/simple-language.adoc | 8 ++++++++
7 files changed, 54 insertions(+), 4 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/simple-language.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/simple-language.adoc
index f981dec..01e4dc3 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/simple-language.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/simple-language.adoc
@@ -82,6 +82,14 @@ OGNL expression.
|id |String |the input message id
+|messageTimestamp |String |the input message timestamp (millis since epoc) that this message originates from.
+Some systems like JMS, Kafka, AWS have a timestamp on the event/message, that Camel received. This method returns
+the timestamp, if a timestamp exists.
+The message timestamp and exchange created are not the same. An exchange always have a created timestamp which is the
+local timestamp when Camel created the exchange. The message timestamp is only available in some Camel components
+when the consumer is able to extract the timestamp from the source event.
+If the message has no timestamp then 0 is returned.
+
|body |Object |the input body
|in.body |Object |*deprecated* the input body
diff --git a/core/camel-api/src/main/java/org/apache/camel/Message.java b/core/camel-api/src/main/java/org/apache/camel/Message.java
index 0164405..3a748fe 100644
--- a/core/camel-api/src/main/java/org/apache/camel/Message.java
+++ b/core/camel-api/src/main/java/org/apache/camel/Message.java
@@ -58,12 +58,12 @@ public interface Message {
* Some systems like JMS, Kafka, AWS have a timestamp on the event/message, that Camel received. This method returns
* the timestamp, if a timestamp exists.
* <p/>
- * The message timestamp and exchange created are not the same. An exchange always have a created timestamp which is the
- * local timestamp when Camel created the exchange. The message timestamp is only available in some Camel components
- * when the consumer is able to extract the timestamp from the source event.
+ * The message timestamp and exchange created are not the same. An exchange always have a created timestamp which is
+ * the local timestamp when Camel created the exchange. The message timestamp is only available in some Camel
+ * components when the consumer is able to extract the timestamp from the source event.
*
* @return the timestamp, or <tt>0</tt> if the message has no source timestamp.
- * @see Exchange#getCreated()
+ * @see Exchange#getCreated()
*/
long getMessageTimestamp();
diff --git a/core/camel-core-languages/src/main/docs/modules/languages/pages/simple-language.adoc b/core/camel-core-languages/src/main/docs/modules/languages/pages/simple-language.adoc
index f981dec..01e4dc3 100644
--- a/core/camel-core-languages/src/main/docs/modules/languages/pages/simple-language.adoc
+++ b/core/camel-core-languages/src/main/docs/modules/languages/pages/simple-language.adoc
@@ -82,6 +82,14 @@ OGNL expression.
|id |String |the input message id
+|messageTimestamp |String |the input message timestamp (millis since epoc) that this message originates from.
+Some systems like JMS, Kafka, AWS have a timestamp on the event/message, that Camel received. This method returns
+the timestamp, if a timestamp exists.
+The message timestamp and exchange created are not the same. An exchange always have a created timestamp which is the
+local timestamp when Camel created the exchange. The message timestamp is only available in some Camel components
+when the consumer is able to extract the timestamp from the source event.
+If the message has no timestamp then 0 is returned.
+
|body |Object |the input body
|in.body |Object |*deprecated* the input body
diff --git a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java
index 5212c57..21993f5 100644
--- a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java
+++ b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java
@@ -416,6 +416,8 @@ public class SimpleFunctionExpression extends LiteralExpression {
return ExpressionBuilder.bodyOneLine();
} else if (ObjectHelper.equal(expression, "id")) {
return ExpressionBuilder.messageIdExpression();
+ } else if (ObjectHelper.equal(expression, "messageTimestamp")) {
+ return ExpressionBuilder.messageTimestampExpression();
} else if (ObjectHelper.equal(expression, "exchangeId")) {
return ExpressionBuilder.exchangeIdExpression();
} else if (ObjectHelper.equal(expression, "exchange")) {
@@ -774,6 +776,8 @@ public class SimpleFunctionExpression extends LiteralExpression {
return "bodyOneLine(exchange)";
} else if (ObjectHelper.equal(expression, "id")) {
return "message.getMessageId()";
+ } else if (ObjectHelper.equal(expression, "messageTimestamp")) {
+ return "message.getMessageTimestamp()";
} else if (ObjectHelper.equal(expression, "exchangeId")) {
return "exchange.getExchangeId()";
} else if (ObjectHelper.equal(expression, "exchange")) {
diff --git a/core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java b/core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
index a7e7b8c..5036876 100644
--- a/core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
@@ -1951,6 +1951,12 @@ public class SimpleTest extends LanguageTestSupport {
assertExpression(exp, "99");
}
+ @Test
+ public void testMessageTimestamp() throws Exception {
+ exchange.getIn().setHeader(Exchange.MESSAGE_TIMESTAMP, 1234L);
+ assertExpression("${messageTimestamp}", 1234L);
+ }
+
@Override
protected String getLanguageName() {
return "simple";
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java b/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java
index ac839be..9951a5b 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java
@@ -1591,6 +1591,22 @@ public class ExpressionBuilder {
}
/**
+ * Returns an Expression for the inbound message timestamp
+ */
+ public static Expression messageTimestampExpression() {
+ return new ExpressionAdapter() {
+ public Object evaluate(Exchange exchange) {
+ return exchange.getIn().getMessageTimestamp();
+ }
+
+ @Override
+ public String toString() {
+ return "messageTimestamp";
+ }
+ };
+ }
+
+ /**
* Returns an Expression for the exchange id
*/
public static Expression exchangeIdExpression() {
diff --git a/docs/components/modules/languages/pages/simple-language.adoc b/docs/components/modules/languages/pages/simple-language.adoc
index a4ac7c3..8ec77dc 100644
--- a/docs/components/modules/languages/pages/simple-language.adoc
+++ b/docs/components/modules/languages/pages/simple-language.adoc
@@ -84,6 +84,14 @@ OGNL expression.
|id |String |the input message id
+|messageTimestamp |String |the input message timestamp (millis since epoc) that this message originates from.
+Some systems like JMS, Kafka, AWS have a timestamp on the event/message, that Camel received. This method returns
+the timestamp, if a timestamp exists.
+The message timestamp and exchange created are not the same. An exchange always have a created timestamp which is the
+local timestamp when Camel created the exchange. The message timestamp is only available in some Camel components
+when the consumer is able to extract the timestamp from the source event.
+If the message has no timestamp then 0 is returned.
+
|body |Object |the input body
|in.body |Object |*deprecated* the input body