qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajith Attapattu <rajit...@gmail.com>
Subject Interop issue btw Java and new python client
Date Tue, 01 Dec 2009 00:17:31 GMT
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-subscribe@qpid.apache.org


Mime
View raw message