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

  • Funny Payload

    I have wired up a SI job which is reading from a IBM MQ queue. The get is working correctly but when I put the same message back on a different queue I'm not getting the a different payload. Could this be something I'm missing in the configuration? I should only be seeing hello world.

    RFH MQSTR <mcd><Msd>jms_text</Msd></mcd> \<jms><Dst>queue:///ORDER.EVENT.ERROR</Dst><Tms>1360632540556</Tms><Dlv>2</Dlv></jms> <usr><timestamp dt='i8'>1360632540555</timestamp></usr> hello world
    Code:
    <int-jms:message-driven-channel-adapter	id="jmsIn" channel="inbound"  container="messageListenerContainer" acknowledge="transacted" />
    
    	<int:channel id="inbound" />
    	
    	<int:service-activator 
    		input-channel="inbound" 
    		ref="messageHandler" method="handleMessage"
    		output-channel="outbound" />	
    
    	<int:channel id="outbound" />
    
    	<int-jms:outbound-channel-adapter id="error" connection-factory="userCredentialsConnectionFactoryAdapter" destination="orderError" channel="outbound"  />

  • #2
    Can you show the "messageHandler" bean's "handleMessage" method?

    Comment


    • #3
      These "RFH" headers are proprietary IBM data used by MQ Series.

      Usually, when sending data to a NON-JMS client, you have to tell MQ to NOT include these headers; they are usually not visible in JMS clients.

      http://forum.springsource.org/showth...-(CICS)-client

      I don't know if the reverse is true (configured to receive messages from a NON-JMS peer, when in fact it is JMS and includes the RFH headers - it's been a long time since I have used MQ).

      It appears you are getting raw MQ messages rather than messages mapped to JMS.

      I suggest you google for RFH2 headers and JMS.

      Comment


      • #4
        MessageHandler

        Code:
        package com.app.jms;
        
        import java.util.Map;
        
        import org.slf4j.Logger;
        import org.slf4j.LoggerFactory;
        import org.springframework.integration.annotation.Headers;
        import org.springframework.integration.annotation.Payload;
        import org.springframework.integration.support.MessageBuilder;
        import org.springframework.stereotype.Component;
        
        @Component
        public class MessageHandler {
        
        	protected Logger logger = LoggerFactory.getLogger(MessageHandler.class);
        
        	public MessageBuilder<String> handleMessage(@Headers Map<String, Object> headers, @Payload String inboundPayload) {
        
        		for (Map.Entry<String, Object> entry : headers.entrySet()) {
        			logger.info("Key : " + entry.getKey() + " Value : "	+ entry.getValue());
        		}
        
        		logger.info(inboundPayload);
        
        		return MessageBuilder.withPayload(inboundPayload);
        	}
        
        }

        Comment

        Working...
        X