[rabbitmq-discuss] JSON Data to be send between Java Producer and Python Consumer

Arun Viswanath arun.viswanath at gmail.com
Sat Apr 20 07:38:49 BST 2013


Hi, 

I'm facing an issue while sending the JSON data between Java Producer and 
 Python Consumer. 

I doing the following serialization in my Java Producer for my JSON data 
and placing the serialize data in the Queue 

*Java Code: 
import org.json.simple.JSONObject; 
import org.json.simple.parser.JSONParser; 


// Reading the JSON content from the file and making it an JSONObject 
JSONObject serviceObj = (JSONObject) parser.parse(new 
FileReader("C:\\Msg2.json")); 

String jsonText = new flexjson.JSONSerializer().serialize(jsonObj); 

channel.basicPublish("", CONDUCTOR_QUEUE_NAME, null, jsonText .getBytes());*

----------------- 
My python consumer successfully takes the data from the Queue but it is not 
able to process it. 
Python consumer is expected to deserialize the json message read from the 
Queue to Python dictionary but the data got after deserialize is python 
unicode type. 

My python consumer is third party code so I can't change my consumer side. 
I'm not sure whether I'm doing the correct stuff in my Java producer. 

Any help to resolve this issue will be appreciated. 

Thanks In Advance, 
Arun V 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130419/e62a8f09/attachment.htm>


More information about the rabbitmq-discuss mailing list