Package com.taobao.metamorphosis.client.consumer.SimpleFetchManager

Examples of com.taobao.metamorphosis.client.consumer.SimpleFetchManager.FetchRequestRunner.processRequest()


                new FetchRequest(broker, this.consumerConfig.getMaxDelayFetchTimeInMills() / 10,
                    new TopicPartitionRegInfo(topic, partition, offset, 1111), maxSize);
        newRequest.incrementRetriesAndGet();

        EasyMock.replay(this.consumer);
        runner.processRequest(request);
        EasyMock.verify(this.consumer);
        assertEquals(newRequest, this.fetchManager.takeFetchRequest());
    }

View Full Code Here


                new FetchRequest(broker, this.consumerConfig.getMaxDelayFetchTimeInMills() / 10,
                    new TopicPartitionRegInfo(topic, partition, offset, 1111), maxSize);
        newRequest.incrementRetriesAndGet();

        EasyMock.replay(this.consumer);
        runner.processRequest(request);
        EasyMock.verify(this.consumer);
        assertEquals(newRequest, this.fetchManager.takeFetchRequest());
    }

View Full Code Here

                    new TopicPartitionRegInfo(topic, partition, offset), newMaxSize);
        newRequest.incrementRetriesAndGet();
        newRequest.incrementRetriesAndGet();

        EasyMock.replay(this.consumer);
        runner.processRequest(request);
        EasyMock.verify(this.consumer);
        assertEquals(newRequest, this.fetchManager.takeFetchRequest());
    }
}
View Full Code Here

        final FetchRequest newRequest =
                new FetchRequest(broker, 0, new TopicPartitionRegInfo(topic, partition, offset + data.length, msgId),
                    maxSize);

        EasyMock.replay(this.consumer);
        runner.processRequest(request);
        EasyMock.verify(this.consumer);
        assertEquals("hello", new String(msg.get().getData()));
        assertEquals(msgId, msg.get().getId());
        assertEquals(topic, msg.get().getTopic());
        assertEquals(newRequest, this.fetchManager.takeFetchRequest());
View Full Code Here

        final FetchRequest newRequest =
                new FetchRequest(broker, 0, new TopicPartitionRegInfo(topic, partition, offset + data.length, msgId),
                    maxSize);

        EasyMock.replay(this.consumer);
        runner.processRequest(request);
        EasyMock.verify(this.consumer);
        assertEquals("hello", new String(msg.get().getData()));
        assertEquals(msgId, msg.get().getId());
        assertEquals(topic, msg.get().getTopic());
        assertEquals(newRequest, this.fetchManager.takeFetchRequest());
View Full Code Here

                return false;
            }
        });
        EasyMock.expect(this.consumer.getConsumerConfig()).andReturn(new ConsumerConfig("test"));
        EasyMock.replay(this.consumer);
        runner.processRequest(request);
        EasyMock.verify(this.consumer);
        assertNull(msg.get());
    }

View Full Code Here

            }
        });
        EasyMock.expect(this.consumer.getConsumerConfig()).andReturn(new ConsumerConfig("test"));

        EasyMock.replay(this.consumer);
        runner.processRequest(request);
        EasyMock.verify(this.consumer);
        assertNull(msg.get());
    }

View Full Code Here

        // Use new offset
        final FetchRequest newRequest =
                new FetchRequest(broker, 0, new TopicPartitionRegInfo(topic, partition, newOffset, -1), maxSize);

        EasyMock.replay(this.consumer);
        runner.processRequest(request);
        EasyMock.verify(this.consumer);
        assertEquals(newRequest, this.fetchManager.takeFetchRequest());
    }

View Full Code Here

        final FetchRequest newRequest =
                new FetchRequest(broker, 0, new TopicPartitionRegInfo(topic, partition, offset + data.length, 1111),
                    maxSize);

        EasyMock.replay(this.consumer);
        runner.processRequest(request);
        EasyMock.verify(this.consumer);
        // retry������
        assertEquals(0, request.getRetries());
        assertEquals(newRequest, this.fetchManager.takeFetchRequest());
    }
View Full Code Here

        final FetchRequest newRequest =
                new FetchRequest(broker, this.consumerConfig.getMaxDelayFetchTimeInMills() / 10,
                    new TopicPartitionRegInfo(topic, partition, offset), maxSize);

        EasyMock.replay(this.consumer);
        runner.processRequest(request);
        EasyMock.verify(this.consumer);
        assertEquals(newRequest, this.fetchManager.takeFetchRequest());
    }

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.