Hi,

A minor interop issue happens due to the java "test/plain" content
type not being handled properly in the new python client API.
The python client expects the encoding along with the content type,
while the java client just specifies the content type.

The following patch is a workaround.
The patch defaults to utf8 if the charset is not specified for content
type "text/plain".
However not not sure if it's the right solution.

Index: qpid/messaging.py
===================================================================
--- qpid/messaging.py   (revision 885604)
+++ qpid/messaging.py   (working copy)
@@ -716,6 +716,7 @@
   dict: "amqp/map",
   list: "amqp/list",
   unicode: "text/plain; charset=utf8",
+  unicode: "text/plain",
   buffer: None,
   str: None,
   None.__class__: None
@@ -725,6 +726,7 @@
   "amqp/map": codec("map"),
   "amqp/list": codec("list"),
   "text/plain; charset=utf8": (lambda x: x.encode("utf8"), lambda x:
x.decode("utf8")),
+  "text/plain": (lambda x: x.encode("utf8"), lambda x: x.decode("utf8")),
   "": (lambda x: x, lambda x: x),
   None: (lambda x: x, lambda x: x)
   }



Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org

Reply via email to