Serializing json before passing it to zmq.