Java Code Examples for org.apache.rocketmq.common.MixAll#object2Properties()

The following examples show how to use org.apache.rocketmq.common.MixAll#object2Properties() . 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: DefaultMQPushConsumerImpl.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPushConsumer);

    prop.put(ConsumerRunningInfo.PROP_CONSUME_ORDERLY, String.valueOf(this.consumeOrderly));
    prop.put(ConsumerRunningInfo.PROP_THREADPOOL_CORE_SIZE, String.valueOf(this.consumeMessageService.getCorePoolSize()));
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));

    info.setProperties(prop);

    Set<SubscriptionData> subSet = this.subscriptions();
    info.getSubscriptionSet().addAll(subSet);

    Iterator<Entry<MessageQueue, ProcessQueue>> it = this.rebalanceImpl.getProcessQueueTable().entrySet().iterator();
    while (it.hasNext()) {
        Entry<MessageQueue, ProcessQueue> next = it.next();
        MessageQueue mq = next.getKey();
        ProcessQueue pq = next.getValue();

        ProcessQueueInfo pqinfo = new ProcessQueueInfo();
        pqinfo.setCommitOffset(this.offsetStore.readOffset(mq, ReadOffsetType.MEMORY_FIRST_THEN_STORE));
        pq.fillProcessQueueInfo(pqinfo);
        info.getMqTable().put(mq, pqinfo);
    }

    for (SubscriptionData sd : subSet) {
        ConsumeStatus consumeStatus = this.mQClientFactory.getConsumerStatsManager().consumeStatus(this.groupName(), sd.getTopic());
        info.getStatusTable().put(sd.getTopic(), consumeStatus);
    }

    return info;
}
 
Example 2
Source File: DefaultLitePullConsumerImpl.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultLitePullConsumer);
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));
    info.setProperties(prop);

    info.getSubscriptionSet().addAll(this.subscriptions());
    return info;
}
 
Example 3
Source File: DefaultMQPullConsumerImpl.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPullConsumer);
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));
    info.setProperties(prop);

    info.getSubscriptionSet().addAll(this.subscriptions());
    return info;
}
 
Example 4
Source File: DefaultMQPushConsumerImpl.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPushConsumer);

    prop.put(ConsumerRunningInfo.PROP_CONSUME_ORDERLY, String.valueOf(this.consumeOrderly));
    prop.put(ConsumerRunningInfo.PROP_THREADPOOL_CORE_SIZE, String.valueOf(this.consumeMessageService.getCorePoolSize()));
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));

    info.setProperties(prop);

    Set<SubscriptionData> subSet = this.subscriptions();
    info.getSubscriptionSet().addAll(subSet);

    Iterator<Entry<MessageQueue, ProcessQueue>> it = this.rebalanceImpl.getProcessQueueTable().entrySet().iterator();
    while (it.hasNext()) {
        Entry<MessageQueue, ProcessQueue> next = it.next();
        MessageQueue mq = next.getKey();
        ProcessQueue pq = next.getValue();

        ProcessQueueInfo pqinfo = new ProcessQueueInfo();
        pqinfo.setCommitOffset(this.offsetStore.readOffset(mq, ReadOffsetType.MEMORY_FIRST_THEN_STORE));
        pq.fillProcessQueueInfo(pqinfo);
        info.getMqTable().put(mq, pqinfo);
    }

    for (SubscriptionData sd : subSet) {
        ConsumeStatus consumeStatus = this.mQClientFactory.getConsumerStatsManager().consumeStatus(this.groupName(), sd.getTopic());
        info.getStatusTable().put(sd.getTopic(), consumeStatus);
    }

    return info;
}
 
Example 5
Source File: DefaultMQPullConsumerImpl.java    From rocketmq_trans_message with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPullConsumer);
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));
    info.setProperties(prop);

    info.getSubscriptionSet().addAll(this.subscriptions());
    return info;
}
 
