com.alibaba.rocketmq.store.PutMessageResult Java Examples
The following examples show how to use
com.alibaba.rocketmq.store.PutMessageResult.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PullMessageProcessor.java From rocketmq with Apache License 2.0 | 6 votes |
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); } }
Example #2
Source File: PullMessageProcessor.java From reading-and-annotate-rocketmq-3.4.6 with GNU General Public License v3.0 | 5 votes |
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); } }
Example #3
Source File: PullMessageProcessor.java From RocketMQ-Master-analyze with Apache License 2.0 | 5 votes |
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); } }