whiver / nifi-protobuf-processor

An Apache NiFi processor to encode and decode data using Google Protocol Buffer schemas.
MIT License
36 stars 20 forks source link

Unable to find the message in protobuf.messageType, Unable to decode data . #9

Closed ghost closed 3 years ago

ghost commented 3 years ago

I am trying out a simple flow in Nifi which converts a JSON data into Protobuf type.

Here is the flow which I tried:

Generate flow file(contains json message) --> Protobuf Encoder --> Putfile

These are the configurations of ProtobufEncoder: image

As shown in the above picture, I am passing a compiled schema file in the schema path property and I set the compile schema property to false. But the flow files are routing to error queue saying,

Unable to find the message in protobuf.messageType, Unable to decode data.

Please suggest me the changes need to be done at configurations. Appreciate your help!!

dracomithril commented 3 years ago

I was able to find solution for that you need to place UpdateAttribute processor before ProtobufDecoder and add there attribute protobuf.messageType that correlates with your schema. Now the thing that is happening to me is that JSON contains only one property id with long string :(

But I hope that this will help you

ghost commented 3 years ago

I was able to find solution for that you need to place UpdateAttribute processor before ProtobufDecoder and add there attribute protobuf.messageType that correlates with your schema. Now the thing that is happening to me is that JSON contains only one property id with long string :(

But I hope that this will help you

Thank you! it worked ..