Package com.taobao.metamorphosis.exception

Examples of com.taobao.metamorphosis.exception.InvalidConsumerConfigException


    protected MessageConsumer createBroadcastConsumer(final ConsumerConfig consumerConfig,
            final RecoverManager recoverManager) {
        // �ȼ��һ��ԭʼ��group�Ƿ�Ϊ��
        if (StringUtils.isBlank(consumerConfig.getGroup())) {
            throw new InvalidConsumerConfigException("Blank group");
        }

        return this.createConsumer(updateGroupForBroadcast(consumerConfig), this.newLocalOffsetStorage(),
            recoverManager);
    }
View Full Code Here


    private LocalOffsetStorage newLocalOffsetStorage() {
        try {
            return new LocalOffsetStorage();
        }
        catch (final IOException e) {
            throw new InvalidConsumerConfigException("����Consumerʧ��,Create LocalOffsetStorage failed", e);
        }
    }
View Full Code Here

            consumerConfig.setGroup(consumerConfig.getGroup() + "-"
                    + RemotingUtils.getLocalHost().replaceAll("[\\.\\:]", "-"));
            return consumerConfig;
        }
        catch (final Exception e) {
            throw new InvalidConsumerConfigException("��ȡ����ipʧ��", e);
        }
    }
View Full Code Here

                                               '"', ',', ';', '/', '?', '[', ']', '<', '>', '.', ':', ' ' };


    protected void checkConsumerConfig(final ConsumerConfig consumerConfig) {
        if (StringUtils.isBlank(consumerConfig.getGroup())) {
            throw new InvalidConsumerConfigException("Blank group");
        }
        final char[] chary = new char[consumerConfig.getGroup().length()];
        consumerConfig.getGroup().getChars(0, chary.length, chary, 0);
        for (final char ch : chary) {
            for (final char invalid : INVALID_GROUP_CHAR) {
                if (ch == invalid) {
                    throw new InvalidConsumerConfigException("Group name has invalid character " + ch);
                }
            }
        }
        if (consumerConfig.getFetchRunnerCount() <= 0) {
            throw new InvalidConsumerConfigException("Invalid fetchRunnerCount:" + consumerConfig.getFetchRunnerCount());
        }
        if (consumerConfig.getFetchTimeoutInMills() <= 0) {
            throw new InvalidConsumerConfigException("Invalid fetchTimeoutInMills:"
                    + consumerConfig.getFetchTimeoutInMills());
        }
    }
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.exception.InvalidConsumerConfigException

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.