I have an HTTP endpoint that directly consume CloudEvents
For example
@Path("/events")
public class EventResource {
@Inject
ObjectMapper mapper;
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/pureCE")
public EventDTO pureCloudEventPayload(@Valid CloudEvent event) {
if (event == null || event.getData() == null) {
throw new BadRequestException("Invalid data received. Null or empty event");
}
return EventDTO.fromCloudEvent(mapper, event);
}
EventDTO
@RegisterForReflection
public class EventDTO implements Serializable {
private static final long serialVersionUID = 1305278483346223763L;
public static EventDTO fromCloudEvent(ObjectMapper mapper, CloudEvent cloudEvent) {
return PojoCloudEventDataMapper
.from(mapper, EventDTO.class)
.map(cloudEvent.getData())
.getValue();
}
@NotNull(message = "Call UUID value should be not null")
@NotBlank(message = "Call UUID may not be blank")
private String callUUID;
@NotNull(message = "Timestamp value should be not null")
@NotBlank(message = "Timestamp may not be blank")
private String timestamp;
@NotNull(message = "Service UUID value should be not null")
@NotBlank(message = "Service UUID may not be blank")
private String serviceUUID;
@NotNull(message = "IP Address value should be not null")
@NotBlank(message = "IP Address may not be blank")
private String ipAddress;
private String message;
.
. // getters & setters
.
.
public CloudEventData toCloudEventData(ObjectMapper mapper) {
return PojoCloudEventData.wrap(this, mapper::writeValueAsBytes);
}
Also the Hibernate-validation annotations doesn't look that are working with HTTP CloudEvents.
I saw that other extensions as Funqy or Kafka has a clear integration with CloudEvents. But has Quarkus-resteasy (classic or reactive) an integration with cloudEvents?
Describe the bug
I have an HTTP endpoint that directly consume CloudEvents
For example
EventDTO
Request example through rest assurance
And What I see is that Quarkus are missing the following artifacts on Quarkus BOM
Also the
Hibernate-validation
annotations doesn't look that are working with HTTP CloudEvents.I saw that other extensions as Funqy or Kafka has a clear integration with CloudEvents. But has Quarkus-resteasy (classic or reactive) an integration with cloudEvents?
How to Reproduce?
git clone -b GH-29208 https://github.com/pjgg/quarkus-test-suite.git
cd quarkus-test-suite/http/http-cloud-events
mvn clean verify