Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"useGlobalSslContextParameters": { "index": 6, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }
},
"headers": {
"operationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
"operationNamespace": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation namespace.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAMESPACE" },
"CamelCxfOperationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
"CamelCxfOperationNamespace": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation namespace.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAMESPACE" },
"CamelDestinationOverrideUrl": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The destination override url", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#DESTINATION_OVERRIDE_URL" },
"ResponseContext": { "index": 3, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Map<String, Object>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The response context", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#RESPONSE_CONTEXT" },
"CamelAuthentication": { "index": 4, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "javax.security.auth.Subject", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The authentication", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#AUTHENTICATION" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"useGlobalSslContextParameters": { "index": 5, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }
},
"headers": {
"operationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
"CamelCxfOperationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
"CamelAuthentication": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "javax.security.auth.Subject", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The authentication", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#AUTHENTICATION" },
"CamelHttpMethod": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The http method to use", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#HTTP_METHOD" },
"CamelHttpPath": { "index": 3, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The http path", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#HTTP_PATH" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public final class CxfConstants {
public static final String PROTOCOL_NAME_RES = "res";

@Metadata(description = "The name of the operation.", javaType = "String")
public static final String OPERATION_NAME = "operationName";
public static final String OPERATION_NAME = "CamelCxfOperationName";
@Metadata(description = "The operation namespace.", javaType = "String", applicableFor = SCHEME_CXF)
public static final String OPERATION_NAMESPACE = "operationNamespace";
public static final String OPERATION_NAMESPACE = "CamelCxfOperationNamespace";
public static final String SPRING_CONTEXT_ENDPOINT = "bean:";
@Metadata(description = "The destination override url", javaType = "String", applicableFor = SCHEME_CXF)
public static final String DESTINATION_OVERRIDE_URL = Exchange.DESTINATION_OVERRIDE_URL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"useGlobalSslContextParameters": { "index": 5, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }
},
"headers": {
"operationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
"CamelCxfOperationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
"CamelAuthentication": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "javax.security.auth.Subject", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The authentication", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#AUTHENTICATION" },
"CamelHttpMethod": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The http method to use", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#HTTP_METHOD" },
"CamelHttpPath": { "index": 3, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The http path", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#HTTP_PATH" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Serviced by the following route:
[source,java]
--------------------------------------------------------------------------------------------
from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
.recipientList(simple("direct:${header.operationName}"));
.recipientList(simple("direct:${header.CamelCxfOperationName}"));

from("direct:newCustomer")
.log("Request: type=${header.type}, active=${header.active}, customerData=${body}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected RouteBuilder createRouteBuilder() throws Exception {
@Override
public void configure() {
from(CXF_RS_ENDPOINT_URI)
.recipientList(simple("direct:${header.operationName}"));
.recipientList(simple("direct:${header.CamelCxfOperationName}"));

from("direct:getCustomer").process(new Processor() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
from(CXF_RS_ENDPOINT_URI)
.recipientList(simple("direct:${header.operationName}"));
.recipientList(simple("direct:${header.CamelCxfOperationName}"));

from("direct:getCustomer").process(new Processor() {
public void process(Exchange exchange) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"useGlobalSslContextParameters": { "index": 6, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }
},
"headers": {
"operationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
"operationNamespace": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation namespace.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAMESPACE" },
"CamelCxfOperationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
"CamelCxfOperationNamespace": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation namespace.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAMESPACE" },
"CamelDestinationOverrideUrl": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The destination override url", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#DESTINATION_OVERRIDE_URL" },
"ResponseContext": { "index": 3, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Map<String, Object>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The response context", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#RESPONSE_CONTEXT" },
"CamelAuthentication": { "index": 4, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "javax.security.auth.Subject", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The authentication", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#AUTHENTICATION" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ As an alternative, you can add a message header for it as demonstrated in https:
You can configure the CXF endpoint with the Spring configuration file
shown below, and you can also embed the endpoint into the `camelContext`
tags. When you are invoking the service endpoint, you can set the
`operationName` and `operationNamespace` headers to explicitly state
`CamelCxfOperationName` and `CamelCxfOperationNamespace` headers to explicitly state
which operation you are calling.

[source,xml]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ private Object[] getParams(CxfEndpoint endpoint, Exchange exchange)
* null:
* </p>
* <ul>
* <li>Using the in message header "operationName".</li>
* <li>Using the in message header "CamelCxfOperationName".</li>
* <li>Using the defaultOperationName option value from the CxfEndpoint.</li>
* <li>Using the first operation which is find from the CxfEndpoint Operations list.</li>
* <ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected RouteBuilder createRouteBuilder() throws Exception {
@Override
public void configure() {
from(CXF_RS_ENDPOINT_URI)
.recipientList(simple("direct:${header.operationName}"));
.recipientList(simple("direct:${header.CamelCxfOperationName}"));

from("direct:getCustomer").process(new Processor() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
from(CXF_RS_ENDPOINT_URI)
.recipientList(simple("direct:${header.operationName}"));
.recipientList(simple("direct:${header.CamelCxfOperationName}"));

from("direct:getCustomer").process(new Processor() {
public void process(Exchange exchange) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import javax.xml.namespace.QName;

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.cxf.common.message.CxfConstants;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
Expand Down Expand Up @@ -68,8 +69,9 @@ protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
from("cxf:bean:routerEndpoint?synchronous=true&dataFormat=PAYLOAD")
.setHeader("operationNamespace", constant("http://camel.apache.org/cxf/jaxws/dispatch"))
.setHeader("operationName", constant("Invoke"))
.setHeader(CxfConstants.OPERATION_NAMESPACE,
constant("http://camel.apache.org/cxf/jaxws/dispatch"))
.setHeader(CxfConstants.OPERATION_NAME, constant("Invoke"))
.to("cxf:bean:serviceEndpoint?synchronous=true&dataFormat=PAYLOAD");
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,77 @@ outbound regex. Headers starting with `Camel` / `camel` (case-insensitive), `bre
component with the rest of the Camel component catalog. Routes that relied on receiving these
header names on inbound SNS messages can supply a custom `headerFilterStrategy` to restore the
previous behaviour.

=== camel-cxf

The Exchange header constants in `CxfConstants` (module `camel-cxf-common`, shared
by `camel-cxf` and `camel-cxfrs`) have been renamed to follow the Camel naming
convention used across the rest of the component catalog. The Java field names are
unchanged; only the header string values have changed:

[options="header"]
|===
| Constant | Previous value | New value
| `CxfConstants.OPERATION_NAME` | `operationName` | `CamelCxfOperationName`
| `CxfConstants.OPERATION_NAMESPACE` | `operationNamespace` | `CamelCxfOperationNamespace`
|===

Routes that reference the constant symbolically (for example
`setHeader(CxfConstants.OPERATION_NAME, ...)`) continue to work without changes.
Routes that set the header by its literal string value (for example
`setHeader("operationName", ...)`) must be updated to use the new value
(`setHeader("CamelCxfOperationName", ...)`).

In particular, the documented `cxfrs` `SimpleConsumer` dispatch idiom that routes
on the operation name by its literal header name must be updated:

[source,java]
----
// before
from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
.recipientList(simple("direct:${header.operationName}"));

// after
from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
.recipientList(simple("direct:${header.CamelCxfOperationName}"));
----

==== Behaviour change: cross-transport propagation of the operation header

Because the renamed header value now begins with `Camel`, it is filtered by the
standard transport `HeaderFilterStrategy` (`JmsHeaderFilterStrategy`,
`HttpHeaderFilterStrategy`, etc.) when crossing a transport boundary, by design
— `Camel*` headers are framework-internal and are not propagated over the wire.

Routes that bridge an external transport (JMS, HTTP, ...) into a `cxf:` producer
and select the SOAP operation from a header supplied by the sender must
therefore carry the operation in a non-`Camel`-prefixed application header and
map it to `CxfConstants.OPERATION_NAME` (`CamelCxfOperationName`) in the route
between the transport `from` and the `cxf:` `to`:

[source,xml]
----
<!-- before -->
<route>
<from uri="jms:queue:bridge.cxf"/>
<to uri="cxf://bean:serviceEndpoint"/>
</route>
<!-- caller sets the header keyed by the pre-rename value:
setHeader("operationName", "greetMe") -->

<!-- after -->
<route>
<from uri="jms:queue:bridge.cxf"/>
<setHeader name="CamelCxfOperationName">
<simple>${header.operationName}</simple>
</setHeader>
<to uri="cxf://bean:serviceEndpoint"/>
</route>
<!-- caller sets a non-Camel-prefixed application carrier header (any name
that is not stripped by the transport HeaderFilterStrategy works);
the route restores the CXF operation header after the transport hop. -->
----

The same pattern applies to HTTP-based bridges (`platform-http`/`jetty`/`netty
-http`/`http` -> `cxf:`) and any other transport whose default
`HeaderFilterStrategy` filters `Camel*` headers.
Original file line number Diff line number Diff line change
Expand Up @@ -2653,10 +2653,10 @@ public static class CxfHeaderNameBuilder {
*
* Group: common
*
* @return the name of the header {@code operationName}.
* @return the name of the header {@code CxfOperationName}.
*/
public String operationName() {
return "operationName";
public String cxfOperationName() {
return "CamelCxfOperationName";
}
/**
* The operation namespace.
Expand All @@ -2665,10 +2665,10 @@ public String operationName() {
*
* Group: common
*
* @return the name of the header {@code operationNamespace}.
* @return the name of the header {@code CxfOperationNamespace}.
*/
public String operationNamespace() {
return "operationNamespace";
public String cxfOperationNamespace() {
return "CamelCxfOperationNamespace";
}
/**
* The destination override url.
Expand Down
Loading
Loading