You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Peter Palaga (Jira)" <ji...@apache.org> on 2022/12/01 21:30:00 UTC

[jira] [Commented] (CAMEL-18783) camel-cxf - Detect unused URI options in route definition

    [ https://issues.apache.org/jira/browse/CAMEL-18783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17642176#comment-17642176 ] 

Peter Palaga commented on CAMEL-18783:
--------------------------------------

I guess this problem is not CXF specific - it may also exist for bean and perhaps other kinds of components.

For CXF specifically, [~ffang] explained to us that the current behavior, that only one of the two settings (PAYLOAD vs. POJO) gets effective for the given named bean is expected because the bean (in Singleton or Application scope) gets initialized only once. The explanation sounds plausible and I do not think it makes sense to change the behavior in any way. But still, the question is whether we could perhaps warn users that they do not get what they may expect? Or we should even make it illegal and throw an exception?

> camel-cxf - Detect unused URI options in route definition
> ---------------------------------------------------------
>
>                 Key: CAMEL-18783
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18783
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cxf
>    Affects Versions: 3.18.3
>            Reporter: Lukas Lowinger
>            Priority: Minor
>
> Having one `cxf:bean:soapClientEndpoint` (with Singleton scope) and following two routes
> {code}
>         from("direct:simpleUriBean")
>                 .to("cxf:bean:soapClientEndpoint?dataFormat=PAYLOAD");
>         from("direct:operandsAdd")
>                 .to("cxf:bean:soapClientEndpoint?dataFormat=POJO");
> {code}
> Leads to situation, that invoking route via `direct:simpleUriBean` will use `dataFormat=POJO` instead of PAYLOAD (which reader of that code could expect). Could we somehow detect those misuses of URI options ?
> Eg. printing WARNING: You are using URI option dataFormat which wasn't taken into account because you are using shared bean with Singleton scope.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)