Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-19324

Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context"

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.18.7, 3.20.5, 4.0.0
    • came-cxf
    • None
    • Unknown

    Description

      Having

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

      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)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ffang Freeman Yue Fang
            ffang Freeman Yue Fang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment