Closed abhikt48 closed 3 years ago
Thanks @abhikt48 for the detailed description of the issue. To make a quick recap, when resubmitting messages from the deadletter queue of a queue or subscription, no matter if you resubmit messages one at the time or in batch mode, and no matter the message type (string, WCF, bytearray) you select, you get the "Cannot decode String in UTF-8", right? I assume that if you just receive the message from the queue or subscription, you don't get this error, right? This means that there is some problem when cloning the payload of the original message for the resubmission and this problem happens only when receiving the message via JMS.
@paolosalvatori - Thanks for quick update. Please find below details.
Thanks @abhikt48 for the detailed description of the issue. To make a quick recap, when resubmitting messages from the deadletter queue of a queue or subscription, no matter if you resubmit messages one at the time or in batch mode, and no matter the message type (string, WCF, bytearray) you select, you get the "Cannot decode String in UTF-8", right?
prerequisite - message should be sent by Qpid JMS client as String/Text message(javax.jms.TextMessage)
If we submit one message at a time with Stream body type then there is no issue. But,
I assume that if you just receive the message from the queue or subscription, you don't get this error, right? This means that there is some problem when cloning the payload of the original message for the resubmission and this problem happens only when receiving the message via JMS.
Yes you are right. If we receive message normally then there is no issue. But if we receive after cloning then we started getting decode error. Yes you are right - there is a issue in cloning of message payload. But we don't have any issue if original message content is ByteArray. We faced issue for String/TextMessage(javax.jms.TextMessage) only.
Please let me know if you need any other information.
Hey @paolosalvatori,
I hope you are doing great. Did you get chance to look on this issue? Is it possible for you to provide fix on this issue?
Hey @paolosalvatori ,
I was doing testing and found ContentType also plays an important role for reproducing this issue. Please find below details and let me know for any information.
If you want to set content type with Qpid JMS, then please find below code snippet for setting content type.
((AmqpJmsMessageFacade) ((JmsMessage) jmsMessage).getFacade()).setContentType(Symbol.valueOf(contentType));
Use Cases
Thanks a lot @abhikt48 for the very detailed analysis! Now, since ContentType plays a role and you get errors only when using application/json or text/json ContentType, do you think we should try to find a fix, or are you ok to close the issue as you know what are the combinations that work as expected with no issues?
@paolosalvatori Thanks for update. We definitely need fix for this issue. Please apply fix for above 3 cases where we are getting UTF8 error.
Just FYI - We got this issue in PROD environment where we are using ServiceBus explorer for replay messages. Our lot of scenarios matches above conditions, so we definitely need fix.
Please let me know if you need any other information.
@paolosalvatori - Did you get chance to take a look on this issue?
@paolosalvatori - Could you please provide us fix on this issue ?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I think this issue is still available. Could you please fix this issue.
@abhikt48 , one of the most recently merged PRs may have fixed or at least changed this issue. Please build the latest bits from the develop branch and see if the behavior is the same.
@ErikMogensen @abhikt48 can I close this issue?
Yes, @abhikt48 let us know if there is a problem. The fix is now part of the v5 release.
@paolosalvatori @ErikMogensen - Sorry for late reply. I tested today with 5.0.1 version, unfortunately, this is not working as expected. , Please find below steps to reproduce this issue -
Publish message fromqpid-jms-client-0.56.0
, with text/json ContentType. Please refer below screenshot
Repair and submit message as String Body Type . Please refer below screenshot
Receive message from qpid-jms-client-0.56.0
, and you can receive below error
Reason 'Cannot decode String in UTF-8' - 'class javax.jms.JMSException', cause 'java.nio.charset.MalformedInputException: Input length = 1'
Can I request you to please reopen this issue?
Ok.
Are you able to reopen this issue yourself? I just want to know if that is possible.
The fix that I referred to caused a new bug in v5.0.1. There is a fix in the current develop branch. Are you able to build from the develop branch and test again?
@ErikMogensen Thanks for quick update. Please find below details.
@abhikt48 are you a C# developer? If yes, what development environment do you use? Visual Studio? Visual Studio Code? To reopen the issue you just have to press the button below: Reopen and comment.
@paolosalvatori - I am a Java Developer and use eclipse based ID for development.
Unfortunately, I am not getting reopen button. Please find below screenshot.
Thanks @abhikt48 we reopened the issue, but I cannot guarantee we can look at it now. I need a repro to understand the issue. Can you please provide a way to reproduce the problem? Thanks
@paolosalvatori Thanks for reopening the tickets.
Please find below steps to replicate this issue. As we faced this issue in Java application, so created sample JAVA application to replicate this issue.
Exception in thread "main" javax.jms.JMSException: Cannot decode String in UTF-8
at org.apache.qpid.jms.exceptions.JmsExceptionSupport.create(JmsExceptionSupport.java:90)
at org.apache.qpid.jms.provider.amqp.message.AmqpJmsTextMessageFacade.getText(AmqpJmsTextMessageFacade.java:87)
at org.apache.qpid.jms.provider.amqp.message.AmqpJmsTextMessageFacade.copy(AmqpJmsTextMessageFacade.java:65)
at org.apache.qpid.jms.provider.amqp.message.AmqpJmsTextMessageFacade.copy(AmqpJmsTextMessageFacade.java:41)
at org.apache.qpid.jms.message.JmsTextMessage.copy(JmsTextMessage.java:37)
at org.apache.qpid.jms.message.JmsTextMessage.copy(JmsTextMessage.java:25)
at org.apache.qpid.jms.JmsMessageConsumer.copy(JmsMessageConsumer.java:421)
at org.apache.qpid.jms.JmsMessageConsumer.receive(JmsMessageConsumer.java:213)
at com.qpid.samples.Receiver.receiveMessage(Receiver.java:19)
at com.qpid.samples.Receiver.main(Receiver.java:32)
Caused by: java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:816)
at org.apache.qpid.jms.provider.amqp.message.AmqpJmsTextMessageFacade.getText(AmqpJmsTextMessageFacade.java:84)
... 8 more
Please let me know if you need any other input.
Hi @abhikt48 I need to find some time to spend to investigate the issue. I'm moving on to a new team so I'll be a little busy. Expect a delayed answer. Should I forget about this issue, please ping or just reply to this message.
HI @paolosalvatori , No Problem, I can understand. Please do needful whenever you got time.
Hi, I am also facing the similar issue while resubmitting the message using byte array. I did some debugging and got the byte array content of the body and decoded it online the message is adding some extra characters in front and end of the message Starting of the message @base64Binary3http://schemas.microsoft.com/2003/10/Serialization/ End of the message
But the strange thing is it looks just fine in Service Bus Explorer itself
Can you please debug the code and submit a PR? I can't reproduce the issue and in addition, I'm quite busy in this period. Thanks
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi Team,
We are facing "Cannot decode String in UTF-8" issue while repair message. We faced this issue in two cases
Steps to reproduce issue for first case
Steps to reproduce issue for second case
If we send message as ByteArray[] from Qpid JMS client then "Resubmit messages in Batch Mode" is working fine.
Could you please take a look on this issue and let me know for any concern.
Error Stack Trace