New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What's not working? #44
Comments
and the serialization method of redis configuration on my client and management side is the same |
It seems there's some issue with the entries in the Redis LIST. By any chance you had enqueued string then you have converted that to Even if class paths are same than please share some entries of |
The classpath is the same,and exception is from com.github.sonus21.rqueue.converter.GenericMessageConverter.fromMessage method,here return null |
Have you added any other message converter? This should not returns |
What puzzles me is that the entities and methods of the queue are all in the public package. The user side and the management side use a set of tools, and the timing task that reported the error has not had similar problems before, but today the user side A large number of errors have been reported. I can see the content of the emailentity entity in the error message. There is no problem. It is indeed an entity object in json format. |
The only difference is that the redis transaction is enabled in the redis config configuration of the management side. There has been a problem that the redis data read is empty due to the redis transaction before, but here is the log, the read redis list content is no problem |
Can you try to unmarshal json using com.github.sonus21.rqueue.converter.GenericMessageConverter.fromMessage? |
Redis transaction should not effect message conversion. Removing/adding new fields from the entity can also cause this problem. In such cases add |
This does not seem to be a Rqueue bug, closing this one. Please reopen as you see. |
I had this same issue while trying to migrate from ActiveMQ to Rqueue and spent hours trying to troubleshoot it. For anyone else that has this issue, it was caused by the class being sent via the queue did not have a default constructor. Adding a no-args constructor fixed the issue for me. The exception looks like the following:
|
Describe the bug
My project is composed of a user-side module, a management-side module, and a public module. I created a mail entity class in the public module, and then put the mail entity into the queue on the management side, and then consume it. My client and management The end uses the same redis, and then there is a problem today. The mail entity message queued by the management end was successfully consumed on the management end, but an error was reported on the web end. String could not be converted to a mail entity, and the deserialization failed. Makes me very confused
exception:
ERROR rqueueMessageListenerContainer-6 com.github.sonus21.rqueue.listener.RqueueExecutor - [email-queue_low] Message consumer failed
org.springframework.messaging.MessagingException: An exception occurred while invoking the handler method; nested exception is org.springframework.messaging.converter.MessageConversionException: Cannot convert from [java.lang.String] to [com.xxxx.queue.EmailEntity] for GenericMessage
at com.github.sonus21.rqueue.listener.RqueueMessageHandler.processHandlerMethodException(RqueueMessageHandler.java:290) ~[rqueue-2.0.0-RELEASE.jar!/:?]
at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMatch(AbstractMethodMessageHandler.java:581) ~[spring-messaging-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMessageInternal(AbstractMethodMessageHandler.java:520) ~[spring-messaging-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMessage(AbstractMethodMessageHandler.java:454) ~[spring-messaging-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
at com.github.sonus21.rqueue.listener.RqueueExecutor.start(RqueueExecutor.java:377) [rqueue-2.0.0-RELEASE.jar!/:?]
at com.github.sonus21.rqueue.listener.MessageContainerBase.run(MessageContainerBase.java:90) [rqueue-2.0.0-RELEASE.jar!/:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
How to Reproduce
Steps to reproduce the behavior
Start two services, share a redis, and monitor the same queue. When one service generates a message, the other service sometimes reports an error
A sample reproducable code if possible.
send code:
here i user priorityCode is low
private void sendEmailQueue(EmailEntity emailEntity,Integer priorityCode){
String priority ;
try {
priority = EmailPriorityEnum.getDescription(priorityCode);
}
consume code:
@RqueueListener(value = "email-queue",numRetries="3",priority="critical=10,high=8,medium=4,low=1")
public void onMessage(EmailEntity emailEntity) {
log.info("邮件开始消费{},{},{}",new Date(),emailEntity.getTitle(),emailEntity.getReceiver());
try{
if(!EmptyUtils.isEmpty(emailEntity.getReceiver())){
log.info("发送html邮件至:{}", emailEntity.getReceiver());
sendHtmlEmail(emailEntity.getTitle(),emailEntity.getText(),emailEntity.getReceiver());
}
}catch (EmailException e) {
log.error("邮件发送失败 {} {} ",emailEntity.getReceiver(),emailEntity.getTitle());
log.error("邮件内容为--------"+emailEntity.getText());
}catch(Exception e ){
log.error("邮件消费失败",e);
}
}
Library Dependencies
The text was updated successfully, but these errors were encountered: