[rabbitmq-discuss] bug report?

Michael Lam lam at fixmo.com
Tue Mar 13 14:25:07 GMT 2012


If in case this mailing list is the bug report (I saw a 2008 thread to this
effect), here's the bug:

In the 2.7.1 Java client library, RpcClient.java

RpcClient.stringCall does not encode the message in UTF-8 as it's expected
by StringRpcServer.handleCall, resulting in corrupted message received by
the server if the message contains non-ASCII characters.

Fix is quite easy:

 public String stringCall(String message)
        throws IOException, ShutdownSignalException, TimeoutException
    {
-        return new String(primitiveCall(message.getBytes()));
+        byte[] request;
+        try {
+            request = message.getBytes("UTF-8");
+        } catch (UnsupportedEncodingException uee) {
+            request = message.getBytes();
+        }
+        byte[] reply = primitiveCall(request);
+        try {
+            return new String(reply, "UTF-8");
+        } catch (UnsupportedEncodingException uee) {
+           return new String(reply);
+        }
    }

Thanks!


On 13 March 2012 09:58, Michael Lam <lam at fixmo.com> wrote:

> Hello,
>
> I've looked everywhere and cannot locate a bug tracker for RabbitMQ.  Is
> there anywhere I can submit bug reports and patches?
>
> Thanks!
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120313/7c0f5b9f/attachment.htm>


More information about the rabbitmq-discuss mailing list