This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new 9ffd4f4 CAMEL-12971: Deprecate batch consumer transacted timeout in camel-sjms as this feature wont work reliable. 9ffd4f4 is described below commit 9ffd4f4a1f7a416b4ec39bafb2518e6f9bf4cf7f Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue Aug 4 07:08:57 2020 +0200 CAMEL-12971: Deprecate batch consumer transacted timeout in camel-sjms as this feature wont work reliable. --- .../resources/org/apache/camel/catalog/components/sjms.json | 4 ++-- .../resources/org/apache/camel/catalog/components/sjms2.json | 4 ++-- .../resources/org/apache/camel/catalog/docs/sjms-component.adoc | 9 ++++++--- .../resources/org/apache/camel/catalog/docs/sjms2-component.adoc | 4 ++-- .../resources/org/apache/camel/component/sjms/sjms.json | 4 ++-- components/camel-sjms/src/main/docs/sjms-component.adoc | 9 ++++++--- .../main/java/org/apache/camel/component/sjms/SjmsEndpoint.java | 5 ++++- .../camel/component/sjms/tx/BatchTransactionCommitStrategy.java | 1 + .../sjms/tx/SessionBatchTransactionSynchronization.java | 1 + .../resources/org/apache/camel/component/sjms2/sjms2.json | 4 ++-- components/camel-sjms2/src/main/docs/sjms2-component.adoc | 4 ++-- .../camel/builder/endpoint/dsl/Sjms2EndpointBuilderFactory.java | 4 ++++ .../camel/builder/endpoint/dsl/SjmsEndpointBuilderFactory.java | 4 ++++ docs/components/modules/ROOT/pages/sjms-component.adoc | 9 ++++++--- docs/components/modules/ROOT/pages/sjms2-component.adoc | 4 ++-- 15 files changed, 46 insertions(+), 24 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sjms.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sjms.json index f81be5e..e031e2f 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sjms.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sjms.json @@ -78,8 +78,8 @@ "errorHandlerLoggingLevel": { "kind": "parameter", "displayName": "Error Handler Logging Level", "group": "logging", "label": "consumer,logging", "required": false, "type": "object", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "secret": false, "defaultValue": "WARN", "description": "Allows to configure the default errorHandler logging level for logging uncaught exceptions." }, "errorHandlerLogStackTrace": { "kind": "parameter", "displayName": "Error Handler Log Stack Trace", "group": "logging", "label": "consumer,logging", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Allows to control whether stacktraces should be logged or not, by the default errorHandler." }, "transacted": { "kind": "parameter", "displayName": "Transacted", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Specifies whether to use transacted mode" }, - "transactionBatchCount": { "kind": "parameter", "displayName": "Transaction Batch Count", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "-1", "description": "If transacted sets the number of messages to process before committing a transaction." }, - "transactionBatchTimeout": { "kind": "parameter", "displayName": "Transaction Batch Timeout", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "secret": false, "defaultValue": "5s", "description": "Sets timeout (in millis) for batch transactions, the value should be 1000 or higher." }, + "transactionBatchCount": { "kind": "parameter", "displayName": "Transaction Batch Count", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "integer", "javaType": "int", "deprecated": true, "secret": false, "defaultValue": "-1", "description": "If transacted sets the number of messages to process before committing a transaction." }, + "transactionBatchTimeout": { "kind": "parameter", "displayName": "Transaction Batch Timeout", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "duration", "javaType": "long", "deprecated": true, "secret": false, "defaultValue": "5s", "description": "Sets timeout (in millis) for batch transactions, the value should be 1000 or higher." }, "transactionCommitStrategy": { "kind": "parameter", "displayName": "Transaction Commit Strategy", "group": "transaction", "label": "transaction", "required": false, "type": "object", "javaType": "org.apache.camel.component.sjms.TransactionCommitStrategy", "deprecated": false, "secret": false, "description": "Sets the commit strategy." }, "sharedJMSSession": { "kind": "parameter", "displayName": "Shared JMSSession", "group": "transaction (advanced)", "label": "transaction,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Specifies whether to share JMS session with other SJMS endpoints. Turn this off if your route is accessing to multiple JMS providers. If you need transaction against multiple JMS providers, use jms comp [...] } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sjms2.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sjms2.json index 4d48514..e9e757a 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sjms2.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sjms2.json @@ -81,8 +81,8 @@ "errorHandlerLoggingLevel": { "kind": "parameter", "displayName": "Error Handler Logging Level", "group": "logging", "label": "consumer,logging", "required": false, "type": "object", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "secret": false, "defaultValue": "WARN", "description": "Allows to configure the default errorHandler logging level for logging uncaught exceptions." }, "errorHandlerLogStackTrace": { "kind": "parameter", "displayName": "Error Handler Log Stack Trace", "group": "logging", "label": "consumer,logging", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Allows to control whether stacktraces should be logged or not, by the default errorHandler." }, "transacted": { "kind": "parameter", "displayName": "Transacted", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Specifies whether to use transacted mode" }, - "transactionBatchCount": { "kind": "parameter", "displayName": "Transaction Batch Count", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "-1", "description": "If transacted sets the number of messages to process before committing a transaction." }, - "transactionBatchTimeout": { "kind": "parameter", "displayName": "Transaction Batch Timeout", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "secret": false, "defaultValue": "5s", "description": "Sets timeout (in millis) for batch transactions, the value should be 1000 or higher." }, + "transactionBatchCount": { "kind": "parameter", "displayName": "Transaction Batch Count", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "integer", "javaType": "int", "deprecated": true, "secret": false, "defaultValue": "-1", "description": "If transacted sets the number of messages to process before committing a transaction." }, + "transactionBatchTimeout": { "kind": "parameter", "displayName": "Transaction Batch Timeout", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "duration", "javaType": "long", "deprecated": true, "secret": false, "defaultValue": "5s", "description": "Sets timeout (in millis) for batch transactions, the value should be 1000 or higher." }, "transactionCommitStrategy": { "kind": "parameter", "displayName": "Transaction Commit Strategy", "group": "transaction", "label": "transaction", "required": false, "type": "object", "javaType": "org.apache.camel.component.sjms.TransactionCommitStrategy", "deprecated": false, "secret": false, "description": "Sets the commit strategy." }, "sharedJMSSession": { "kind": "parameter", "displayName": "Shared JMSSession", "group": "transaction (advanced)", "label": "transaction,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Specifies whether to share JMS session with other SJMS endpoints. Turn this off if your route is accessing to multiple JMS providers. If you need transaction against multiple JMS providers, use jms comp [...] } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sjms-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sjms-component.adoc index 301c956..f2a94ab 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sjms-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sjms-component.adoc @@ -27,7 +27,7 @@ Additional key features include: * Plugable Connection Resource Management * Session, Consumer, & Producer Pooling & Caching Management * Batch Consumers -* Transacted Batch Consumers +* Transacted Batch Consumers (*deprecated*) * Support for Customizable Transaction Commit Strategies (Local JMS Transactions only) @@ -179,8 +179,8 @@ with the following path and query parameters: | *errorHandlerLoggingLevel* (logging) | Allows to configure the default errorHandler logging level for logging uncaught exceptions. The value can be one of: TRACE, DEBUG, INFO, WARN, ERROR, OFF | WARN | LoggingLevel | *errorHandlerLogStackTrace* (logging) | Allows to control whether stacktraces should be logged or not, by the default errorHandler. | true | boolean | *transacted* (transaction) | Specifies whether to use transacted mode | false | boolean -| *transactionBatchCount* (transaction) | If transacted sets the number of messages to process before committing a transaction. | -1 | int -| *transactionBatchTimeout* (transaction) | Sets timeout (in millis) for batch transactions, the value should be 1000 or higher. | 5s | long +| *transactionBatchCount* (transaction) | *Deprecated* If transacted sets the number of messages to process before committing a transaction. | -1 | int +| *transactionBatchTimeout* (transaction) | *Deprecated* Sets timeout (in millis) for batch transactions, the value should be 1000 or higher. | 5s | long | *transactionCommitStrategy* (transaction) | Sets the commit strategy. | | TransactionCommitStrategy | *sharedJMSSession* (transaction) | Specifies whether to share JMS session with other SJMS endpoints. Turn this off if your route is accessing to multiple JMS providers. If you need transaction against multiple JMS providers, use jms component to leverage XA transaction. | true | boolean |=== @@ -359,6 +359,9 @@ which is detailed further in the next section. === Transacted Batch Consumers +WARNING: This feature is deprecated because under some situations with race conditions then +transactions that are committed via a timeout may not work correctly. + The SJMS component has been designed to support the batching of local JMS transactions on the consumer endpoints. How they are handled on each is very different though. diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sjms2-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sjms2-component.adoc index 839ff59..3b85a73 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sjms2-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sjms2-component.adoc @@ -191,8 +191,8 @@ with the following path and query parameters: | *errorHandlerLoggingLevel* (logging) | Allows to configure the default errorHandler logging level for logging uncaught exceptions. The value can be one of: TRACE, DEBUG, INFO, WARN, ERROR, OFF | WARN | LoggingLevel | *errorHandlerLogStackTrace* (logging) | Allows to control whether stacktraces should be logged or not, by the default errorHandler. | true | boolean | *transacted* (transaction) | Specifies whether to use transacted mode | false | boolean -| *transactionBatchCount* (transaction) | If transacted sets the number of messages to process before committing a transaction. | -1 | int -| *transactionBatchTimeout* (transaction) | Sets timeout (in millis) for batch transactions, the value should be 1000 or higher. | 5s | long +| *transactionBatchCount* (transaction) | *Deprecated* If transacted sets the number of messages to process before committing a transaction. | -1 | int +| *transactionBatchTimeout* (transaction) | *Deprecated* Sets timeout (in millis) for batch transactions, the value should be 1000 or higher. | 5s | long | *transactionCommitStrategy* (transaction) | Sets the commit strategy. | | TransactionCommitStrategy | *sharedJMSSession* (transaction) | Specifies whether to share JMS session with other SJMS endpoints. Turn this off if your route is accessing to multiple JMS providers. If you need transaction against multiple JMS providers, use jms component to leverage XA transaction. | true | boolean |=== diff --git a/components/camel-sjms/src/generated/resources/org/apache/camel/component/sjms/sjms.json b/components/camel-sjms/src/generated/resources/org/apache/camel/component/sjms/sjms.json index f81be5e..e031e2f 100644 --- a/components/camel-sjms/src/generated/resources/org/apache/camel/component/sjms/sjms.json +++ b/components/camel-sjms/src/generated/resources/org/apache/camel/component/sjms/sjms.json @@ -78,8 +78,8 @@ "errorHandlerLoggingLevel": { "kind": "parameter", "displayName": "Error Handler Logging Level", "group": "logging", "label": "consumer,logging", "required": false, "type": "object", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "secret": false, "defaultValue": "WARN", "description": "Allows to configure the default errorHandler logging level for logging uncaught exceptions." }, "errorHandlerLogStackTrace": { "kind": "parameter", "displayName": "Error Handler Log Stack Trace", "group": "logging", "label": "consumer,logging", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Allows to control whether stacktraces should be logged or not, by the default errorHandler." }, "transacted": { "kind": "parameter", "displayName": "Transacted", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Specifies whether to use transacted mode" }, - "transactionBatchCount": { "kind": "parameter", "displayName": "Transaction Batch Count", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "-1", "description": "If transacted sets the number of messages to process before committing a transaction." }, - "transactionBatchTimeout": { "kind": "parameter", "displayName": "Transaction Batch Timeout", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "secret": false, "defaultValue": "5s", "description": "Sets timeout (in millis) for batch transactions, the value should be 1000 or higher." }, + "transactionBatchCount": { "kind": "parameter", "displayName": "Transaction Batch Count", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "integer", "javaType": "int", "deprecated": true, "secret": false, "defaultValue": "-1", "description": "If transacted sets the number of messages to process before committing a transaction." }, + "transactionBatchTimeout": { "kind": "parameter", "displayName": "Transaction Batch Timeout", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "duration", "javaType": "long", "deprecated": true, "secret": false, "defaultValue": "5s", "description": "Sets timeout (in millis) for batch transactions, the value should be 1000 or higher." }, "transactionCommitStrategy": { "kind": "parameter", "displayName": "Transaction Commit Strategy", "group": "transaction", "label": "transaction", "required": false, "type": "object", "javaType": "org.apache.camel.component.sjms.TransactionCommitStrategy", "deprecated": false, "secret": false, "description": "Sets the commit strategy." }, "sharedJMSSession": { "kind": "parameter", "displayName": "Shared JMSSession", "group": "transaction (advanced)", "label": "transaction,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Specifies whether to share JMS session with other SJMS endpoints. Turn this off if your route is accessing to multiple JMS providers. If you need transaction against multiple JMS providers, use jms comp [...] } diff --git a/components/camel-sjms/src/main/docs/sjms-component.adoc b/components/camel-sjms/src/main/docs/sjms-component.adoc index 301c956..f2a94ab 100644 --- a/components/camel-sjms/src/main/docs/sjms-component.adoc +++ b/components/camel-sjms/src/main/docs/sjms-component.adoc @@ -27,7 +27,7 @@ Additional key features include: * Plugable Connection Resource Management * Session, Consumer, & Producer Pooling & Caching Management * Batch Consumers -* Transacted Batch Consumers +* Transacted Batch Consumers (*deprecated*) * Support for Customizable Transaction Commit Strategies (Local JMS Transactions only) @@ -179,8 +179,8 @@ with the following path and query parameters: | *errorHandlerLoggingLevel* (logging) | Allows to configure the default errorHandler logging level for logging uncaught exceptions. The value can be one of: TRACE, DEBUG, INFO, WARN, ERROR, OFF | WARN | LoggingLevel | *errorHandlerLogStackTrace* (logging) | Allows to control whether stacktraces should be logged or not, by the default errorHandler. | true | boolean | *transacted* (transaction) | Specifies whether to use transacted mode | false | boolean -| *transactionBatchCount* (transaction) | If transacted sets the number of messages to process before committing a transaction. | -1 | int -| *transactionBatchTimeout* (transaction) | Sets timeout (in millis) for batch transactions, the value should be 1000 or higher. | 5s | long +| *transactionBatchCount* (transaction) | *Deprecated* If transacted sets the number of messages to process before committing a transaction. | -1 | int +| *transactionBatchTimeout* (transaction) | *Deprecated* Sets timeout (in millis) for batch transactions, the value should be 1000 or higher. | 5s | long | *transactionCommitStrategy* (transaction) | Sets the commit strategy. | | TransactionCommitStrategy | *sharedJMSSession* (transaction) | Specifies whether to share JMS session with other SJMS endpoints. Turn this off if your route is accessing to multiple JMS providers. If you need transaction against multiple JMS providers, use jms component to leverage XA transaction. | true | boolean |=== @@ -359,6 +359,9 @@ which is detailed further in the next section. === Transacted Batch Consumers +WARNING: This feature is deprecated because under some situations with race conditions then +transactions that are committed via a timeout may not work correctly. + The SJMS component has been designed to support the batching of local JMS transactions on the consumer endpoints. How they are handled on each is very different though. diff --git a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsEndpoint.java b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsEndpoint.java index 9d42c65..c9b3c60 100644 --- a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsEndpoint.java +++ b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsEndpoint.java @@ -126,10 +126,12 @@ public class SjmsEndpoint extends DefaultEndpoint implements AsyncEndpoint, Mult private String messageSelector; @UriParam(label = "consumer,transaction", defaultValue = "-1", description = "If transacted sets the number of messages to process before committing a transaction.") + @Deprecated private int transactionBatchCount = -1; @UriParam(label = "consumer,transaction", defaultValue = "5s", description = "Sets timeout (in millis) for batch transactions, the value should be 1000 or higher.", javaType = "java.time.Duration") + @Deprecated private long transactionBatchTimeout = 5000; @UriParam(label = "advanced", description = "Whether to startup the consumer message listener asynchronously, when starting a route." @@ -512,6 +514,7 @@ public class SjmsEndpoint extends DefaultEndpoint implements AsyncEndpoint, Mult /** * If transacted sets the number of messages to process before committing a transaction. */ + @Deprecated public void setTransactionBatchCount(int transactionBatchCount) { this.transactionBatchCount = transactionBatchCount; } @@ -523,6 +526,7 @@ public class SjmsEndpoint extends DefaultEndpoint implements AsyncEndpoint, Mult /** * Sets timeout (in millis) for batch transactions, the value should be 1000 or higher. */ + @Deprecated public void setTransactionBatchTimeout(long transactionBatchTimeout) { if (transactionBatchTimeout >= 1000) { this.transactionBatchTimeout = transactionBatchTimeout; @@ -695,7 +699,6 @@ public class SjmsEndpoint extends DefaultEndpoint implements AsyncEndpoint, Mult public void setConnectionFactory(String connectionFactory) { this.connectionFactory = EndpointHelper.resolveReferenceParameter(getCamelContext(), connectionFactory, ConnectionFactory.class); - } public ConnectionFactory getConnectionFactory() { diff --git a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/tx/BatchTransactionCommitStrategy.java b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/tx/BatchTransactionCommitStrategy.java index 1ea7fc3..85df55a 100644 --- a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/tx/BatchTransactionCommitStrategy.java +++ b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/tx/BatchTransactionCommitStrategy.java @@ -25,6 +25,7 @@ import org.apache.camel.component.sjms.TransactionCommitStrategy; * Provides a thread safe counter to track the number of {@link Exchange} * objects that have been been processed. */ +@Deprecated public class BatchTransactionCommitStrategy implements TransactionCommitStrategy { private final AtomicInteger current = new AtomicInteger(0); diff --git a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/tx/SessionBatchTransactionSynchronization.java b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/tx/SessionBatchTransactionSynchronization.java index da8d9b3..dea546d 100644 --- a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/tx/SessionBatchTransactionSynchronization.java +++ b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/tx/SessionBatchTransactionSynchronization.java @@ -33,6 +33,7 @@ import org.slf4j.LoggerFactory; * SessionTransactionSynchronization is called at the completion of each * {@link org.apache.camel.Exchange}. */ +@Deprecated public class SessionBatchTransactionSynchronization implements Synchronization { private static final Logger LOG = LoggerFactory.getLogger(SessionBatchTransactionSynchronization.class); private Session session; diff --git a/components/camel-sjms2/src/generated/resources/org/apache/camel/component/sjms2/sjms2.json b/components/camel-sjms2/src/generated/resources/org/apache/camel/component/sjms2/sjms2.json index 4d48514..e9e757a 100644 --- a/components/camel-sjms2/src/generated/resources/org/apache/camel/component/sjms2/sjms2.json +++ b/components/camel-sjms2/src/generated/resources/org/apache/camel/component/sjms2/sjms2.json @@ -81,8 +81,8 @@ "errorHandlerLoggingLevel": { "kind": "parameter", "displayName": "Error Handler Logging Level", "group": "logging", "label": "consumer,logging", "required": false, "type": "object", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "secret": false, "defaultValue": "WARN", "description": "Allows to configure the default errorHandler logging level for logging uncaught exceptions." }, "errorHandlerLogStackTrace": { "kind": "parameter", "displayName": "Error Handler Log Stack Trace", "group": "logging", "label": "consumer,logging", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Allows to control whether stacktraces should be logged or not, by the default errorHandler." }, "transacted": { "kind": "parameter", "displayName": "Transacted", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Specifies whether to use transacted mode" }, - "transactionBatchCount": { "kind": "parameter", "displayName": "Transaction Batch Count", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "-1", "description": "If transacted sets the number of messages to process before committing a transaction." }, - "transactionBatchTimeout": { "kind": "parameter", "displayName": "Transaction Batch Timeout", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "secret": false, "defaultValue": "5s", "description": "Sets timeout (in millis) for batch transactions, the value should be 1000 or higher." }, + "transactionBatchCount": { "kind": "parameter", "displayName": "Transaction Batch Count", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "integer", "javaType": "int", "deprecated": true, "secret": false, "defaultValue": "-1", "description": "If transacted sets the number of messages to process before committing a transaction." }, + "transactionBatchTimeout": { "kind": "parameter", "displayName": "Transaction Batch Timeout", "group": "transaction", "label": "consumer,transaction", "required": false, "type": "duration", "javaType": "long", "deprecated": true, "secret": false, "defaultValue": "5s", "description": "Sets timeout (in millis) for batch transactions, the value should be 1000 or higher." }, "transactionCommitStrategy": { "kind": "parameter", "displayName": "Transaction Commit Strategy", "group": "transaction", "label": "transaction", "required": false, "type": "object", "javaType": "org.apache.camel.component.sjms.TransactionCommitStrategy", "deprecated": false, "secret": false, "description": "Sets the commit strategy." }, "sharedJMSSession": { "kind": "parameter", "displayName": "Shared JMSSession", "group": "transaction (advanced)", "label": "transaction,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Specifies whether to share JMS session with other SJMS endpoints. Turn this off if your route is accessing to multiple JMS providers. If you need transaction against multiple JMS providers, use jms comp [...] } diff --git a/components/camel-sjms2/src/main/docs/sjms2-component.adoc b/components/camel-sjms2/src/main/docs/sjms2-component.adoc index 839ff59..3b85a73 100644 --- a/components/camel-sjms2/src/main/docs/sjms2-component.adoc +++ b/components/camel-sjms2/src/main/docs/sjms2-component.adoc @@ -191,8 +191,8 @@ with the following path and query parameters: | *errorHandlerLoggingLevel* (logging) | Allows to configure the default errorHandler logging level for logging uncaught exceptions. The value can be one of: TRACE, DEBUG, INFO, WARN, ERROR, OFF | WARN | LoggingLevel | *errorHandlerLogStackTrace* (logging) | Allows to control whether stacktraces should be logged or not, by the default errorHandler. | true | boolean | *transacted* (transaction) | Specifies whether to use transacted mode | false | boolean -| *transactionBatchCount* (transaction) | If transacted sets the number of messages to process before committing a transaction. | -1 | int -| *transactionBatchTimeout* (transaction) | Sets timeout (in millis) for batch transactions, the value should be 1000 or higher. | 5s | long +| *transactionBatchCount* (transaction) | *Deprecated* If transacted sets the number of messages to process before committing a transaction. | -1 | int +| *transactionBatchTimeout* (transaction) | *Deprecated* Sets timeout (in millis) for batch transactions, the value should be 1000 or higher. | 5s | long | *transactionCommitStrategy* (transaction) | Sets the commit strategy. | | TransactionCommitStrategy | *sharedJMSSession* (transaction) | Specifies whether to share JMS session with other SJMS endpoints. Turn this off if your route is accessing to multiple JMS providers. If you need transaction against multiple JMS providers, use jms component to leverage XA transaction. | true | boolean |=== diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sjms2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sjms2EndpointBuilderFactory.java index ca5dabf..02879c9 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sjms2EndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sjms2EndpointBuilderFactory.java @@ -376,6 +376,7 @@ public interface Sjms2EndpointBuilderFactory { * Default: -1 * Group: transaction */ + @Deprecated default Sjms2EndpointConsumerBuilder transactionBatchCount( int transactionBatchCount) { doSetProperty("transactionBatchCount", transactionBatchCount); @@ -390,6 +391,7 @@ public interface Sjms2EndpointBuilderFactory { * Default: -1 * Group: transaction */ + @Deprecated default Sjms2EndpointConsumerBuilder transactionBatchCount( String transactionBatchCount) { doSetProperty("transactionBatchCount", transactionBatchCount); @@ -404,6 +406,7 @@ public interface Sjms2EndpointBuilderFactory { * Default: 5s * Group: transaction */ + @Deprecated default Sjms2EndpointConsumerBuilder transactionBatchTimeout( long transactionBatchTimeout) { doSetProperty("transactionBatchTimeout", transactionBatchTimeout); @@ -418,6 +421,7 @@ public interface Sjms2EndpointBuilderFactory { * Default: 5s * Group: transaction */ + @Deprecated default Sjms2EndpointConsumerBuilder transactionBatchTimeout( String transactionBatchTimeout) { doSetProperty("transactionBatchTimeout", transactionBatchTimeout); diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SjmsEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SjmsEndpointBuilderFactory.java index e9c62a0..64a3cb9 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SjmsEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SjmsEndpointBuilderFactory.java @@ -316,6 +316,7 @@ public interface SjmsEndpointBuilderFactory { * Default: -1 * Group: transaction */ + @Deprecated default SjmsEndpointConsumerBuilder transactionBatchCount( int transactionBatchCount) { doSetProperty("transactionBatchCount", transactionBatchCount); @@ -330,6 +331,7 @@ public interface SjmsEndpointBuilderFactory { * Default: -1 * Group: transaction */ + @Deprecated default SjmsEndpointConsumerBuilder transactionBatchCount( String transactionBatchCount) { doSetProperty("transactionBatchCount", transactionBatchCount); @@ -344,6 +346,7 @@ public interface SjmsEndpointBuilderFactory { * Default: 5s * Group: transaction */ + @Deprecated default SjmsEndpointConsumerBuilder transactionBatchTimeout( long transactionBatchTimeout) { doSetProperty("transactionBatchTimeout", transactionBatchTimeout); @@ -358,6 +361,7 @@ public interface SjmsEndpointBuilderFactory { * Default: 5s * Group: transaction */ + @Deprecated default SjmsEndpointConsumerBuilder transactionBatchTimeout( String transactionBatchTimeout) { doSetProperty("transactionBatchTimeout", transactionBatchTimeout); diff --git a/docs/components/modules/ROOT/pages/sjms-component.adoc b/docs/components/modules/ROOT/pages/sjms-component.adoc index ad48f08..a6adbae 100644 --- a/docs/components/modules/ROOT/pages/sjms-component.adoc +++ b/docs/components/modules/ROOT/pages/sjms-component.adoc @@ -29,7 +29,7 @@ Additional key features include: * Plugable Connection Resource Management * Session, Consumer, & Producer Pooling & Caching Management * Batch Consumers -* Transacted Batch Consumers +* Transacted Batch Consumers (*deprecated*) * Support for Customizable Transaction Commit Strategies (Local JMS Transactions only) @@ -181,8 +181,8 @@ with the following path and query parameters: | *errorHandlerLoggingLevel* (logging) | Allows to configure the default errorHandler logging level for logging uncaught exceptions. The value can be one of: TRACE, DEBUG, INFO, WARN, ERROR, OFF | WARN | LoggingLevel | *errorHandlerLogStackTrace* (logging) | Allows to control whether stacktraces should be logged or not, by the default errorHandler. | true | boolean | *transacted* (transaction) | Specifies whether to use transacted mode | false | boolean -| *transactionBatchCount* (transaction) | If transacted sets the number of messages to process before committing a transaction. | -1 | int -| *transactionBatchTimeout* (transaction) | Sets timeout (in millis) for batch transactions, the value should be 1000 or higher. | 5s | long +| *transactionBatchCount* (transaction) | *Deprecated* If transacted sets the number of messages to process before committing a transaction. | -1 | int +| *transactionBatchTimeout* (transaction) | *Deprecated* Sets timeout (in millis) for batch transactions, the value should be 1000 or higher. | 5s | long | *transactionCommitStrategy* (transaction) | Sets the commit strategy. | | TransactionCommitStrategy | *sharedJMSSession* (transaction) | Specifies whether to share JMS session with other SJMS endpoints. Turn this off if your route is accessing to multiple JMS providers. If you need transaction against multiple JMS providers, use jms component to leverage XA transaction. | true | boolean |=== @@ -361,6 +361,9 @@ which is detailed further in the next section. === Transacted Batch Consumers +WARNING: This feature is deprecated because under some situations with race conditions then +transactions that are committed via a timeout may not work correctly. + The SJMS component has been designed to support the batching of local JMS transactions on the consumer endpoints. How they are handled on each is very different though. diff --git a/docs/components/modules/ROOT/pages/sjms2-component.adoc b/docs/components/modules/ROOT/pages/sjms2-component.adoc index 2a2c401..30d4636 100644 --- a/docs/components/modules/ROOT/pages/sjms2-component.adoc +++ b/docs/components/modules/ROOT/pages/sjms2-component.adoc @@ -193,8 +193,8 @@ with the following path and query parameters: | *errorHandlerLoggingLevel* (logging) | Allows to configure the default errorHandler logging level for logging uncaught exceptions. The value can be one of: TRACE, DEBUG, INFO, WARN, ERROR, OFF | WARN | LoggingLevel | *errorHandlerLogStackTrace* (logging) | Allows to control whether stacktraces should be logged or not, by the default errorHandler. | true | boolean | *transacted* (transaction) | Specifies whether to use transacted mode | false | boolean -| *transactionBatchCount* (transaction) | If transacted sets the number of messages to process before committing a transaction. | -1 | int -| *transactionBatchTimeout* (transaction) | Sets timeout (in millis) for batch transactions, the value should be 1000 or higher. | 5s | long +| *transactionBatchCount* (transaction) | *Deprecated* If transacted sets the number of messages to process before committing a transaction. | -1 | int +| *transactionBatchTimeout* (transaction) | *Deprecated* Sets timeout (in millis) for batch transactions, the value should be 1000 or higher. | 5s | long | *transactionCommitStrategy* (transaction) | Sets the commit strategy. | | TransactionCommitStrategy | *sharedJMSSession* (transaction) | Specifies whether to share JMS session with other SJMS endpoints. Turn this off if your route is accessing to multiple JMS providers. If you need transaction against multiple JMS providers, use jms component to leverage XA transaction. | true | boolean |===