cloudevents / cloudevents/sdk-java

CloudEventHttpMessageConverter can't convert List<CloudEvent>

Open
#659 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
446
Forks
172
PR merge metrics
No merged PRs in 30d

Description

I’m trying to add an endpoint to my Spring app for batch ingestion of CloudEvents, but CloudEventHttpMessageConverter isn’t playing nice. It won’t convert to List.

What I Did
Built a Spring Boot app.
Added a REST endpoint to accept a batch of CloudEvents.
Set up CloudEventHttpMessageConverter for the conversion.
Sent a batch of CloudEvents to the endpoint.

What I Expected
I expected the converter to turn the HTTP request into a List.

What’s Actually Happening
It’s not working. The converter is failing and throwing an error instead of doing the conversion.

@RestController
public class CloudEventController {

    @PostMapping("/ingest")
    public ResponseEntity<String> ingestBatch(@RequestBody List<CloudEvent> events) {
        // Processing logic
        return ResponseEntity.ok("Batch ingested successfully");
    }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Spring endpoint using CloudEventHttpMessageConverter and a request containing a batch of CloudEvents. Inspect the converter's handling of the List request and capture the conversion error. Done means the endpoint accepts the batch and produces a List instead of failing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.