提交 e57f9ac4 编写于 作者: D dongeforever

Merge remote-tracking branch 'wip/ROCKETMQ-206' into develop

...@@ -180,7 +180,12 @@ public class LocalFileOffsetStore implements OffsetStore { ...@@ -180,7 +180,12 @@ public class LocalFileOffsetStore implements OffsetStore {
} }
private OffsetSerializeWrapper readLocalOffset() throws MQClientException { private OffsetSerializeWrapper readLocalOffset() throws MQClientException {
String content = MixAll.file2String(this.storePath); String content = null;
try {
content = MixAll.file2String(this.storePath);
} catch (IOException e) {
log.warn("Load local offset store file exception", e);
}
if (null == content || content.length() == 0) { if (null == content || content.length() == 0) {
return this.readLocalOffsetBak(); return this.readLocalOffsetBak();
} else { } else {
...@@ -198,7 +203,12 @@ public class LocalFileOffsetStore implements OffsetStore { ...@@ -198,7 +203,12 @@ public class LocalFileOffsetStore implements OffsetStore {
} }
private OffsetSerializeWrapper readLocalOffsetBak() throws MQClientException { private OffsetSerializeWrapper readLocalOffsetBak() throws MQClientException {
String content = MixAll.file2String(this.storePath + ".bak"); String content = null;
try {
content = MixAll.file2String(this.storePath + ".bak");
} catch (IOException e) {
log.warn("Load local offset store bak file exception", e);
}
if (content != null && content.length() > 0) { if (content != null && content.length() > 0) {
OffsetSerializeWrapper offsetSerializeWrapper = null; OffsetSerializeWrapper offsetSerializeWrapper = null;
try { try {
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package org.apache.rocketmq.example.benchmark; package org.apache.rocketmq.example.benchmark;
import java.io.IOException;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Timer; import java.util.Timer;
...@@ -39,7 +40,7 @@ import org.apache.rocketmq.srvutil.ServerUtil; ...@@ -39,7 +40,7 @@ import org.apache.rocketmq.srvutil.ServerUtil;
public class Consumer { public class Consumer {
public static void main(String[] args) throws MQClientException { public static void main(String[] args) throws MQClientException, IOException {
Options options = ServerUtil.buildCommandlineOptions(new Options()); Options options = ServerUtil.buildCommandlineOptions(new Options());
CommandLine commandLine = ServerUtil.parseCmdLine("benchmarkConsumer", args, buildCommandlineOptions(options), new PosixParser()); CommandLine commandLine = ServerUtil.parseCmdLine("benchmarkConsumer", args, buildCommandlineOptions(options), new PosixParser());
if (null == commandLine) { if (null == commandLine) {
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package org.apache.rocketmq.example.filter; package org.apache.rocketmq.example.filter;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.util.List; import java.util.List;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
...@@ -28,7 +29,7 @@ import org.apache.rocketmq.common.message.MessageExt; ...@@ -28,7 +29,7 @@ import org.apache.rocketmq.common.message.MessageExt;
public class Consumer { public class Consumer {
public static void main(String[] args) throws InterruptedException, MQClientException { public static void main(String[] args) throws InterruptedException, MQClientException, IOException {
DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("ConsumerGroupNamecc4"); DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("ConsumerGroupNamecc4");
ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
......
...@@ -43,7 +43,12 @@ public class KVConfigManager { ...@@ -43,7 +43,12 @@ public class KVConfigManager {
} }
public void load() { public void load() {
String content = MixAll.file2String(this.namesrvController.getNamesrvConfig().getKvConfigPath()); String content = null;
try {
content = MixAll.file2String(this.namesrvController.getNamesrvConfig().getKvConfigPath());
} catch (IOException e) {
log.warn("Load KV config table exception", e);
}
if (content != null) { if (content != null) {
KVConfigSerializeWrapper kvConfigSerializeWrapper = KVConfigSerializeWrapper kvConfigSerializeWrapper =
KVConfigSerializeWrapper.fromJson(content, KVConfigSerializeWrapper.class); KVConfigSerializeWrapper.fromJson(content, KVConfigSerializeWrapper.class);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册