Announcement Announcement Module
Collapse
No announcement yet.
SimpleMessageConverter and default conversion of JMSMessage and SpringIntMessage Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SimpleMessageConverter and default conversion of JMSMessage and SpringIntMessage

    Here is piece of XML config:
    Code:
    <splitter id="fileToStringsSplitter" input-channel="inboundFileChannel" output-channel="inboundStringChannel" ref="inboundFileToStringsSplitter" />
    	<jms:outbound-channel-adapter id="outboundOscarRowsJmsAdapter" destination="oscarRowsQueue" channel="inboundStringChannel" />
    	<jms:message-driven-channel-adapter id="inboundOscarRowChannelAdapter" destination="oscarRowsQueue" channel="inboundStringProcessingChannel" />
    	<transformer id="stringToOscarSaleDataTransformer" input-channel="inboundStringProcessingChannel" output-channel="inboundOscarSaleDataChannel" ref="inboundStringToOscarSaleDataTransformer" />
    Application reads file, splits it to strings, posts Strings to ActiveMQ, then reads them, converts to my custom objects with transformer.
    My guess was, that in the channel "inboundStringProcessingChannel" i'll get usual spring message (SimpleMessageConverter supposed to convert it to text/object).
    But actually, headers still contain JMS related information.

    Because of that, transformer does NOT post message to "inboundOscarSaleDataChannel" and flow simply stucks.

    Could you please explain where I'm missunderstanding the conversion flow ?
    Thanks !

  • #2
    What do you mean by "flow simply stucks" ?

    Turn on DEBUG logging and follow the messages through the flow.

    Yes, the headers will contain JMS related information (by default), but that has no bearing on the message conversion.

    Comment


    • #3
      What do you mean by "flow simply stucks" ?
      Oh sorry, right after transformer, i have the following outbound jms adapter:
      Code:
      <!--
      		Transformed oscar data processing flow
      	-->
      	<jms:outbound-channel-adapter id="outboundOscarDataJmsAdapter" destination="oscarDataQueue" channel="inboundOscarSaleDataChannel" />
      So the transformer SHOULD be posting in that channel: "inboundOscarSaleDataChannel", but it does NOT (I've looked in ActiveMQ administration queue panel, 0 messages)
      And here what is debug log says:
      2013-04-18 16:31:54,875 INFO com.si.transformer.InboundStringToOscarSaleDataTra nsformer.transformStringToOscarSaleData(InboundStr ingToOscarSaleDataTransformer.java:29)
      - Transforming line "000002002000003379216934913730812401466188871 310 0000059000000000000000001302110757806333700001515E UR01000077704000" to OscarSaleData object
      2013-04-18 16:31:54,875 DEBUG org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:67)
      - org.springframework.integration.handler.LoggingHan dler#0 received message: [Payload=com.model.OscarSaleData@df3fbc][Headers={timestamp=1366291914875, id=4e446941-d98e-4f49-bc8c-7be64cd8782b, FILE_NAME=1Ships, jms_timestamp=1366291914843, jms_redelivered=false, FILE_PROCESSING_TIMESTAMP=_t1366291914750, sequenceSize=1, FILE_LINE=0000020020000033792169349137308124014661 88871310 0000059000000000000000001302110757806333700001515E UR01000077704000, sequenceNumber=1, jms_messageId=ID:xdjpc-db571977e-4505-1366291914390-1:1:10:1:1}]
      2013-04-18 16:31:54,875 DEBUG org.springframework.integration.handler.LoggingHan dler.handleMessageInternal(LoggingHandler.java:141 )
      - com.model.OscarSaleData@df3fbc
      Here is stucks, no futher processing is performed.

      Comment


      • #4
        As I said, turn on DEBUG logging; most likely the transformer is returning null.

        Comment


        • #5
          Originally posted by Gary Russell View Post
          As I said, turn on DEBUG logging; most likely the transformer is returning null.
          Thanks Gary.
          It is really strange, because i had log4j logger for spring set to:
          log4j.logger.org.springframework = error

          But somewhy it has omitted error message about conversion failed of my object.

          And in the end that was my mistake - i forgot to implement Serializible for my object.
          Problem solved now.

          Comment

          Working...
          X