private void subscribe()

in src/main/java/com/aliyun/mns/client/CloudPullTopic.java [67:90]


    private void subscribe(Vector<String> queueNameList, Vector<String> tagList) throws ServiceException {
        for (int i = 0; i < queueNameList.size(); i++) {
            String queueName = queueNameList.get(i);
            String queueEndpoint = this.rawTopic.generateQueueEndpoint(queueName);
            String subName = QUEUE_SUB_NAME_PREFIX + queueName;
            SubscriptionMeta subMeta = new SubscriptionMeta();
            subMeta.setSubscriptionName(subName);
            subMeta.setNotifyContentFormat(NotifyContentFormat.SIMPLIFIED);
            subMeta.setNotifyStrategy(SubscriptionMeta.NotifyStrategy.EXPONENTIAL_DECAY_RETRY);
            subMeta.setEndpoint(queueEndpoint);
            String tmpTag = tagList.get(i);
            if (tmpTag != null && tmpTag != "") {
                subMeta.setFilterTag(tmpTag);
            }

            try {
                this.rawTopic.subscribe(subMeta);
            } catch (ServiceException se) {
                if (!"SubscriptionAlreadyExist".equals(se.getErrorCode())) {
                    throw se;
                }
            }
        }
    }