Example 6
Source File: DefaultMQPushConsumerImpl.java    From rocketmq_trans_message with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPushConsumer);

    prop.put(ConsumerRunningInfo.PROP_CONSUME_ORDERLY, String.valueOf(this.consumeOrderly));
    prop.put(ConsumerRunningInfo.PROP_THREADPOOL_CORE_SIZE, String.valueOf(this.consumeMessageService.getCorePoolSize()));
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));

    info.setProperties(prop);

    Set<SubscriptionData> subSet = this.subscriptions();
    info.getSubscriptionSet().addAll(subSet);

    Iterator<Entry<MessageQueue, ProcessQueue>> it = this.rebalanceImpl.getProcessQueueTable().entrySet().iterator();
    while (it.hasNext()) {
        Entry<MessageQueue, ProcessQueue> next = it.next();
        MessageQueue mq = next.getKey();
        ProcessQueue pq = next.getValue();

        ProcessQueueInfo pqinfo = new ProcessQueueInfo();
        pqinfo.setCommitOffset(this.offsetStore.readOffset(mq, ReadOffsetType.MEMORY_FIRST_THEN_STORE));
        pq.fillProcessQueueInfo(pqinfo);
        info.getMqTable().put(mq, pqinfo);
    }

    for (SubscriptionData sd : subSet) {
        ConsumeStatus consumeStatus = this.mQClientFactory.getConsumerStatsManager().consumeStatus(this.groupName(), sd.getTopic());
        info.getStatusTable().put(sd.getTopic(), consumeStatus);
    }

    return info;
}
 
Example 7
Source File: DefaultMQPullConsumerImpl.java    From rocketmq-all-4.1.0-incubating with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPullConsumer);
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));
    info.setProperties(prop);

    info.getSubscriptionSet().addAll(this.subscriptions());
    return info;
}
 
Example 8
Source File: DefaultMQPushConsumerImpl.java    From rocketmq-all-4.1.0-incubating with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPushConsumer);

    prop.put(ConsumerRunningInfo.PROP_CONSUME_ORDERLY, String.valueOf(this.consumeOrderly));
    prop.put(ConsumerRunningInfo.PROP_THREADPOOL_CORE_SIZE, String.valueOf(this.consumeMessageService.getCorePoolSize()));
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));

    info.setProperties(prop);

    Set<SubscriptionData> subSet = this.subscriptions();
    info.getSubscriptionSet().addAll(subSet);

    Iterator<Entry<MessageQueue, ProcessQueue>> it = this.rebalanceImpl.getProcessQueueTable().entrySet().iterator();
    while (it.hasNext()) {
        Entry<MessageQueue, ProcessQueue> next = it.next();
        MessageQueue mq = next.getKey();
        ProcessQueue pq = next.getValue();

        ProcessQueueInfo pqinfo = new ProcessQueueInfo();
        pqinfo.setCommitOffset(this.offsetStore.readOffset(mq, ReadOffsetType.MEMORY_FIRST_THEN_STORE));
        pq.fillProcessQueueInfo(pqinfo);
        info.getMqTable().put(mq, pqinfo);
    }

    for (SubscriptionData sd : subSet) {
        ConsumeStatus consumeStatus = this.mQClientFactory.getConsumerStatsManager().consumeStatus(this.groupName(), sd.getTopic());
        info.getStatusTable().put(sd.getTopic(), consumeStatus);
    }

    return info;
}
 
Example 9
Source File: DefaultMQPullConsumerImpl.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPullConsumer);
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));
    info.setProperties(prop);

    info.getSubscriptionSet().addAll(this.subscriptions());
    return info;
}
 
