Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.19.0
-
None
-
Unknown
Description
It seems there is a problem that the route policy seems to grant locks to both or keep changing between them, so we have competing consumers being active at the same time.
The issue can be reproduced by following the readme file from
https://github.com/camelinaction/camelinaction2/tree/master/chapter17/cluster-file-infinispan
You can see errors like
Caused by: org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /Users/davsclaus/workspace/camelinaction2/chapter17/cluster-file-infinispan/target/inbox/WebSpherePackageScanClassResolver.java (No such file or directory)
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1756)
at org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1355)
at org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:60)
at org.apache.camel.component.file.GenericFileConverter.convertTo(GenericFileConverter.java:97)
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1351)
at org.apache.camel.impl.converter.StaticMethodFallbackTypeConverter.convertTo(StaticMethodFallbackTypeConverter.java:62)
at org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:346)
at org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:181)
... 41 more
Caused by: java.io.FileNotFoundException: /Users/davsclaus/workspace/camelinaction2/chapter17/cluster-file-infinispan/target/inbox/WebSpherePackageScanClassResolver.java (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at org.apache.camel.converter.IOConverter.toInputStream(IOConverter.java:78)
at org.apache.camel.converter.IOConverter.toByteArray(IOConverter.java:266)
at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1351)
... 50 more
2017-06-09 08:04:41,396 [://target/inbox] WARN GenericFileOnCompletion - Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@160cecbb for file: GenericFile[WebSpherePackageScanClassResolver.java]
2017-06-09 08:04:42,126 [spanRoutePolicy] INFO InfinispanRoutePolicy - Leadership lost (map=myLock, key=myLockKey val=myLockValue)
2017-06-09 08:04:42,127 [spanRoutePolicy] INFO InfinispanRoutePolicy - Leadership taken (map=myLock, key=myLockKey, val=myLockValue)
2017-06-09 08:05:07,710 [29c8fac7da04e40] INFO InfinispanRoutePolicy - Leadership lost (map=myLock, key=myLockKey val=myLockValue)
2017-06-09 08:05:07,715 [29c8fac7da04e40] INFO InfinispanRoutePolicy - Leadership taken (map=myLock, key=myLockKey, val=myLockValue)
Where as the hazelcast example which is similar works fine.