Implement YANG Kafka Integration - #11
Conversation
| id = ByteBuffer.wrap(serializedSchemaId).getInt(); | ||
| } else { | ||
| id = Integer.parseInt(new String(serializedSchemaId, StandardCharsets.UTF_8)); | ||
| } |
There was a problem hiding this comment.
thanks for the updates, if we fix it here (in json deserializer), it would be great also to do so in cbor part (e.g. please refer to here) just to keep consistency..
| return null; | ||
| } catch (RestClientException e) { | ||
| throw toKafkaException(e, "Error retrieving YANG schema for id " + id); | ||
| log.error("Error retrieving YANG schema for id {}: {}", id, e.getMessage(), e); |
There was a problem hiding this comment.
existing parts are throwing exceptions explicitly, and here we change everything into implicit logging and returning null.
from my view, it's ok to have such change temporarily while debug in local, however, it would be still elegant to remain as it is in the lib itself (i.e. keep the exception throwing out), so that no malformatted message (or any edge cases) will be missed out in application on top of it.
If you need to let your app continue next message without being broken, maybe also try things like try..catch.. in the app level (e.g. while polling a message from kafka, or consume directly kafka message as byte[] then call deserializer explitictly)
This PR implements the YANG Kafka integration as requested.