Error: no such Type or Enum 'google.protobuf.Timestamp'

570 Views Asked by At

I am using NodeJs service with Confluent Kafka Schema registry and library @kafkajs/confluent-schema-registry . There is other Golang service which produces message to Kafka topic using proto and register the schema with Schema Registry with google timestamp as one of the field type. Since version 7.x of confluent cloud natively support google timestamp so there is no issue in producing the message. But when nodejs service try to consume message it throws the error

"stack":"Error: no such Type or Enum 'google.protobuf.Timestamp' in Type .coindcx.mdn.candle.v1.CandleRequest\n at Type.lookupTypeOrEnum (/Users/deepak.kumar/Desktop/Github repos/mercury-socket-interface/node_modules/protobufjs/src/namespace.js:411:15)\n

I have explored the documentation of both protobufjs and confluent schema registry library but no luck. Also searched through stackoverflow. Found this relevant question with similar error but happening while encoding. There is no answer to that as well Fails to encode Proto payload containing a Timestamp field

1

There are 1 best solutions below

1
On

Unfortunately, it seems that this is a known issue with this library. Based on this issue: https://github.com/kafkajs/confluent-schema-registry/issues/152#issuecomment-927987105

it's also worth pointing out that the current implementation will not work at all for any protobuf which references another protobuf via an import statement, since it parses only the schema stored by the registry and not any schema referenced by that schema.