Camel JSON Endpoint?

Solution Unverified - Updated -

Issue

How to expose my data from csv file to web JSON driven client?

I think I need 2 routes:

  1. from("file").unmarshal().csv()
  2. from("jetty").unmarshal().json(JsonLibrary.Gson)

Is there better way to expose csv?
How do I chain those 2 routes? Should I add Singleton myBean that would keep list of rows as result of my route #1, to be able use it for reply for Jetty in route #2

There is Jettison, but I'm not aware how to use it in Camel.
Is Jettison better over Jetty endpoint?

I don't want to read CSV for every jetty / http request, but load the csv in memory and let jetty route to read from that memory?

Additionally, if the CSV large - how to do it via stream? to not do processing for whole content.

Environment

Fuse ESB Enterprise 7.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.