configFactory = $configFactory; $this->serializer = $json; $this->scope = $scope; $this->output = $output; $this->scope->setCurrentScope('adminhtml'); $this->save = ObjectManager::getInstance()->get(Save::class); $this->scope->setCurrentScope('global'); } /** * Process Consumer * * @param AsyncConfigMessageInterface $asyncConfigMessage * @return void * @throws \Exception */ public function process(AsyncConfigMessageInterface $asyncConfigMessage): void { $configData = $asyncConfigMessage->getConfigData(); $data = $this->serializer->unserialize($configData); $data = $this->save->filterNodes($data); /** @var \Magento\Config\Model\Config $configModel */ $configModel = $this->configFactory->create(['data' => $data]); try { $configModel->save(); } catch (LocalizedException $exception) { $message = $exception->getMessage(); $this->output->writeln(' Config couldn\'t be saved: ' . $message); } } }