You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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");
}
}
Activity
beyond007jj commentedon Aug 22, 2024
I've encountered the same issue. Have you resolved it?
capmorganbih commentedon Aug 27, 2024
@beyond007jj it's not supported by the SDK. The best you can do is implement your own spring converter for json + batch