quarkiverse / quarkus-dapr

The Distributed Application Runtime (Dapr) provides APIs that simplify microservice connectivity
https://dapr.io/
Apache License 2.0
30 stars 16 forks source link

Conflict with class @Path("/") and method with @Path("/events") #159

Closed mcruzdev closed 1 week ago

mcruzdev commented 7 months ago

Error:


ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to //events failed

Java class to reproduce:

package dev.matheuscruz.product;

import io.dapr.Topic;
import io.dapr.client.domain.CloudEvent;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;

@Path("/")
public class ProductCreatedHandler {

    @POST
    @Topic(name = "products.new", pubsubName = "pubsub")
    @Path("/events")
    public void handle(CloudEvent<String> event) {
        System.out.println("Received: " + event.getData());
    }

    @GET
    @Path("/hello")
    public String hello() {
        return "hello";
    }
}