Package org.apache.kafka.clients.producer.internals

Examples of org.apache.kafka.clients.producer.internals.Sender.run()


                                   REQUEST_TIMEOUT_MS,
                                   new Metrics(),
                                   time);
        // do a successful retry
        Future<RecordMetadata> future = accumulator.append(tp, "key".getBytes(), "value".getBytes(), CompressionType.NONE, null).future;
        sender.run(time.milliseconds()); // connect
        sender.run(time.milliseconds()); // send produce request
        assertEquals(1, client.inFlightRequestCount());
        client.disconnect(client.requests().peek().request().destination());
        assertEquals(0, client.inFlightRequestCount());
        sender.run(time.milliseconds()); // receive error
View Full Code Here


                                   new Metrics(),
                                   time);
        // do a successful retry
        Future<RecordMetadata> future = accumulator.append(tp, "key".getBytes(), "value".getBytes(), CompressionType.NONE, null).future;
        sender.run(time.milliseconds()); // connect
        sender.run(time.milliseconds()); // send produce request
        assertEquals(1, client.inFlightRequestCount());
        client.disconnect(client.requests().peek().request().destination());
        assertEquals(0, client.inFlightRequestCount());
        sender.run(time.milliseconds()); // receive error
        sender.run(time.milliseconds()); // reconnect
View Full Code Here

        sender.run(time.milliseconds()); // connect
        sender.run(time.milliseconds()); // send produce request
        assertEquals(1, client.inFlightRequestCount());
        client.disconnect(client.requests().peek().request().destination());
        assertEquals(0, client.inFlightRequestCount());
        sender.run(time.milliseconds()); // receive error
        sender.run(time.milliseconds()); // reconnect
        sender.run(time.milliseconds()); // resend
        assertEquals(1, client.inFlightRequestCount());
        int offset = 0;
        client.respond(produceResponse(tp.topic(), tp.partition(), offset, Errors.NONE.code()));
View Full Code Here

        sender.run(time.milliseconds()); // send produce request
        assertEquals(1, client.inFlightRequestCount());
        client.disconnect(client.requests().peek().request().destination());
        assertEquals(0, client.inFlightRequestCount());
        sender.run(time.milliseconds()); // receive error
        sender.run(time.milliseconds()); // reconnect
        sender.run(time.milliseconds()); // resend
        assertEquals(1, client.inFlightRequestCount());
        int offset = 0;
        client.respond(produceResponse(tp.topic(), tp.partition(), offset, Errors.NONE.code()));
        sender.run(time.milliseconds());
View Full Code Here

        assertEquals(1, client.inFlightRequestCount());
        client.disconnect(client.requests().peek().request().destination());
        assertEquals(0, client.inFlightRequestCount());
        sender.run(time.milliseconds()); // receive error
        sender.run(time.milliseconds()); // reconnect
        sender.run(time.milliseconds()); // resend
        assertEquals(1, client.inFlightRequestCount());
        int offset = 0;
        client.respond(produceResponse(tp.topic(), tp.partition(), offset, Errors.NONE.code()));
        sender.run(time.milliseconds());
        assertTrue("Request should have retried and completed", future.isDone());
View Full Code Here

        sender.run(time.milliseconds()); // reconnect
        sender.run(time.milliseconds()); // resend
        assertEquals(1, client.inFlightRequestCount());
        int offset = 0;
        client.respond(produceResponse(tp.topic(), tp.partition(), offset, Errors.NONE.code()));
        sender.run(time.milliseconds());
        assertTrue("Request should have retried and completed", future.isDone());
        assertEquals(offset, future.get().offset());

        // do an unsuccessful retry
        future = accumulator.append(tp, "key".getBytes(), "value".getBytes(), CompressionType.NONE, null).future;
View Full Code Here

        assertTrue("Request should have retried and completed", future.isDone());
        assertEquals(offset, future.get().offset());

        // do an unsuccessful retry
        future = accumulator.append(tp, "key".getBytes(), "value".getBytes(), CompressionType.NONE, null).future;
        sender.run(time.milliseconds()); // send produce request
        for (int i = 0; i < maxRetries + 1; i++) {
            client.disconnect(client.requests().peek().request().destination());
            sender.run(time.milliseconds()); // receive error
            sender.run(time.milliseconds()); // reconnect
            sender.run(time.milliseconds()); // resend
View Full Code Here

        // do an unsuccessful retry
        future = accumulator.append(tp, "key".getBytes(), "value".getBytes(), CompressionType.NONE, null).future;
        sender.run(time.milliseconds()); // send produce request
        for (int i = 0; i < maxRetries + 1; i++) {
            client.disconnect(client.requests().peek().request().destination());
            sender.run(time.milliseconds()); // receive error
            sender.run(time.milliseconds()); // reconnect
            sender.run(time.milliseconds()); // resend
        }
        sender.run(time.milliseconds());
        completedWithError(future, Errors.NETWORK_EXCEPTION);
View Full Code Here

        future = accumulator.append(tp, "key".getBytes(), "value".getBytes(), CompressionType.NONE, null).future;
        sender.run(time.milliseconds()); // send produce request
        for (int i = 0; i < maxRetries + 1; i++) {
            client.disconnect(client.requests().peek().request().destination());
            sender.run(time.milliseconds()); // receive error
            sender.run(time.milliseconds()); // reconnect
            sender.run(time.milliseconds()); // resend
        }
        sender.run(time.milliseconds());
        completedWithError(future, Errors.NETWORK_EXCEPTION);
    }
View Full Code Here

        sender.run(time.milliseconds()); // send produce request
        for (int i = 0; i < maxRetries + 1; i++) {
            client.disconnect(client.requests().peek().request().destination());
            sender.run(time.milliseconds()); // receive error
            sender.run(time.milliseconds()); // reconnect
            sender.run(time.milliseconds()); // resend
        }
        sender.run(time.milliseconds());
        completedWithError(future, Errors.NETWORK_EXCEPTION);
    }
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.