-
-
Notifications
You must be signed in to change notification settings - Fork 84
Closed
Description
ArcadeDB Version: v23.1.2-SNAPSHOT (build 45102bd/1674545889139/main)
JDK Version: openjdk 11.0.12 2021-07-20 LTS
OS: CentOS release 6.9 (Final)
Expected behavior
Custom handlers continue to work as before
Actual behavior
Custom handlers are not invoked: the server returns a 404 response for any request sent to the endpoint configured for a custom handler
Steps to reproduce
- Create a class that implements the ServerPlugin interface
- Follow the instructions contained in the ArcadeDB manual to implement the registerAPI method
- Follow the instructions contained in the ArcadeDB manual to create a custom Http Handler
- start the server
- send a request to the endpoint configured in the custom handler
- verify that the server responds with a 404
This is the test plugin I have used:
public class OrchestratorPlugin implements ServerPlugin {
@Override
public void startService() {
}
@Override
public void registerAPI(HttpServer httpServer, final PathHandler routes) {
final RoutingHandler orchestratorRoutes = Handlers.routing();
routes.addPrefixPath("/orchestrator", orchestratorRoutes.get("/test", new TestHandler(httpServer)));
}
}
This is the test Http Handler I have used:
public class TestHandler extends AbstractHandler {
public TestHandler(HttpServer httpServer) {
super(httpServer);
}
@Override
protected void execute(HttpServerExchange exchange, ServerSecurityUser user) throws Exception {
exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/json");
JSONObject jsonObject = new JSONObject();
jsonObject.put("result", "ok");
String body = jsonObject.toString();
exchange.setStatusCode(200);
exchange.getResponseSender().send(body);
}
The log messages show that the plugin has been loaded, but when I send the following request:
http://192.168.163.128:8080/orchestrator/test
I get a 404 response.
The server correctly returns my static content (placed on the classpath), which is handled by the fallback handler. The following request:
http://192.168.163.128:8080/supervisor
is handled correctly (the html page is displayed).
Requests sent to the configured prefix (in my case "/orchestrator") are not handled
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working