Results 1 to 4 of 4

Thread: XML messages support

  1. #1

    Default XML messages support

    Does the Spring Integration support XML messages passed between component? Can it integrate with other tools like Castor?

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    The Messages in Spring Integration can have any Object as the payload. There is a GenericMessage<T> class and a couple convenience types - such as StringMessage and ErrorMessage. For marshalling/unmarshalling XML, you could use the spring-oxm.jar that comes with Spring Web Services. It supports Castor as well as JAXB (1 and2), JibX, XmlBeans, and XStream. At this point, it would be easiest to add by implementing a MessageMapper, MessageHandler or ChannelInterceptor depending on where you need the transformation. However, we will soon be adding an XmlMarshallingTransformer that simply delegates to the spring-oxm Marshaller/Unmarshaller strategy interface. Feel free to submit that feature request via Jira: http://jira.springframework.org/browse/INT

    -Mark

  3. #3

    Default Exception

    Thanks!

    In case exception is thrown inside a component, anything I can do so that I can convert the Exception to a kind of error message returned by the component?

    Is the example shown in Spring Integration runs as a single process? or is it multiple processes even if no message queue is in between?

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    When exceptions occur in a MessageHandler, the endpoint for that handler will delegate to its errorHandler, and the default implementation actually does send ErrorMessages to the MessageBus' errorChannel as described here: http://static.springframework.org/sp...ace-messagebus

    The sample runs as a single process - just with thread pools for the dispatcher and the message handling. Spring Integration's default MessageChannel implementation runs in-process wrapping a LinkedBlockingQueue. To communicate across multiple processes requires the use of JMS adapters (or other remoting adapters that are being developed).

    -Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •