Java Code Examples for org.apache.rocketmq.common.protocol.heartbeat.ConsumeType#CONSUME_PASSIVELY

The following examples show how to use org.apache.rocketmq.common.protocol.heartbeat.ConsumeType#CONSUME_PASSIVELY . 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: MQClientInstance.java    From rocketmq-all-4.1.0-incubating with Apache License 2.0 6 votes vote down vote up
private void uploadFilterClassSource() {
    Iterator<Entry<String, MQConsumerInner>> it = this.consumerTable.entrySet().iterator();
    while (it.hasNext()) {
        Entry<String, MQConsumerInner> next = it.next();
        MQConsumerInner consumer = next.getValue();
        if (ConsumeType.CONSUME_PASSIVELY == consumer.consumeType()) {
            Set<SubscriptionData> subscriptions = consumer.subscriptions();
            for (SubscriptionData sub : subscriptions) {
                if (sub.isClassFilterMode() && sub.getFilterClassSource() != null) {
                    final String consumerGroup = consumer.groupName();
                    final String className = sub.getSubString();
                    final String topic = sub.getTopic();
                    final String filterClassSource = sub.getFilterClassSource();
                    try {
                        this.uploadFilterClassToAllFilterServer(consumerGroup, className, topic, filterClassSource);
                    } catch (Exception e) {
                        log.error("uploadFilterClassToAllFilterServer Exception", e);
                    }
                }
            }
        }
    }
}
 
Example 2
Source File: MQClientInstance.java    From rocketmq-4.3.0 with Apache License 2.0 5 votes vote down vote up
private void uploadFilterClassSource() {
//        遍历消费者
        Iterator<Entry<String, MQConsumerInner>> it = this.consumerTable.entrySet().iterator();
        while (it.hasNext()) {
            Entry<String, MQConsumerInner> next = it.next();
            MQConsumerInner consumer = next.getValue();
//            如果消费者消息模式是push
            if (ConsumeType.CONSUME_PASSIVELY == consumer.consumeType()) {
//                获取消费者订阅信息
                Set<SubscriptionData> subscriptions = consumer.subscriptions();
                for (SubscriptionData sub : subscriptions) {
                    if (sub.isClassFilterMode() && sub.getFilterClassSource() != null) {
                        final String consumerGroup = consumer.groupName();
                        final String className = sub.getSubString();
                        final String topic = sub.getTopic();
                        final String filterClassSource = sub.getFilterClassSource();
                        try {
//                            更新过滤类去所有过滤的server=》
                            this.uploadFilterClassToAllFilterServer(consumerGroup, className, topic, filterClassSource);
                        } catch (Exception e) {
                            log.error("uploadFilterClassToAllFilterServer Exception", e);
                        }
                    }
                }
            }
        }
    }
 
Example 3
Source File: MQClientInstance.java    From rocketmq-read with Apache License 2.0 5 votes vote down vote up
/**
 * 上传FilterClass源码
 */
private void uploadFilterClassSource() {

    Iterator<Entry<String, MQConsumerInner>> it = this.consumerTable.entrySet().iterator();
    while (it.hasNext()) {

        Entry<String, MQConsumerInner> next = it.next();

        MQConsumerInner consumer = next.getValue();
        //如果消费模型是push模型
        if (ConsumeType.CONSUME_PASSIVELY == consumer.consumeType()) {
            Set<SubscriptionData> subscriptions = consumer.subscriptions();
            for (SubscriptionData sub : subscriptions) {
                if (sub.isClassFilterMode() && sub.getFilterClassSource() != null) {
                    final String consumerGroup = consumer.groupName();
                    final String className = sub.getSubString();
                    final String topic = sub.getTopic();
                    final String filterClassSource = sub.getFilterClassSource();
                    try {
                        this.uploadFilterClassToAllFilterServer(consumerGroup, className, topic, filterClassSource);
                    } catch (Exception e) {
                        log.error("uploadFilterClassToAllFilterServer Exception", e);
                    }
                }
            }
        }
    }
}
 
Example 4
Source File: DefaultMQPushConsumerImpl.java    From rocketmq-all-4.1.0-incubating with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumeType consumeType() {
    return ConsumeType.CONSUME_PASSIVELY;
}
 
Example 5
Source File: DefaultMQPushConsumerImpl.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumeType consumeType() {
    return ConsumeType.CONSUME_PASSIVELY;
}
 
Example 6
Source File: ConsumerProgressSubCommand.java    From rocketmq_trans_message with Apache License 2.0 4 votes vote down vote up
public String messageModelDesc() {
    if (this.count != 0 && this.getConsumeType() == ConsumeType.CONSUME_PASSIVELY) {
        return this.getMessageModel().toString();
    }
    return "";
}
 
Example 7
Source File: RebalancePushImpl.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumeType consumeType() {
    return ConsumeType.CONSUME_PASSIVELY;
}
 
Example 8
Source File: DefaultMQPushConsumerImpl.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumeType consumeType() {
    return ConsumeType.CONSUME_PASSIVELY;
}
 
Example 9
Source File: DefaultMQPushConsumerImpl.java    From rocketmq_trans_message with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumeType consumeType() {
    return ConsumeType.CONSUME_PASSIVELY;
}
 
Example 10
Source File: RebalancePushImpl.java    From rocketmq with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumeType consumeType() {
    return ConsumeType.CONSUME_PASSIVELY;
}
 
Example 11
Source File: DefaultMQPushConsumerImpl.java    From rocketmq with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumeType consumeType() {
    return ConsumeType.CONSUME_PASSIVELY;
}
 
Example 12
Source File: ConsumerProgressSubCommand.java    From rocketmq-read with Apache License 2.0 4 votes vote down vote up
public String messageModelDesc() {
    if (this.count != 0 && this.getConsumeType() == ConsumeType.CONSUME_PASSIVELY) {
        return this.getMessageModel().toString();
    }
    return "";
}
 
Example 13
Source File: RebalancePushImpl.java    From rocketmq-read with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumeType consumeType() {
    return ConsumeType.CONSUME_PASSIVELY;
}
 
Example 14
Source File: DefaultMQPushConsumerImpl.java    From rocketmq-read with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumeType consumeType() {
    return ConsumeType.CONSUME_PASSIVELY;
}
 
Example 15
Source File: ConsumerProgressSubCommand.java    From rocketmq-all-4.1.0-incubating with Apache License 2.0 4 votes vote down vote up
public String messageModelDesc() {
    if (this.count != 0 && this.getConsumeType() == ConsumeType.CONSUME_PASSIVELY) {
        return this.getMessageModel().toString();
    }
    return "";
}
 
Example 16
Source File: RebalancePushImpl.java    From rocketmq-all-4.1.0-incubating with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumeType consumeType() {
    return ConsumeType.CONSUME_PASSIVELY;
}
 
Example 17
Source File: DefaultMQPushConsumerImpl.java    From rocketmq-4.3.0 with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumeType consumeType() {
    return ConsumeType.CONSUME_PASSIVELY;
}
 
Example 18
Source File: ConsumerProgressSubCommand.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
public String messageModelDesc() {
    if (this.count != 0 && this.getConsumeType() == ConsumeType.CONSUME_PASSIVELY) {
        return this.getMessageModel().toString();
    }
    return "";
}
 
Example 19
Source File: RebalancePushImpl.java    From rocketmq_trans_message with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumeType consumeType() {
    return ConsumeType.CONSUME_PASSIVELY;
}
 
Example 20
Source File: RebalancePushImpl.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumeType consumeType() {
    return ConsumeType.CONSUME_PASSIVELY;
}