Example 10
Source File: DefaultMQPushConsumerImpl.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPushConsumer);

    prop.put(ConsumerRunningInfo.PROP_CONSUME_ORDERLY, String.valueOf(this.consumeOrderly));
    prop.put(ConsumerRunningInfo.PROP_THREADPOOL_CORE_SIZE, String.valueOf(this.consumeMessageService.getCorePoolSize()));
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));

    info.setProperties(prop);

    Set<SubscriptionData> subSet = this.subscriptions();
    info.getSubscriptionSet().addAll(subSet);

    Iterator<Entry<MessageQueue, ProcessQueue>> it = this.rebalanceImpl.getProcessQueueTable().entrySet().iterator();
    while (it.hasNext()) {
        Entry<MessageQueue, ProcessQueue> next = it.next();
        MessageQueue mq = next.getKey();
        ProcessQueue pq = next.getValue();

        ProcessQueueInfo pqinfo = new ProcessQueueInfo();
        pqinfo.setCommitOffset(this.offsetStore.readOffset(mq, ReadOffsetType.MEMORY_FIRST_THEN_STORE));
        pq.fillProcessQueueInfo(pqinfo);
        info.getMqTable().put(mq, pqinfo);
    }

    for (SubscriptionData sd : subSet) {
        ConsumeStatus consumeStatus = this.mQClientFactory.getConsumerStatsManager().consumeStatus(this.groupName(), sd.getTopic());
        info.getStatusTable().put(sd.getTopic(), consumeStatus);
    }

    return info;
}
 
Example 11
Source File: DefaultMQPullConsumerImpl.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPullConsumer);
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));
    info.setProperties(prop);

    info.getSubscriptionSet().addAll(this.subscriptions());
    return info;
}
 
Example 12
Source File: DefaultMQPushConsumerImpl.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPushConsumer);

    prop.put(ConsumerRunningInfo.PROP_CONSUME_ORDERLY, String.valueOf(this.consumeOrderly));
    prop.put(ConsumerRunningInfo.PROP_THREADPOOL_CORE_SIZE, String.valueOf(this.consumeMessageService.getCorePoolSize()));
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));

    info.setProperties(prop);

    Set<SubscriptionData> subSet = this.subscriptions();
    info.getSubscriptionSet().addAll(subSet);

    Iterator<Entry<MessageQueue, ProcessQueue>> it = this.rebalanceImpl.getProcessQueueTable().entrySet().iterator();
    while (it.hasNext()) {
        Entry<MessageQueue, ProcessQueue> next = it.next();
        MessageQueue mq = next.getKey();
        ProcessQueue pq = next.getValue();

        ProcessQueueInfo pqinfo = new ProcessQueueInfo();
        pqinfo.setCommitOffset(this.offsetStore.readOffset(mq, ReadOffsetType.MEMORY_FIRST_THEN_STORE));
        pq.fillProcessQueueInfo(pqinfo);
        info.getMqTable().put(mq, pqinfo);
    }

    for (SubscriptionData sd : subSet) {
        ConsumeStatus consumeStatus = this.mQClientFactory.getConsumerStatsManager().consumeStatus(this.groupName(), sd.getTopic());
        info.getStatusTable().put(sd.getTopic(), consumeStatus);
    }

    return info;
}
 
Example 13
Source File: DefaultMQPullConsumerImpl.java    From rocketmq-read with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPullConsumer);
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));
    info.setProperties(prop);

    info.getSubscriptionSet().addAll(this.subscriptions());
    return info;
}
 
