use of org.apache.kafka.streams.errors.LogAndContinueExceptionHandler in project apache-kafka-on-k8s by banzaicloud.
the class GlobalStateTaskTest method shouldNotThrowStreamsExceptionWhenValueDeserializationFails.
@Test
public void shouldNotThrowStreamsExceptionWhenValueDeserializationFails() throws Exception {
final GlobalStateUpdateTask globalStateTask2 = new GlobalStateUpdateTask(topology, context, stateMgr, new LogAndContinueExceptionHandler(), logContext);
final byte[] key = new IntegerSerializer().serialize(topic2, 1);
final byte[] recordValue = new LongSerializer().serialize(topic2, 10L);
maybeDeserialize(globalStateTask2, key, recordValue, false);
}
use of org.apache.kafka.streams.errors.LogAndContinueExceptionHandler in project apache-kafka-on-k8s by banzaicloud.
the class RecordQueueTest method shouldDropOnNegativeTimestamp.
@Test
public void shouldDropOnNegativeTimestamp() {
final List<ConsumerRecord<byte[], byte[]>> records = Collections.singletonList(new ConsumerRecord<>("topic", 1, 1, -1L, TimestampType.CREATE_TIME, 0L, 0, 0, recordKey, recordValue));
final RecordQueue queue = new RecordQueue(new TopicPartition(topics[0], 1), new MockSourceNode<>(topics, intDeserializer, intDeserializer), new LogAndSkipOnInvalidTimestamp(), new LogAndContinueExceptionHandler(), null, new LogContext());
queue.addRawRecords(records);
assertEquals(0, queue.size());
}
use of org.apache.kafka.streams.errors.LogAndContinueExceptionHandler in project kafka by apache.
the class GlobalStateTaskTest method shouldNotThrowStreamsExceptionWhenKeyDeserializationFailsWithSkipHandler.
@Test
public void shouldNotThrowStreamsExceptionWhenKeyDeserializationFailsWithSkipHandler() {
final GlobalStateUpdateTask globalStateTask2 = new GlobalStateUpdateTask(logContext, topology, context, stateMgr, new LogAndContinueExceptionHandler());
final byte[] key = new LongSerializer().serialize(topic2, 1L);
final byte[] recordValue = new IntegerSerializer().serialize(topic2, 10);
maybeDeserialize(globalStateTask2, key, recordValue, false);
}
use of org.apache.kafka.streams.errors.LogAndContinueExceptionHandler in project apache-kafka-on-k8s by banzaicloud.
the class GlobalStateTaskTest method shouldNotThrowStreamsExceptionWhenKeyDeserializationFailsWithSkipHandler.
@Test
public void shouldNotThrowStreamsExceptionWhenKeyDeserializationFailsWithSkipHandler() throws Exception {
final GlobalStateUpdateTask globalStateTask2 = new GlobalStateUpdateTask(topology, context, stateMgr, new LogAndContinueExceptionHandler(), logContext);
final byte[] key = new LongSerializer().serialize(topic2, 1L);
final byte[] recordValue = new IntegerSerializer().serialize(topic2, 10);
maybeDeserialize(globalStateTask2, key, recordValue, false);
}
use of org.apache.kafka.streams.errors.LogAndContinueExceptionHandler in project apache-kafka-on-k8s by banzaicloud.
the class RecordQueueTest method shouldThrowOnNegativeTimestamp.
@Test(expected = StreamsException.class)
public void shouldThrowOnNegativeTimestamp() {
final List<ConsumerRecord<byte[], byte[]>> records = Collections.singletonList(new ConsumerRecord<>("topic", 1, 1, -1L, TimestampType.CREATE_TIME, 0L, 0, 0, recordKey, recordValue));
final RecordQueue queue = new RecordQueue(new TopicPartition(topics[0], 1), new MockSourceNode<>(topics, intDeserializer, intDeserializer), new FailOnInvalidTimestamp(), new LogAndContinueExceptionHandler(), null, new LogContext());
queue.addRawRecords(records);
}
Aggregations