Package kafka.serializer

Examples of kafka.serializer.DefaultDecoder


     * @param processor the {@link StreamProcessor} to process the stream with.
     * @return a {@link KafkaConsumerBuilder} to build a {@link KafkaConsumer} for the given
     *         processor.
     */
    public KafkaConsumerBuilder<Message> processWith(final StreamProcessor<Message> processor) {
        return processWith(new DefaultDecoder(), processor);
    }
View Full Code Here


    @Test
    public void testCreatingKafkaExchangeSetsHeaders() throws URISyntaxException {
        KafkaEndpoint endpoint = new KafkaEndpoint("kafka:localhost", "localhost", new KafkaComponent());

        Message message = new Message("mymessage".getBytes(), "somekey".getBytes());
        DefaultDecoder decoder = new DefaultDecoder(null);
        MessageAndMetadata<byte[], byte[]> mm =
                new MessageAndMetadata<byte[], byte[]>("topic", 4, message, 56, decoder, decoder);

        Exchange exchange = endpoint.createKafkaExchange(mm);
        assertEquals("somekey", exchange.getIn().getHeader(KafkaConstants.KEY));
View Full Code Here

     * @param processor the {@link StreamProcessor} to process the stream with
     * @return          a {@link KafkaConsumerBuilder} to build a
     *                  {@link KafkaConsumer} for the given processor
     */
    public KafkaConsumerBuilder<Message> processWith(final StreamProcessor<Message> processor) {
        return processWith(new DefaultDecoder(), processor);
    }
View Full Code Here

     * @param processor the {@link StreamProcessor} to process the stream with.
     * @return a {@link KafkaConsumerBuilder} to build a {@link KafkaConsumer} for the given
     *         processor.
     */
    public KafkaConsumerBuilder<Message> processWith(final StreamProcessor<Message> processor) {
        return processWith(new DefaultDecoder(), processor);
    }
View Full Code Here

        StreamProcessor processor = Mockito.mock(StreamProcessor.class);
        Mockito.doThrow(new IllegalStateException()).when(processor).process(Mockito.any(Iterable.class), Mockito.anyString());
        final SynchronousConsumer consumer = new SynchronousConsumer(
                consumerConnector,
                configuration.getPartitions(),
                new DefaultDecoder(),
                processor,
                executor,
                configuration.getInitialRecoveryDelay(),
                configuration.getMaxRecoveryDelay(),
                configuration.getRetryResetDelay(),
View Full Code Here

        StreamProcessor processor = Mockito.mock(StreamProcessor.class);
        Mockito.doThrow(new RuntimeException()).doNothing().when(processor).process(Mockito.any(Iterable.class), Mockito.anyString());
        final SynchronousConsumer consumer = new SynchronousConsumer(
                consumerConnector,
                configuration.getPartitions(),
                new DefaultDecoder(),
                processor,
                executor,
                configuration.getInitialRecoveryDelay(),
                configuration.getMaxRecoveryDelay(),
                configuration.getRetryResetDelay(),
View Full Code Here

                doThrow(new RuntimeException()).
                doThrow(new RuntimeException()).when(processor).process(Mockito.any(Iterable.class), Mockito.anyString());
        final SynchronousConsumer consumer = new SynchronousConsumer(
                consumerConnector,
                configuration.getPartitions(),
                new DefaultDecoder(),
                processor,
                executor,
                configuration.getInitialRecoveryDelay(),
                configuration.getMaxRecoveryDelay(),
                configuration.getRetryResetDelay(),
View Full Code Here

        final boolean shutDownServerOnUnrecoverableError = true;
        Mockito.doThrow(new IllegalStateException()).when(processor).process(Mockito.any(Iterable.class), Mockito.anyString());
        final SynchronousConsumer consumer = new SynchronousConsumer(
                consumerConnector,
                configuration.getPartitions(),
                new DefaultDecoder(),
                processor,
                executor,
                configuration.getInitialRecoveryDelay(),
                configuration.getMaxRecoveryDelay(),
                configuration.getRetryResetDelay(),
View Full Code Here

                doThrow(new RuntimeException()).
                doThrow(new RuntimeException()).when(processor).process(Mockito.any(Iterable.class), Mockito.anyString());
        final SynchronousConsumer consumer = new SynchronousConsumer(
                consumerConnector,
                configuration.getPartitions(),
                new DefaultDecoder(),
                processor,
                executor,
                configuration.getInitialRecoveryDelay(),
                configuration.getMaxRecoveryDelay(),
                configuration.getRetryResetDelay(),
View Full Code Here

                doThrow(new RuntimeException()).
                doNothing().when(processor).process(Mockito.any(Iterable.class), Mockito.anyString());
        final SynchronousConsumer consumer = new SynchronousConsumer(
                consumerConnector,
                configuration.getPartitions(),
                new DefaultDecoder(),
                processor,
                executor,
                configuration.getInitialRecoveryDelay(),
                configuration.getMaxRecoveryDelay(),
                durationForResettingErrorHandlingState,
View Full Code Here

TOP

Related Classes of kafka.serializer.DefaultDecoder

Copyright © 2018 www.massapicom. 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.