Ok, I see the issue after testing it wit your data

You probably did not specify the schema when configuring the ConvertAvroToJson 
processor and because of that you were most likely getting the following error:

[pool-1-thread-1] ERROR org.apache.nifi.processors.avro.ConvertAvroToJSON - 
ConvertAvroToJSON[id=84a6c68c-0064-40a1-9431-80ff35fbc7d3] Failed to convert 
FlowFile[0,147497938581519.mockFlowFile,14B] from Avro to JSON due to 
org.apache.nifi.processor.exception.ProcessException: java.io.IOException: Not 
a data file.; transferring to failure: 
org.apache.nifi.processor.exception.ProcessException: java.io.IOException: Not 
a data file.

So my first question; Do you see the same error in the logs? (just want to 
confirm that you do)

In any event, ConvertAvroToJson has the “Schema” configuration property. Simply 
pass your schema as value to this property (e.g., “{ "namespace": 
"mynamespace.com<http://mynamespace.com/>", "type": "record", "name": 
"TEST_DATA1", "fields": [ {"name": "ENAME", "type": "string"} ] }”)

Cheers
Oleg


On Dec 22, 2016, at 1:49 PM, Oleg Zhurakousky 
<[email protected]<mailto:[email protected]>> wrote:

Malini

Indeed that is a strange.
Would you mind looking at the logs to see if there are any exceptions/errors 
generated form ConvertAvroToJson? Meanwhile I’ll run some tests with your data.

Cheers
Oleg

On Dec 22, 2016, at 1:37 PM, Malini Shetty 
<[email protected]<mailto:[email protected]>> wrote:

Hi,
GetKafka processor is returning success message and data can be viewed in hex 
format. Next processor called is ConvertAvroToJson is returning blank string, 
while Kafka confluent is able to convert the avro binary data into Json format.

DB2 data is streamed thru CDC to Kafka, schema used in ConvertAvroToJson is


{ "namespace": "mynamespace.com<http://mynamespace.com/>", "type": "record", 
"name": "TEST_DATA1", "fields": [ {"name": "ENAME", "type": "string"} ] }

Can you please help to understand why ConvertAvrotoJson is returning blank 
string?

I have used Putfile processor after GetKafka. Attached is the format and the 
string returned using ConvertAvroToJson is blank.

Regards
Malini Shetty

<10677-hprojectodsdevbinaryavro.zip>


Reply via email to