The JSON serializer returns a unicode string. AMQP deals with bytes, so
we need to encode it to a byte string after serialization.