Repository navigation
@RqueueListener Generic results not support #49
Description
Activity
yes that's a limitation. Would you mind providing a fix if you know? You need to change
GenericMessageConverterclass.Reacted by Chan Mrate Ko Kono problem. i need to deal with other work recently. u need to wait
Hi, @sonus21
Do the generic results support now?
How can I implement it?Hi @chanmratekoko
No this does not support generic, generic has issue in deserialisation process, so now you can not even enqueue generic object using Rqueue enqueuer.There're some complexity with supporting generic object, in serialisation step we need to track the generic information.
GenericMessageConverter is responsible for (de)serialisation. You can provide a new implementation of this class in your application to use.
If your generic class has some fixed generic information then it can be addressed easily but as soon as you start adding more generic data it becomes quite messy. This is the reason most of the library does not support deserialisation correctly event spring-data-redis fail on this.
Some experimental codes can be seen in this class GenericMessageConverterTest
Hope you find a universal working soln.
Play with Gson and see if that works for your use case, then you can use Gson in your code for some of the queues.
@sonus21
Hi, long time no see,
I use Kafka now,kafka + spring boot , It's easy to use
Multiple projects can be implemented alternately
Many rules supporting spring
I don't think you should be discouraged, But that's the reality
Continuing to maintain this project will waste you a lot of time
@Component @Slf4j public class CustomerChangeListener { @KafkaListener(topics = "${spring.profiles}" + KafkaConstant.CUSTOMER_INFO_CHANGE) public void infoChange(Long customerId) { customerScoreService.updateInfoScore(customerId); } @KafkaListener(topics = KafkaConstant.CUSTOMER_INFO_SCORE_CONFIG_CHANGE) public void infoConfigChange(Long ownerMerchantId) { customerScoreService.batchUpdateInfoScore(ownerMerchantId); } } @Component @Slf4j public class CustomerChangeListener2 { @KafkaListener(topics = "${spring.profiles}" + KafkaConstant.CUSTOMER_INFO_CHANGE) public void infoChange(Long customerId) { customerScoreService.updateInfoScore(customerId); } @KafkaListener(topics = KafkaConstant.CUSTOMER_INFO_SCORE_CONFIG_CHANGE) public void infoConfigChange(Long ownerMerchantId) { customerScoreService.batchUpdateInfoScore(ownerMerchantId); } }@victory-wu not sure if your comment is related to other ticket #47
There're some limitation, give me some more time, I'm working on code to change it to use Redis Stream that's new data structure in Redis.
- Repository owner locked and limited conversation to collaborators
on Jan 22, 2021
ERROR:
java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.wzx.server.entity.m.CustomerInfo
analysis:
It does not support generic parsing and is converted to LinkHashMap by default