You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Freeman Yue Fang (Jira)" <ji...@apache.org> on 2023/05/05 15:57:00 UTC

[jira] [Created] (CAMEL-19324) Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context"

Freeman Yue Fang created CAMEL-19324:
----------------------------------------

             Summary: Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context"
                 Key: CAMEL-19324
                 URL: https://issues.apache.org/jira/browse/CAMEL-19324
             Project: Camel
          Issue Type: Bug
          Components: came-cxf
            Reporter: Freeman Yue Fang


Having
{code}
  MessageContentsList list = new MessageContentsList();
        list.add("haha");
        list.add("hehe");
{code}

{code}
     from("timer:tick")
                .process(new Processor() {
                    @Override
                    public void process(Exchange exchange) throws Exception {
                        exchange.getIn().setBody(list);
                    }
                })
                .log("my body ${body}");
{code}

It prints "my body haha" but i would expect "my body [haha, hehe]" (as with ArrayList). 
If MessageContentsList is used in "CXF context", the first element is return value, the other elements are Holders, so it has special logic in converter. But if use MessageContentsList in non - "CXF context", it should be treated as a general ArrayList, which can honour behaviour when converting to String.class is needed(like in to.("log...") processor)



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