Bug 984822 - SY ignores toString method when converting objects to string
SY ignores toString method when converting objects to string
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Keith Babo
Jiri Sedlacek
Depends On:
  Show dependency treegraph
Reported: 2013-07-16 02:29 EDT by Jiri Pechanec
Modified: 2015-08-02 19:44 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-22 13:00:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jiri Pechanec 2013-07-16 02:29:15 EDT
Since the tight integration between Camel and SwitchYard was introduced the POJO messages are automatically converted to XML whenever String representation is required, including message trace.

In the past when toString method was present, it was used to conversion to String. I recommend to return back to this practice - when toString() is declared it should be used, otherwise the conversion could be delegated to Camel internals
Comment 1 Keith Babo 2013-07-16 07:16:18 EDT
I'm going to need an example here as I have not seen this behavior.
Comment 2 Jiri Pechanec 2013-07-16 08:19:53 EDT
ok, so upon further investigation - I did not notice previously that the POJO in question is JAXB-annotated. So whenever there is an internal conversion to string (like for MessageTrace) and the JAXB annotations are present then Camel converter will convert the pojo to XML string.
Comment 3 Keith Babo 2013-08-02 10:50:54 EDT
There's not a whole lot we can about this.  Users are free to register an ExchangeInterceptor and call toString() on the payload directly if they want to dump the content.

Note You need to log in before you can comment on or make changes to this bug.