// Path: mq-aliyun-consumer-spring-boot-starter/src/main/java/com/github/mq/consumer/ConsumerAble.java
// public interface ConsumerAble {
//     String BROADCASTING = "BROADCASTING";
//     String CLUSTERING = "CLUSTERING";
// 
//     void init(Ons ons);
// }
// 
// Path: mq-aliyun-consumer-spring-boot-starter/src/main/java/com/github/mq/consumer/Ons.java
// public interface Ons {
//     void defaultTopic(String topic);
//     ConsumerBuild consumer(String cid);
//     ConsumerBuild consumer(String cid, ConsumerOptional consumerOptional);
// 
//     ConsumerBuild consumerOrdered(String cid);
//     ConsumerBuild consumerOrdered(String cid, ConsumerOptional consumerOptional);
// }
// 
// Path: mq-aliyun-consumer-spring-boot-starter/src/main/java/com/github/mq/consumer/models/ConsumerOptional.java
// public class ConsumerOptional {
//     //消费线程数
//     private Integer consumeThread;
//     //消费模式(集群 : CLUSTERING, 广播 : BROADCASTING)
//     private String consumerModel;
//     //消息消费失败时的最大重试次数
//     private Integer maxReconsume;
//     //顺序消息消费失败进行重试前的等待时间 单位(毫秒)
//     private Integer suspendTime;
// 
//     public ConsumerOptional(){}
// 
//     public ConsumerOptional(Integer consumeThread){
//         this.consumeThread = consumeThread;
//     }
// 
//     public ConsumerOptional(Integer consumeThread,Integer maxReconsume){
//         this.consumeThread = consumeThread;
//         this.maxReconsume = maxReconsume;
//     }
// 
//     public Integer getConsumeThread() {
//         return consumeThread;
//     }
// 
//     public ConsumerOptional setConsumeThread(Integer consumeThread) {
//         this.consumeThread = consumeThread;
//         return this;
//     }
// 
//     public String getConsumerModel() {
//         return consumerModel;
//     }
// 
//     public ConsumerOptional setConsumerModel(String consumerModel) {
//         this.consumerModel = consumerModel;
//         return this;
//     }
// 
//     public Integer getMaxReconsume() {
//         return maxReconsume;
//     }
// 
//     public ConsumerOptional setMaxReconsume(Integer maxReconsume) {
//         this.maxReconsume = maxReconsume;
//         return this;
//     }
// 
//     public Integer getSuspendTime() {
//         return suspendTime;
//     }
// 
//     public ConsumerOptional setSuspendTime(Integer suspendTime) {
//         this.suspendTime = suspendTime;
//         return this;
//     }
// }


import com.github.mq.consumer.ConsumerAble;
import com.github.mq.consumer.Ons;
import com.github.mq.consumer.models.ConsumerOptional;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
package com.github.mq;


/**
 * Created by wangziqing on 17/7/20.
 */
@SpringBootApplication
public class App implements ConsumerAble{
    @Override
    public void init(Ons ons) {
        ons.defaultTopic("ww");
        ons.consumer("CID").subscribeTag("tag1",TestConsumer::test);
        ons.consumer("CID").subscribeTag("tag2",TestConsumer::test);

// Path: mq-aliyun-consumer-spring-boot-starter/src/main/java/com/github/mq/consumer/ConsumerAble.java
// public interface ConsumerAble {
//     String BROADCASTING = "BROADCASTING";
//     String CLUSTERING = "CLUSTERING";
// 
//     void init(Ons ons);
// }
// 
// Path: mq-aliyun-consumer-spring-boot-starter/src/main/java/com/github/mq/consumer/Ons.java
// public interface Ons {
//     void defaultTopic(String topic);
//     ConsumerBuild consumer(String cid);
//     ConsumerBuild consumer(String cid, ConsumerOptional consumerOptional);
// 
//     ConsumerBuild consumerOrdered(String cid);
//     ConsumerBuild consumerOrdered(String cid, ConsumerOptional consumerOptional);
// }
// 
// Path: mq-aliyun-consumer-spring-boot-starter/src/main/java/com/github/mq/consumer/models/ConsumerOptional.java
// public class ConsumerOptional {
//     //消费线程数
//     private Integer consumeThread;
//     //消费模式(集群 : CLUSTERING, 广播 : BROADCASTING)
//     private String consumerModel;
//     //消息消费失败时的最大重试次数
//     private Integer maxReconsume;
//     //顺序消息消费失败进行重试前的等待时间 单位(毫秒)
//     private Integer suspendTime;
// 
//     public ConsumerOptional(){}
// 
//     public ConsumerOptional(Integer consumeThread){
//         this.consumeThread = consumeThread;
//     }
// 
//     public ConsumerOptional(Integer consumeThread,Integer maxReconsume){
//         this.consumeThread = consumeThread;
//         this.maxReconsume = maxReconsume;
//     }
// 
//     public Integer getConsumeThread() {
//         return consumeThread;
//     }
// 
//     public ConsumerOptional setConsumeThread(Integer consumeThread) {
//         this.consumeThread = consumeThread;
//         return this;
//     }
// 
//     public String getConsumerModel() {
//         return consumerModel;
//     }
// 
//     public ConsumerOptional setConsumerModel(String consumerModel) {
//         this.consumerModel = consumerModel;
//         return this;
//     }
// 
//     public Integer getMaxReconsume() {
//         return maxReconsume;
//     }
// 
//     public ConsumerOptional setMaxReconsume(Integer maxReconsume) {
//         this.maxReconsume = maxReconsume;
//         return this;
//     }
// 
//     public Integer getSuspendTime() {
//         return suspendTime;
//     }
// 
//     public ConsumerOptional setSuspendTime(Integer suspendTime) {
//         this.suspendTime = suspendTime;
//         return this;
//     }
// }


// Path: mq-aliyun-consumer-spring-boot-starter/src/test/java/com/github/mq/App.java
import com.github.mq.consumer.ConsumerAble;
import com.github.mq.consumer.Ons;
import com.github.mq.consumer.models.ConsumerOptional;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

package com.github.mq;


/**
 * Created by wangziqing on 17/7/20.
 */
@SpringBootApplication
public class App implements ConsumerAble{
    @Override
    public void init(Ons ons) {
        ons.defaultTopic("ww");
        ons.consumer("CID").subscribeTag("tag1",TestConsumer::test);
        ons.consumer("CID").subscribeTag("tag2",TestConsumer::test);

        ons.consumerOrdered("CID2",new ConsumerOptional(10,30)).subscribeTag("tag_a || tab_c",TestConsumer::test);