From f00619ba78ddcaad83009a265835b0f31245cfe6 Mon Sep 17 00:00:00 2001 From: croway Date: Fri, 4 Sep 2026 09:38:28 +0200 Subject: [PATCH 1/2] Fix rest-cxf example: resolve operation name header for dynamic bean dispatch CamelRouter routed on ${header.operationName}, a header CXF-RS never sets; DefaultCxfRsBinding populates CamelCxfOperationName instead, so the header resolved empty and every GET/PUT hit MethodNotFoundException (500). Only the bean-validation error path worked, since it short-circuits before the dynamic dispatch. Use ${header.CamelCxfOperationName}, and switch to recipientList to match the idiom documented in the cxfrs component docs and already used by the sibling soap-cxf example, instead of toD. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01JvQJNT1UYzqUm5HQtkL6Nu --- .../org/apache/camel/example/springboot/cxf/CamelRouter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest-cxf/src/main/java/org/apache/camel/example/springboot/cxf/CamelRouter.java b/rest-cxf/src/main/java/org/apache/camel/example/springboot/cxf/CamelRouter.java index a18ce18ec..49af0d0d1 100644 --- a/rest-cxf/src/main/java/org/apache/camel/example/springboot/cxf/CamelRouter.java +++ b/rest-cxf/src/main/java/org/apache/camel/example/springboot/cxf/CamelRouter.java @@ -43,7 +43,7 @@ public void configure() throws Exception { "&loggingFeatureEnabled=true") .to("bean-validator:user") .to("log:camel-cxf-log?showAll=true") - .toD("bean:userServiceImpl?method=${header.operationName}"); + .recipientList(simple("bean:userServiceImpl?method=${header.CamelCxfOperationName}")); // @formatter:on } From 9611e39536a8237a941b6594fe05f1504427d843 Mon Sep 17 00:00:00 2001 From: croway Date: Fri, 4 Sep 2026 09:45:30 +0200 Subject: [PATCH 2/2] Use toD instead of recipientList for single dynamic bean dispatch recipientList is designed for multicasting to potentially several recipients; here there is exactly one computed destination per exchange, which is exactly what toD is for. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01JvQJNT1UYzqUm5HQtkL6Nu --- .../org/apache/camel/example/springboot/cxf/CamelRouter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest-cxf/src/main/java/org/apache/camel/example/springboot/cxf/CamelRouter.java b/rest-cxf/src/main/java/org/apache/camel/example/springboot/cxf/CamelRouter.java index 49af0d0d1..86964885d 100644 --- a/rest-cxf/src/main/java/org/apache/camel/example/springboot/cxf/CamelRouter.java +++ b/rest-cxf/src/main/java/org/apache/camel/example/springboot/cxf/CamelRouter.java @@ -43,7 +43,7 @@ public void configure() throws Exception { "&loggingFeatureEnabled=true") .to("bean-validator:user") .to("log:camel-cxf-log?showAll=true") - .recipientList(simple("bean:userServiceImpl?method=${header.CamelCxfOperationName}")); + .toD("bean:userServiceImpl?method=${header.CamelCxfOperationName}"); // @formatter:on }