FasterXML / FasterXML/jackson-dataformats-text

Async (non-blocking) support for CSV

Open
#287 8 comments 1 reaction 0 assignees View on GitHub
csv
Dominant language
Java
Stars
455
Forks
164
Avg merge
6d 10h
Merged PRs (30d)
2

Description

This question relates to usage of Jackson DataFormats CSV within Spring WebFlux.

I have a REST controller (Spring WebFlux) which returns a Flux from a Stream of a simple bean (MapInfo). The endpoint serves application/json (only for demo) and application/x-ndjson (for large datasets). I'd like to add support for text/csv also.

```
@GetMapping(produces = { "application/json", "application/x-ndjson", "text/csv" })
public Flux mapInfo() {
return Flux.fromStream(mapInfoStream());
}
```

Invoking this for text/csv results in HTTP 500 with message:
`"No Encoder for [com.mizuho.fo.dataservices.hc.controller.MapInfoController$MapInfo] with preset Content-Type 'null'"`

**I have not yet added any Jackson Dataformat libraries so this is expected.**

Question: Does Jackson Dataformat CSV have the necessary non-blocking support in order for it to be used to convert the payload to CSV?

Of course I could be imperative and write code to format as CSV, returning a Flux of String for instance, but my hope is to effect CSV output without lowering the abstraction level beyond what is already there (returning a Flux from a Stream of the POJO).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.