cloudevents / cloudevents/sdk-java
CloudEventHttpMessageConverter can't convert List<CloudEvent>
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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