Example 14
Source File: DefaultMQPushConsumerImpl.java    From rocketmq-read with Apache License 2.0 5 votes vote down vote up
/**
 * 获取消费者的运行时信息
 * @return ;
 */
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPushConsumer);

    prop.put(ConsumerRunningInfo.PROP_CONSUME_ORDERLY, String.valueOf(this.consumeOrderly));
    prop.put(ConsumerRunningInfo.PROP_THREADPOOL_CORE_SIZE, String.valueOf(this.consumeMessageService.getCorePoolSize()));
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));

    info.setProperties(prop);

    Set<SubscriptionData> subSet = this.subscriptions();
    info.getSubscriptionSet().addAll(subSet);

    Iterator<Entry<MessageQueue, ProcessQueue>> it = this.rebalanceImpl.getProcessQueueTable().entrySet().iterator();
    while (it.hasNext()) {
        Entry<MessageQueue, ProcessQueue> next = it.next();
        MessageQueue mq = next.getKey();
        ProcessQueue pq = next.getValue();

        ProcessQueueInfo pqinfo = new ProcessQueueInfo();
        pqinfo.setCommitOffset(this.offsetStore.readOffset(mq, ReadOffsetType.MEMORY_FIRST_THEN_STORE));
        pq.fillProcessQueueInfo(pqinfo);
        info.getMqTable().put(mq, pqinfo);
    }

    for (SubscriptionData sd : subSet) {
        ConsumeStatus consumeStatus = this.mQClientFactory.getConsumerStatsManager().consumeStatus(this.groupName(), sd.getTopic());
        info.getStatusTable().put(sd.getTopic(), consumeStatus);
    }

    return info;
}
 
Example 15
Source File: DefaultMQPullConsumerImpl.java    From rocketmq-4.3.0 with Apache License 2.0 5 votes vote down vote up
@Override
    public ConsumerRunningInfo consumerRunningInfo() {
//        消费者运行信息
        ConsumerRunningInfo info = new ConsumerRunningInfo();

//        mqPullConsumer信息
        Properties prop = MixAll.object2Properties(this.defaultMQPullConsumer);
//        消费开始时间
        prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));
        info.setProperties(prop);

//        订阅数据=》
        info.getSubscriptionSet().addAll(this.subscriptions());
        return info;
    }
 
Example 16
Source File: DefaultMQPullConsumerImpl.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPullConsumer);
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));
    info.setProperties(prop);

    info.getSubscriptionSet().addAll(this.subscriptions());
    return info;
}
 
Example 17
Source File: DefaultMQPushConsumerImpl.java    From rocketmq-4.3.0 with Apache License 2.0 4 votes vote down vote up
@Override
    public ConsumerRunningInfo consumerRunningInfo() {
//        消费者运行信息
        ConsumerRunningInfo info = new ConsumerRunningInfo();

//        MQPushConsumer信息
        Properties prop = MixAll.object2Properties(this.defaultMQPushConsumer);

//        消费顺序
        prop.put(ConsumerRunningInfo.PROP_CONSUME_ORDERLY, String.valueOf(this.consumeOrderly));
//        消费线程池线程数
        prop.put(ConsumerRunningInfo.PROP_THREADPOOL_CORE_SIZE, String.valueOf(this.consumeMessageService.getCorePoolSize()));
//        消费开始时间
        prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp));

        info.setProperties(prop);

//        订阅信息=》
        Set<SubscriptionData> subSet = this.subscriptions();
        info.getSubscriptionSet().addAll(subSet);

        Iterator<Entry<MessageQueue, ProcessQueue>> it = this.rebalanceImpl.getProcessQueueTable().entrySet().iterator();
        while (it.hasNext()) {
            Entry<MessageQueue, ProcessQueue> next = it.next();
            MessageQueue mq = next.getKey();
            ProcessQueue pq = next.getValue();

//            消息处理队列
            ProcessQueueInfo pqinfo = new ProcessQueueInfo();
            pqinfo.setCommitOffset(this.offsetStore.readOffset(mq, ReadOffsetType.MEMORY_FIRST_THEN_STORE));
            pq.fillProcessQueueInfo(pqinfo);
            info.getMqTable().put(mq, pqinfo);
        }

        for (SubscriptionData sd : subSet) {
//            消费状态
            ConsumeStatus consumeStatus = this.mQClientFactory.getConsumerStatsManager().consumeStatus(this.groupName(), sd.getTopic());
            info.getStatusTable().put(sd.getTopic(), consumeStatus);
        }

        return info;
    }