Skip to content

Commit

Permalink
广播消息重置消费进度时,需要设置instacneName
Browse files Browse the repository at this point in the history
  • Loading branch information
vintagewang committed Dec 2, 2013
1 parent bfad470 commit ef8a592
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ public class MQHelper {
*/
public static void resetOffsetByTimestamp(//
final MessageModel messageModel,//
final String instanceName,//
final String consumerGroup, //
final String topic, //
final long timestamp) throws Exception {
final Logger log = ClientLogger.getLog();

DefaultMQPullConsumer consumer = new DefaultMQPullConsumer(consumerGroup);
consumer.setInstanceName(instanceName);
consumer.setMessageModel(messageModel);
consumer.start();

Expand Down Expand Up @@ -81,4 +83,13 @@ public static void resetOffsetByTimestamp(//
consumer.shutdown();
}
}


public static void resetOffsetByTimestamp(//
final MessageModel messageModel,//
final String consumerGroup, //
final String topic, //
final long timestamp) throws Exception {
resetOffsetByTimestamp(messageModel, "DEFAULT", consumerGroup, topic, timestamp);
}
}

0 comments on commit ef8a592

Please sign in to comment.