Results 1 to 4 of 4

Thread: Funny Payload

  1. #1

    Default 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. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

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

  3. #3
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,020

    Default

    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.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  4. #4

    Default 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);
    	}
    
    }

Posting Permissions

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