use of io.confluent.kafka.serializers.protobuf.KafkaProtobufDeserializer in project ksql by confluentinc.
the class KsqlProtobufSerializerTest method setup.
@Before
public void setup() {
final ImmutableMap<String, Object> configs = ImmutableMap.of(AbstractKafkaSchemaSerDeConfig.AUTO_REGISTER_SCHEMAS, true, AbstractKafkaSchemaSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG, "");
deserializer = new KafkaProtobufDeserializer(schemaRegistryClient, configs);
}
use of io.confluent.kafka.serializers.protobuf.KafkaProtobufDeserializer in project ksql by confluentinc.
the class RecordFormatter method newProtobufDeserializer.
private static Deserializer<?> newProtobufDeserializer(final SchemaRegistryClient srClient) {
final Printer printer = TextFormat.printer();
final KafkaProtobufDeserializer<?> inner = new KafkaProtobufDeserializer<>(srClient);
return (topic, data) -> {
final Message msg = inner.deserialize(topic, data);
if (msg == null) {
return null;
}
return printer.shortDebugString(msg);
};
}
Aggregations