Package com.alibaba.rocketmq.tools.admin.api

Examples of com.alibaba.rocketmq.tools.admin.api.MessageTrack


        GroupList groupList = this.queryTopicConsumeByWho(msg.getTopic());

        for (String group : groupList.getGroupList()) {
            // 查询连接
            MessageTrack mt = new MessageTrack();
            mt.setConsumerGroup(group);
            mt.setTrackType(TrackType.UNKNOW_EXCEPTION);
            try {
                ConsumerConnection cc = this.examineConsumerConnectionInfo(group);
                switch (cc.getConsumeType()) {
                case CONSUME_ACTIVELY:
                    mt.setTrackType(TrackType.SUBSCRIBED_BUT_PULL);
                    break;
                case CONSUME_PASSIVELY:
                    boolean ifConsumed = this.consumed(msg, group);
                    if (ifConsumed) {
                        mt.setTrackType(TrackType.SUBSCRIBED_AND_CONSUMED);

                        // 查看订阅关系是否匹配
                        Iterator<Entry<String, SubscriptionData>> it =
                                cc.getSubscriptionTable().entrySet().iterator();
                        while (it.hasNext()) {
                            Entry<String, SubscriptionData> next = it.next();
                            if (next.getKey().equals(msg.getTopic())) {
                                if (next.getValue().getTagsSet().contains(msg.getTags()) //
                                        || next.getValue().getTagsSet().contains("*")//
                                        || next.getValue().getTagsSet().isEmpty()//
                                ) {

                                }
                                else {
                                    mt.setTrackType(TrackType.SUBSCRIBED_BUT_FILTERD);
                                }
                            }
                        }
                    }
                    else {
                        mt.setTrackType(TrackType.SUBSCRIBED_AND_NOT_CONSUME_YET);
                    }
                    break;
                default:
                    break;
                }
            }
            catch (Exception e) {
                mt.setExceptionDesc(RemotingHelper.exceptionSimpleDesc(e));
            }

            result.add(mt);
        }

View Full Code Here


        GroupList groupList = this.queryTopicConsumeByWho(msg.getTopic());

        for (String group : groupList.getGroupList()) {
            // 查询连接
            MessageTrack mt = new MessageTrack();
            mt.setConsumerGroup(group);
            mt.setTrackType(TrackType.UNKNOW_EXCEPTION);
            try {
                ConsumerConnection cc = this.examineConsumerConnectionInfo(group);
                switch (cc.getConsumeType()) {
                case CONSUME_ACTIVELY:
                    mt.setTrackType(TrackType.SUBSCRIBED_BUT_PULL);
                    break;
                case CONSUME_PASSIVELY:
                    boolean ifConsumed = this.consumed(msg, group);
                    if (ifConsumed) {
                        mt.setTrackType(TrackType.SUBSCRIBED_AND_CONSUMED);

                        // 查看订阅关系是否匹配
                        Iterator<Entry<String, SubscriptionData>> it =
                                cc.getSubscriptionTable().entrySet().iterator();
                        while (it.hasNext()) {
                            Entry<String, SubscriptionData> next = it.next();
                            if (next.getKey().equals(msg.getTopic())) {
                                if (next.getValue().getTagsSet().contains(msg.getTags()) //
                                        || next.getValue().getTagsSet().contains("*")//
                                        || next.getValue().getTagsSet().isEmpty()//
                                ) {

                                }
                                else {
                                    mt.setTrackType(TrackType.SUBSCRIBED_BUT_FILTERD);
                                }
                            }
                        }
                    }
                    else {
                        mt.setTrackType(TrackType.SUBSCRIBED_AND_NOT_CONSUME_YET);
                    }
                    break;
                default:
                    break;
                }
            }
            catch (Exception e) {
                mt.setExceptionDesc(RemotingHelper.exceptionSimpleDesc(e));
            }

            result.add(mt);
        }

View Full Code Here

TOP

Related Classes of com.alibaba.rocketmq.tools.admin.api.MessageTrack

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.