Browsed by
Category: Java

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