@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) @ Override public Object invoke ( flex . messaging . messages . Message flexMessage ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "received Flex Message: " + flexMessage ) ; } Message < ? > message = null ; if ( this . extractPayload ) { Map headers = flexMessage . getHeaders ( ) ; headers . put ( FlexHeaders . MESSAGE_CLIENT_ID , flexMessage . getClientId ( ) ) ; headers . put ( FlexHeaders . DESTINATION_ID , flexMessage . getDestination ( ) ) ; headers . put ( FlexHeaders . MESSAGE_ID , flexMessage . getMessageId ( ) ) ; headers . put ( FlexHeaders . TIMESTAMP , String . valueOf ( flexMessage . getTimestamp ( ) ) ) ; if ( FlexContext . getFlexClient ( ) != null ) { headers . put ( FlexHeaders . FLEX_CLIENT_ID , FlexContext . getFlexClient ( ) . getId ( ) ) ; } long timestamp = flexMessage . getTimestamp ( ) ; message = MessageBuilder . withPayload ( flexMessage . getBody ( ) ) . copyHeaders ( headers ) . setExpirationDate ( timestamp + flexMessage . getTimeToLive ( ) ) . build ( ) ; } else { message = new GenericMessage < flex . messaging . messages . Message > ( flexMessage ) ; } this . messageChannel . send ( message ) ; return null ; }
Invoked when a Message is received from a Flex client .