private static void decodeHeader ( JsJmsMessage msg , String id , String type , String topic , String props ) { // id should be hexEncoded byte array but if it looks too short we prepend a '0' to // allow clients to simply use an integer if they want. if ( id != null ) { if ( id . length ( ) % 2 != 0 ) id = "0" + id ; msg . setCorrelationIdAsBytes ( HexString . hexToBin ( id , 0 ) ) ; } // type goes in the JMSXAppId property. A type of 'SIB' means the special case // compact form. if ( type != null ) { if ( type . equals ( "SIB" ) ) msg . setJmsxAppId ( MfpConstants . WPM_JMSXAPPID ) ; else msg . setJmsxAppId ( URLDecode ( type ) ) ; } // Topic goes to discriminator if ( topic != null ) msg . setDiscriminator ( URLDecode ( topic ) ) ; // And the properties if ( props != null ) { StringTokenizer st = new StringTokenizer ( props , "&" ) ; while ( st . hasMoreTokens ( ) ) { Object [ ] pair = decodePair ( st . nextToken ( ) ) ; // JMSXAppID has already been set from the header field if ( ! ( ( String ) pair [ 0 ] ) . equals ( SIProperties . JMSXAppID ) ) { try { msg . setObjectProperty ( ( String ) pair [ 0 ] , pair [ 1 ] ) ; } catch ( Exception e ) { // No FFDC code needed // No FFDC needed as setObjectProperty() can only throw a JMSException // for a JMS_IBM_Report or JMS_IBM_Feedback property & we don't call // it for any of those. } } } } }
Decode and set the header fields