Announcement Announcement Module
Collapse
No announcement yet.
XML messages support Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XML messages support

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

  • #2
    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

    Comment


    • #3
      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?

      Comment


      • #4
        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

        Comment

        Working...
        X