本文整理匯總了Java中com.alibaba.rocketmq.common.protocol.topic.OffsetMovedEvent類的典型用法代碼示例。如果您正苦於以下問題:Java OffsetMovedEvent類的具體用法?Java OffsetMovedEvent怎麽用?Java OffsetMovedEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OffsetMovedEvent類屬於com.alibaba.rocketmq.common.protocol.topic包,在下文中一共展示了OffsetMovedEvent類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generateOffsetMovedEvent
import com.alibaba.rocketmq.common.protocol.topic.OffsetMovedEvent; //導入依賴的package包/類
private void generateOffsetMovedEvent(final OffsetMovedEvent event) {
try {
MessageExtBrokerInner msgInner = new MessageExtBrokerInner();
msgInner.setTopic(MixAll.OFFSET_MOVED_EVENT);
msgInner.setTags(event.getConsumerGroup());
msgInner.setDelayTimeLevel(0);
msgInner.setKeys(event.getConsumerGroup());
msgInner.setBody(event.encode());
msgInner.setFlag(0);
msgInner.setPropertiesString(MessageDecoder.messageProperties2String(msgInner.getProperties()));
msgInner.setTagsCode(MessageExtBrokerInner.tagsString2tagsCode(TopicFilterType.SINGLE_TAG,
msgInner.getTags()));
msgInner.setQueueId(0);
msgInner.setSysFlag(0);
msgInner.setBornTimestamp(System.currentTimeMillis());
msgInner.setBornHost(RemotingUtil.string2SocketAddress(this.brokerController.getBrokerAddr()));
msgInner.setStoreHost(msgInner.getBornHost());
msgInner.setReconsumeTimes(0);
PutMessageResult putMessageResult = this.brokerController.getMessageStore().putMessage(msgInner);
} catch (Exception e) {
log.warn(String.format("generateOffsetMovedEvent Exception, %s", event.toString()), e);
}
}
示例2: generateOffsetMovedEvent
import com.alibaba.rocketmq.common.protocol.topic.OffsetMovedEvent; //導入依賴的package包/類
private void generateOffsetMovedEvent(final OffsetMovedEvent event) {
try {
MessageExtBrokerInner msgInner = new MessageExtBrokerInner();
msgInner.setTopic(MixAll.OFFSET_MOVED_EVENT);
msgInner.setTags(event.getConsumerGroup());
msgInner.setDelayTimeLevel(0);
msgInner.setKeys(event.getConsumerGroup());
msgInner.setBody(event.encode());
msgInner.setFlag(0);
msgInner.setPropertiesString(MessageDecoder.messageProperties2String(msgInner.getProperties()));
msgInner.setTagsCode(MessageExtBrokerInner.tagsString2tagsCode(TopicFilterType.SINGLE_TAG,
msgInner.getTags()));
msgInner.setQueueId(0);
msgInner.setSysFlag(0);
msgInner.setBornTimestamp(System.currentTimeMillis());
msgInner.setBornHost(RemotingUtil.string2SocketAddress(this.brokerController.getBrokerAddr()));
msgInner.setStoreHost(msgInner.getBornHost());
msgInner.setReconsumeTimes(0);
PutMessageResult putMessageResult = this.brokerController.getMessageStore().putMessage(msgInner);
}
catch (Exception e) {
log.warn(String.format("generateOffsetMovedEvent Exception, %s", event.toString()), e);
}
}
示例3: getOffsetMovedEvent
import com.alibaba.rocketmq.common.protocol.topic.OffsetMovedEvent; //導入依賴的package包/類
public OffsetMovedEvent getOffsetMovedEvent() {
return offsetMovedEvent;
}
示例4: setOffsetMovedEvent
import com.alibaba.rocketmq.common.protocol.topic.OffsetMovedEvent; //導入依賴的package包/類
public void setOffsetMovedEvent(OffsetMovedEvent offsetMovedEvent) {
this.offsetMovedEvent = offsetMovedEvent;
}