Java Code Examples for com.alibaba.rocketmq.client.Validators#checkGroup()

The following examples show how to use com.alibaba.rocketmq.client.Validators#checkGroup() . 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: DefaultMQProducerImpl.java    From reading-and-annotate-rocketmq-3.4.6 with GNU General Public License v3.0 5 votes vote down vote up
private void checkConfig() throws MQClientException {
    Validators.checkGroup(this.defaultMQProducer.getProducerGroup());

    if (null == this.defaultMQProducer.getProducerGroup()) {
        throw new MQClientException("producerGroup is null", null);
    }

    if (this.defaultMQProducer.getProducerGroup().equals(MixAll.DEFAULT_PRODUCER_GROUP)) {
        throw new MQClientException("producerGroup can not equal " + MixAll.DEFAULT_PRODUCER_GROUP
                + ", please specify another one.", null);
    }
}
 
Example 2
Source File: DefaultMQPullConsumerImpl.java    From reading-and-annotate-rocketmq-3.4.6 with GNU General Public License v3.0 5 votes vote down vote up
private void checkConfig() throws MQClientException {
    // check consumerGroup
    Validators.checkGroup(this.defaultMQPullConsumer.getConsumerGroup());

    // consumerGroup
    if (null == this.defaultMQPullConsumer.getConsumerGroup()) {
        throw new MQClientException("consumerGroup is null" //
                + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL), //
                null);
    }

    // consumerGroup
    if (this.defaultMQPullConsumer.getConsumerGroup().equals(MixAll.DEFAULT_CONSUMER_GROUP)) {
        throw new MQClientException("consumerGroup can not equal "//
                + MixAll.DEFAULT_CONSUMER_GROUP //
                + ", please specify another one."//
                + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL), //
                null);
    }

    // messageModel
    if (null == this.defaultMQPullConsumer.getMessageModel()) {
        throw new MQClientException("messageModel is null" //
                + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL), //
                null);
    }

    // allocateMessageQueueStrategy
    if (null == this.defaultMQPullConsumer.getAllocateMessageQueueStrategy()) {
        throw new MQClientException("allocateMessageQueueStrategy is null" //
                + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL), //
                null);
    }
}
 
Example 3
Source File: DefaultMQProducerImpl.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
private void checkConfig() throws MQClientException {
    Validators.checkGroup(this.defaultMQProducer.getProducerGroup());

    if (null == this.defaultMQProducer.getProducerGroup()) {
        throw new MQClientException("producerGroup is null", null);
    }

    if (this.defaultMQProducer.getProducerGroup().equals(MixAll.DEFAULT_PRODUCER_GROUP)) {
        throw new MQClientException("producerGroup can not equal " + MixAll.DEFAULT_PRODUCER_GROUP + ", please specify another one.",
                null);
    }
}
 
Example 4
Source File: DefaultMQProducerImpl.java    From RocketMQ-Master-analyze with Apache License 2.0 5 votes vote down vote up
private void checkConfig() throws MQClientException {
    Validators.checkGroup(this.defaultMQProducer.getProducerGroup());

    if (null == this.defaultMQProducer.getProducerGroup()) {
        throw new MQClientException("producerGroup is null", null);
    }

    if (this.defaultMQProducer.getProducerGroup().equals(MixAll.DEFAULT_PRODUCER_GROUP)) {
        throw new MQClientException("producerGroup can not equal " + MixAll.DEFAULT_PRODUCER_GROUP
                + ", please specify another one.",
            null);
    }
}
 
Example 5
Source File: DefaultMQPullConsumerImpl.java    From RocketMQ-Master-analyze with Apache License 2.0 5 votes vote down vote up
private void checkConfig() throws MQClientException {
    // check consumerGroup
    Validators.checkGroup(this.defaultMQPullConsumer.getConsumerGroup());

    // consumerGroup
    if (null == this.defaultMQPullConsumer.getConsumerGroup()) {
        throw new MQClientException(
            "consumerGroup is null" //
                    + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL), //
            null);
    }

    // consumerGroup
    if (this.defaultMQPullConsumer.getConsumerGroup().equals(MixAll.DEFAULT_CONSUMER_GROUP)) {
        throw new MQClientException(
            "consumerGroup can not equal "//
                    + MixAll.DEFAULT_CONSUMER_GROUP //
                    + ", please specify another one."//
                    + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL), //
            null);
    }

    // messageModel
    if (null == this.defaultMQPullConsumer.getMessageModel()) {
        throw new MQClientException(
            "messageModel is null" //
                    + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL), //
            null);
    }

    // allocateMessageQueueStrategy
    if (null == this.defaultMQPullConsumer.getAllocateMessageQueueStrategy()) {
        throw new MQClientException(
            "allocateMessageQueueStrategy is null" //
                    + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL), //
            null);
    }
}
 
Example 6
Source File: DefaultMQPullConsumerImpl.java    From rocketmq with Apache License 2.0 4 votes vote down vote up
private void checkConfig() throws MQClientException {
    // check consumerGroup
    Validators.checkGroup(this.defaultMQPullConsumer.getConsumerGroup());

    // consumerGroup
    if (null == this.defaultMQPullConsumer.getConsumerGroup()) {
        throw new MQClientException(
                "consumerGroup is null" //
                        + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL), //
                null);
    }

    // consumerGroup
    if (this.defaultMQPullConsumer.getConsumerGroup().equals(MixAll.DEFAULT_CONSUMER_GROUP)) {
        throw new MQClientException(
                "consumerGroup can not equal "//
                        + MixAll.DEFAULT_CONSUMER_GROUP //
                        + ", please specify another one."//
                        + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL), //
                null);
    }

    // messageModel
    if (null == this.defaultMQPullConsumer.getMessageModel()) {
        throw new MQClientException(
                "messageModel is null" //
                        + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL), //
                null);
    }

    // allocateMessageQueueStrategy
    if (null == this.defaultMQPullConsumer.getAllocateMessageQueueStrategy()) {
        throw new MQClientException(
                "allocateMessageQueueStrategy is null" //
                        + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL), //
                null);
    }

    // allocateMessageQueueStrategy
    if (this.defaultMQPullConsumer.getConsumerTimeoutMillisWhenSuspend() < this.defaultMQPullConsumer.getBrokerSuspendMaxTimeMillis()) {
        throw new MQClientException(
                "Long polling mode, the consumer consumerTimeoutMillisWhenSuspend must greater than brokerSuspendMaxTimeMillis" //
                        + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL), //
                null);
    }
}