vongosling commented on a change in pull request #2167:
URL: https://github.com/apache/rocketmq/pull/2167#discussion_r504335361
##########
File path:
client/src/test/java/org/apache/rocketmq/client/impl/factory/MQClientInstanceTest.java
##########
@@ -42,6 +47,14 @@
private MQClientInstance mqClientInstance =
MQClientManager.getInstance().getOrCreateMQClientInstance(new ClientConfig());
private String topic = "FooBar";
private String group = "FooBarGroup";
+ private ConcurrentMap<String, HashMap<Long, String>> brokerAddrTable = new
ConcurrentHashMap<String, HashMap<Long, String>>();
+
+ @Before
+ public void init() throws Exception {
+ Field field =
MQClientInstance.class.getDeclaredField("brokerAddrTable");
Review comment:
mockito and jmockit has native support for the reflection
##########
File path:
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java
##########
@@ -1043,6 +1043,11 @@ public FindBrokerResult findBrokerAddressInSubscribe(
slave = brokerId != MixAll.MASTER_ID;
found = brokerAddr != null;
+ if (!found && slave) {
+ brokerAddr = map.get(brokerId + 1);
Review comment:
How do we handle if the slave has happened to become a master?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]