caimofei commented on issue #55: Can the starter provide support for 
deserializing generic parameters?
URL: https://github.com/apache/rocketmq-spring/issues/55#issuecomment-564008541
 
 
   Recently, I tryied solve this problem.
   1. My Main idea is use 
org.springframework.messaging.converter.SmartMessageConverter#fromMessage .This 
interface define a third parameter called "Object conversionHint".
   2. I switch the Definition of DefaultRocketMQListenerContainer#messageType 
to Type insteadof Class
   3. add a "private  MethodParameter onMessageParameter" member  to 
DefaultRocketMQListenerContainer and init it to indicate the onMessage 
parameter when afterPropertiesSet() 
   4.when doCovertMessage. if the messageType instanceof  ParameterizedType, 
then call fromMessage with the third parameter(methodParameter). The 
MappingJackson2MessageConverter can use it to deserialization the message.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to