public function deserializeParameters($type, $data)
    {
        $jobType = $this->registry->get($type);
        $indices = $jobType->getIndicesOfSerializableParameters();

        $serializedParameters = json_decode($data, 1);
        if (false === $serializedParameters) {
            throw new \RuntimeException(sprintf('Deserialization failed with error "%s"', json_last_error_msg()));
        }

        if (count($indices) < count($serializedParameters)) {
            throw new \InvalidArgumentException(sprintf('The serialized data contains more parameters than defined for job "%s"', $type));
        }

        $parameters = array();
        foreach ($serializedParameters as $index => $data) {
            if (null === $data) {
                $parameters[] = null;
            } else {
                $parameters[] = $this->serializer->deserialize($data, $jobType->getParameterType($indices[$index]), 'json', $this->getParamDeserializationContext($jobType, $indices[$index]));
            }
        }

        return $parameters;
    }