You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by Jaskey <gi...@git.apache.org> on 2017/06/02 14:37:03 UTC
[GitHub] incubator-rocketmq pull request #110: [ROCKETMQ-208]incompatibility problem ...
GitHub user Jaskey opened a pull request:
https://github.com/apache/incubator-rocketmq/pull/110
[ROCKETMQ-208]incompatibility problem found in enviroment of JDK 1.7 when running client
JIRA : https://issues.apache.org/jira/browse/ROCKETMQ-208?jql=project%20%3D%20ROCKETMQ
This problem will be found when
- Our release version is compile in java 8 compiler
- Developer download the source file and they compile with java 8 compiler but the user uses rocketmq-client in java 7.
How to test the problem :
1. compile rocketmq in ** jdk 8 compiler **
2. Run below test code in a machine which installed **java7** .
public class Test {
public static void main(String[] args) {
DefaultMQPushConsumer pushConsumer = new DefaultMQPushConsumer( "FooBarGroup" + System.currentTimeMillis());
DefaultMQPushConsumerImpl pushConsumerImpl = pushConsumer.getDefaultMQPushConsumerImpl();
new RebalancePushImpl(pushConsumer.getDefaultMQPushConsumerImpl()).unlockAll(false);
}
}
We will find that a NoSuchError will be thrown :
Exception in thread "main" java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
at org.apache.rocketmq.client.impl.consumer.RebalanceImpl.buildProcessQueueTableByBrokerName(RebalanceImpl.java:121)
at org.apache.rocketmq.client.impl.consumer.RebalanceImpl.unlockAll(RebalanceImpl.java:86)
at Test.main(Test.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
After apply this patch then retry, problem is solved.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Jaskey/incubator-rocketmq ROCKETMQ-208-concurenthashmap-ncompatibility-problem
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-rocketmq/pull/110.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #110
----
commit 77dc4d63ad698663675098b4b4a46fa9c8e59734
Author: Jaskey <li...@gmail.com>
Date: 2017-06-02T13:49:22Z
Refactor to use ConcurentMap instead of ConcurentHashMap when declaring field in order to avoid incompatibility problem when running client in lower jre while compiling in java8 compiler
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rocketmq issue #110: [ROCKETMQ-208]incompatibility problem found i...
Posted by zhouxinyu <gi...@git.apache.org>.
Github user zhouxinyu commented on the issue:
https://github.com/apache/incubator-rocketmq/pull/110
+1, cool~
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rocketmq issue #110: [ROCKETMQ-208]incompatibility problem found i...
Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:
https://github.com/apache/incubator-rocketmq/pull/110
[](https://coveralls.io/builds/11802730)
Coverage increased (+0.04%) to 31.014% when pulling **77dc4d63ad698663675098b4b4a46fa9c8e59734 on Jaskey:ROCKETMQ-208-concurenthashmap-ncompatibility-problem** into **fa85abcdf6ee46e56403ddf86828a38683103fd0 on apache:master**.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rocketmq issue #110: [ROCKETMQ-208]incompatibility problem found i...
Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:
https://github.com/apache/incubator-rocketmq/pull/110
[](https://coveralls.io/builds/11844151)
Coverage decreased (-0.02%) to 38.587% when pulling **57227585735920c83c916df00a0d1f8cba0623a6 on Jaskey:ROCKETMQ-208-concurenthashmap-ncompatibility-problem** into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rocketmq issue #110: [ROCKETMQ-208]incompatibility problem found i...
Posted by Jaskey <gi...@git.apache.org>.
Github user Jaskey commented on the issue:
https://github.com/apache/incubator-rocketmq/pull/110
@lizhanhui
I suffer from this for serveal times, always is blocked by the defaultPushConsumerTest causing by no output for long time
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rocketmq issue #110: [ROCKETMQ-208]incompatibility problem found i...
Posted by lizhanhui <gi...@git.apache.org>.
Github user lizhanhui commented on the issue:
https://github.com/apache/incubator-rocketmq/pull/110
Good Job
+1
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rocketmq issue #110: [ROCKETMQ-208]incompatibility problem found i...
Posted by lizhanhui <gi...@git.apache.org>.
Github user lizhanhui commented on the issue:
https://github.com/apache/incubator-rocketmq/pull/110
@Jaskey Please close this PR at your earliest convenient time.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rocketmq issue #110: [ROCKETMQ-208]incompatibility problem found i...
Posted by dongeforever <gi...@git.apache.org>.
Github user dongeforever commented on the issue:
https://github.com/apache/incubator-rocketmq/pull/110
+1
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rocketmq pull request #110: [ROCKETMQ-208]incompatibility problem ...
Posted by Jaskey <gi...@git.apache.org>.
Github user Jaskey closed the pull request at:
https://github.com/apache/incubator-rocketmq/pull/110
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rocketmq issue #110: [ROCKETMQ-208]incompatibility problem found i...
Posted by Jaskey <gi...@git.apache.org>.
Github user Jaskey commented on the issue:
https://github.com/apache/incubator-rocketmq/pull/110
@lizhanhui @dongeforever @zhouxinyu
conflicts resolved, and to avoid the same problem in the future, I have replace `ConcurrentHashMap` to `ConcurrentMap` when declaring as much as possible as long as we do not dependent on the method implementation the class.
Please review.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rocketmq issue #110: [ROCKETMQ-208]incompatibility problem found i...
Posted by dongeforever <gi...@git.apache.org>.
Github user dongeforever commented on the issue:
https://github.com/apache/incubator-rocketmq/pull/110
@Jaskey This PR has been merged and will be released in 4.1.0. Thanks a lot for your work.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rocketmq issue #110: [ROCKETMQ-208]incompatibility problem found i...
Posted by lizhanhui <gi...@git.apache.org>.
Github user lizhanhui commented on the issue:
https://github.com/apache/incubator-rocketmq/pull/110
Looks CI is buggy.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---