def payload_for(value)
      case value
      when Array, Hash
        JSON.dump value
      else
        value
      end
    rescue
      value
    end
def payload_for(value)
      case value
      when Array, Hash
        JSON.dump value
      else
        value
      end
    rescue
      value
    end
Converts published values to JSON if possible
 @api private