@ SuppressWarnings ( "unchecked" ) public < T > T convertMessage ( @ NotNull final Message message , final Class < T > clazz ) { checkMessageBody ( message ) ; message . getMessageProperties ( ) . getHeaders ( ) . put ( AbstractJavaTypeMapper . DEFAULT_CLASSID_FIELD_NAME , clazz . getName ( ) ) ; return ( T ) rabbitTemplate . getMessageConverter ( ) . fromMessage ( message ) ; }
Is needed to convert a incoming message to is originally object type .