What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello all, I have implemented a custom importer with the following DataSetWriter. The product is imp

U048WDEP3R7
U048WDEP3R7 Posts: 217 🧑🏻‍🚀 - Cadet

Hello all, I have implemented a custom importer with the following DataSetWriter. The product is imported successfully but it doesn't seem to get published (or added to Redis) for Yves frontend. Can someone please see the following code and advise me if I am doing it right.

class AepImportConcreteProductWriter implements DataSetWriterInterface
{
    use DataSetWriterPersistenceStateAwareTrait;

    /**
     * @inheritDoc
     */
    public function write(DataSetInterface $dataSet)
    {
        ...

        DataImporterPublisher::addEvent(
            ProductEvents::PRODUCT_CONCRETE_PUBLISH,
            $spyConcreteProductId
        );
        DataImporterPublisher::addEvent(
            ProductEvents::PRODUCT_ABSTRACT_PUBLISH,
            $spyAbstractProductId
        );
    }

Comments

  • U04FXCTCWPP
    U04FXCTCWPP Posts: 91 🧑🏻‍🚀 - Cadet

    These two commands look good to me, but this issue can have quite a lot of possible causes and so this alone is not enough to solve it. What else are you doing and how? What data are you providing, how, in what order? Have you checked if everything is written correctly into the db?
    And, on the other side, in Redis, don't you see anything at all for the products you've imported?

    (Also, out of curiosity: why a "custom" importer? Why not build on the original/default one and modify/extend that as needed?)

  • sebastian.larisch
    sebastian.larisch Spryker Customer Posts: 143 🧑🏻‍🚀 - Cadet
    edited January 2023

    do u see the events in rabbitmq? is queue worker running to consume the events? u actually do not need to create custom events, a $entity->save() should be enough to create propel events

  • U04FXCTCWPP
    U04FXCTCWPP Posts: 91 🧑🏻‍🚀 - Cadet

    Good point. A few days ago too, your Jenkins was down due to the testing mode. Maybe you have the same issue again?

  • U048WDEP3R7
    U048WDEP3R7 Posts: 217 🧑🏻‍🚀 - Cadet

    @U04FXCTCWPP The data is being added correctly in the database. About "Why a custom importer", we have complex data to import some of which is generated on the go. Also, Jenkins is working.

    @UNGMX0012 I will check if there events are there.

  • U048WDEP3R7
    U048WDEP3R7 Posts: 217 🧑🏻‍🚀 - Cadet

    @UNGMX0012 @U04FXCTCWPP

    It looks like I am missing a schema that needs to be updated through propel to trigger publish and synchronise events. What do you think?