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

arunRabbitMQ arun.viswanath at gmail.com
Sat Apr 20 07:37:08 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




--
View this message in context: http://rabbitmq.1065348.n5.nabble.com/JSON-Data-to-be-send-between-Java-Producer-and-Python-Consumer-tp26118.html
Sent from the RabbitMQ mailing list archive at Nabble.com.


More information about the rabbitmq-discuss mailing list