Skip to content

CloudEventHttpMessageConverter can't convert List<CloudEvent> #659

Open
@capmorganbih

Description

@capmorganbih

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");
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions