Browsed by
Category: Csv

How To Make a Custom NiFi Processor

How To Make a Custom NiFi Processor

I read a couple of forum posts(link1, link2) about converting CSV data to JSON with Apache NiFi. There are already solutions proposed for going from CSV to JSON in both of those links, one of which is writing your own Custom Processor. Since I already have code to convert data from CSV to JSON (see my post), I decided to write a NiFi Processor to accomplish the same thing. This blog entry will show how that was done. NiFi has a guide for developers reviewing several…

Read More Read More

Jackson based JAX-RS Providers(JSON, XML, CSV) Example

Jackson based JAX-RS Providers(JSON, XML, CSV) Example

This blog post discusses returning multiple data formats from your RESTFul endpoints using Jackson JAX-RS providers. Jackson provides a lot of providers that you can see here . The providers allow you to return a POJO(plain old java object) from your REST annotated methods and give back the appropriate media type. Jackson also gives you the ability make your own Entity Providers. Documentation for how to do that is here below I’ll show a generic way to provide CSV’s along with XML…

Read More Read More

An Example CSV to Mongo Dataflow

An Example CSV to Mongo Dataflow

Do you have a bunch of CSV files laying around that you’d like to be able to run queries against? This post is going to discuss a way to do that with Apache Camel and a processor I wrote. Prerequisites: Ability to run a mvn camel:run A MongoDB installation available Technologies used: Apache Camel Maven MongoDB Wrote a Custom camel processor to take in a CSV file and turn it into JSON. Jackson was my tool of choice for converting…

Read More Read More

JSON to CSV with Jackson

JSON to CSV with Jackson

Needed to convert some JSON output to CSV this week on one of my REST endpoints. Previously on this endpoint I was using Gson to do the conversion. Gson does not natively support JSON to CSV conversion. So though I love how easy it is for me to type: [code language=”java”] Gson gson = new Gson(); gson.toJson("Hello World"); [/code] and easily retrtieve my Json. I switched over to using Jackson because it does support CSV conversion of my Pojos as…

Read More Read More