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 d70b4fb Pass exchange as parameter to idempotentRepository methods (#3885) d70b4fb is described below commit d70b4fb1ef7ffa93f0d56dc2bd30b7b3a10ebec5 Author: perttuk <pert...@users.noreply.github.com> AuthorDate: Thu Jun 4 07:29:28 2020 +0300 Pass exchange as parameter to idempotentRepository methods (#3885) --- .../FileIdempotentChangedRepositoryReadLockStrategy.java | 12 ++++++------ .../FileIdempotentRenameRepositoryReadLockStrategy.java | 12 ++++++------ .../strategy/FileIdempotentRepositoryReadLockStrategy.java | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileIdempotentChangedRepositoryReadLockStrategy.java b/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileIdempotentChangedRepositoryReadLockStrategy.java index 9d88649..6e31b8c 100644 --- a/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileIdempotentChangedRepositoryReadLockStrategy.java +++ b/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileIdempotentChangedRepositoryReadLockStrategy.java @@ -86,7 +86,7 @@ public class FileIdempotentChangedRepositoryReadLockStrategy extends ServiceSupp // check if we can begin on this file String key = asKey(file); - boolean answer = idempotentRepository.add(key); + boolean answer = idempotentRepository.add(exchange, key); if (!answer) { // another node is processing the file so skip CamelLogger.log(LOG, readLockLoggingLevel, "Cannot acquire read lock. Will skip the file: " + file); @@ -97,7 +97,7 @@ public class FileIdempotentChangedRepositoryReadLockStrategy extends ServiceSupp answer = changed.acquireExclusiveReadLock(operations, file, exchange); if (!answer) { // remove from idempontent as we did not acquire it from changed - idempotentRepository.remove(key); + idempotentRepository.remove(exchange, key); } } return answer; @@ -113,10 +113,10 @@ public class FileIdempotentChangedRepositoryReadLockStrategy extends ServiceSupp String key = asKey(file); Runnable r = () -> { if (removeOnRollback) { - idempotentRepository.remove(key); + idempotentRepository.remove(exchange, key); } else { // okay we should not remove then confirm it instead - idempotentRepository.confirm(key); + idempotentRepository.confirm(exchange, key); } try { @@ -143,10 +143,10 @@ public class FileIdempotentChangedRepositoryReadLockStrategy extends ServiceSupp String key = asKey(file); Runnable r = () -> { if (removeOnCommit) { - idempotentRepository.remove(key); + idempotentRepository.remove(exchange, key); } else { // confirm on commit - idempotentRepository.confirm(key); + idempotentRepository.confirm(exchange, key); } try { diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileIdempotentRenameRepositoryReadLockStrategy.java b/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileIdempotentRenameRepositoryReadLockStrategy.java index 5da33e0..45830dc 100644 --- a/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileIdempotentRenameRepositoryReadLockStrategy.java +++ b/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileIdempotentRenameRepositoryReadLockStrategy.java @@ -78,7 +78,7 @@ public class FileIdempotentRenameRepositoryReadLockStrategy extends ServiceSuppo // check if we can begin on this file String key = asKey(file); - boolean answer = idempotentRepository.add(key); + boolean answer = idempotentRepository.add(exchange, key); if (!answer) { // another node is processing the file so skip CamelLogger.log(LOG, readLockLoggingLevel, "Cannot acquire read lock. Will skip the file: " + file); @@ -89,7 +89,7 @@ public class FileIdempotentRenameRepositoryReadLockStrategy extends ServiceSuppo answer = rename.acquireExclusiveReadLock(operations, file, exchange); if (!answer) { // remove from idempontent as we did not acquire it from changed - idempotentRepository.remove(key); + idempotentRepository.remove(exchange, key); } } return answer; @@ -104,10 +104,10 @@ public class FileIdempotentRenameRepositoryReadLockStrategy extends ServiceSuppo public void releaseExclusiveReadLockOnRollback(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception { String key = asKey(file); if (removeOnRollback) { - idempotentRepository.remove(key); + idempotentRepository.remove(exchange, key); } else { // okay we should not remove then confirm it instead - idempotentRepository.confirm(key); + idempotentRepository.confirm(exchange, key); } rename.releaseExclusiveReadLockOnRollback(operations, file, exchange); @@ -117,10 +117,10 @@ public class FileIdempotentRenameRepositoryReadLockStrategy extends ServiceSuppo public void releaseExclusiveReadLockOnCommit(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception { String key = asKey(file); if (removeOnCommit) { - idempotentRepository.remove(key); + idempotentRepository.remove(exchange, key); } else { // confirm on commit - idempotentRepository.confirm(key); + idempotentRepository.confirm(exchange, key); } rename.releaseExclusiveReadLockOnCommit(operations, file, exchange); diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileIdempotentRepositoryReadLockStrategy.java b/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileIdempotentRepositoryReadLockStrategy.java index 540a459..7257cd5 100644 --- a/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileIdempotentRepositoryReadLockStrategy.java +++ b/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/FileIdempotentRepositoryReadLockStrategy.java @@ -75,7 +75,7 @@ public class FileIdempotentRepositoryReadLockStrategy extends ServiceSupport imp // check if we can begin on this file String key = asKey(file); - boolean answer = idempotentRepository.add(key); + boolean answer = idempotentRepository.add(exchange, key); if (!answer) { // another node is processing the file so skip CamelLogger.log(LOG, readLockLoggingLevel, "Cannot acquire read lock. Will skip the file: " + file); @@ -93,10 +93,10 @@ public class FileIdempotentRepositoryReadLockStrategy extends ServiceSupport imp String key = asKey(file); Runnable r = () -> { if (removeOnRollback) { - idempotentRepository.remove(key); + idempotentRepository.remove(exchange, key); } else { // okay we should not remove then confirm it instead - idempotentRepository.confirm(key); + idempotentRepository.confirm(exchange, key); } }; @@ -117,10 +117,10 @@ public class FileIdempotentRepositoryReadLockStrategy extends ServiceSupport imp String key = asKey(file); Runnable r = () -> { if (removeOnCommit) { - idempotentRepository.remove(key); + idempotentRepository.remove(exchange, key); } else { // confirm on commit - idempotentRepository.confirm(key); + idempotentRepository.confirm(exchange, key); } };