當前位置: 首頁>>代碼示例>>Java>>正文


Java OffsetMovedEvent類代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:medusar,項目名稱:rocketmq-commet,代碼行數:27,代碼來源:PullMessageProcessor.java

示例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);
    }
}
 
開發者ID:y123456yz,項目名稱:reading-and-annotate-rocketmq-3.4.6,代碼行數:28,代碼來源:PullMessageProcessor.java

示例3: getOffsetMovedEvent

import com.alibaba.rocketmq.common.protocol.topic.OffsetMovedEvent; //導入依賴的package包/類
public OffsetMovedEvent getOffsetMovedEvent() {
    return offsetMovedEvent;
}
 
開發者ID:y123456yz,項目名稱:reading-and-annotate-rocketmq-3.4.6,代碼行數:4,代碼來源:DeleteMsgsEvent.java

示例4: setOffsetMovedEvent

import com.alibaba.rocketmq.common.protocol.topic.OffsetMovedEvent; //導入依賴的package包/類
public void setOffsetMovedEvent(OffsetMovedEvent offsetMovedEvent) {
    this.offsetMovedEvent = offsetMovedEvent;
}
 
開發者ID:y123456yz,項目名稱:reading-and-annotate-rocketmq-3.4.6,代碼行數:4,代碼來源:DeleteMsgsEvent.java


注:本文中的com.alibaba.rocketmq.common.protocol.topic.OffsetMovedEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。