Package com.taobao.metamorphosis.client

Examples of com.taobao.metamorphosis.client.MessageSessionFactory.createConsumer()


        // subscribed topic
        final String topic = "meta-test";
        // consumer group
        final String group = "meta-example";
        // create consumer,ǿ�ҽ���ʹ�õ���
        final MessageConsumer consumer = sessionFactory.createConsumer(new ConsumerConfig(group));
        // subscribe topic
        consumer.subscribe(topic, 1024 * 1024, new MessageListener() {

            private int count = 0;

View Full Code Here


        final String group = "meta-example";
        // create consumer,ǿ�ҽ���ʹ�õ���
        ConsumerConfig consumerConfig = new ConsumerConfig(group);
        // Ĭ������ȡ�ӳ�Ϊ5�룬�������ó�100���룬�����ʵ��Ӧ��Ҫ�������á�
        consumerConfig.setMaxDelayFetchTimeInMills(100);
        final MessageConsumer consumer = sessionFactory.createConsumer(consumerConfig);
        // subscribe topic
        consumer.subscribe(topic, 1024 * 1024, new MessageListener() {

            @Override
            public void recieveMessages(final Message message) {
View Full Code Here

        // subscribed topic
        final String topic = "meta-test";
        // consumer group
        final String group = "meta-example";
        // create consumer,ǿ�ҽ���ʹ�õ���
        final MessageConsumer consumer = sessionFactory.createConsumer(new ConsumerConfig(group));
        // start offset
        long offset = 0;
        MessageIterator it = null;
        // fetch messages
        while ((it = consumer.get(topic, new Partition("100-0"), offset, 1024 * 1024)) != null) {
View Full Code Here

        final String group = "meta-example";
        // create consumer,ǿ�ҽ���ʹ�õ���
        ConsumerConfig consumerConfig = new ConsumerConfig(group);
        // Ĭ������ȡ�ӳ�Ϊ5�룬�������ó�100���룬�����ʵ��Ӧ��Ҫ�������á�
        consumerConfig.setMaxDelayFetchTimeInMills(100);
        final MessageConsumer consumer = sessionFactory.createConsumer(consumerConfig);
        // subscribe topic
        consumer.subscribe(topic, 1024 * 1024, new MessageListener() {

            @Override
            public void recieveMessages(final Message message) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.