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 guys. One more technical question. As I see you disabled event behavior during default import

U0145CP9Q6Q
U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet
edited July 2020 in Help

Hello guys. One more technical question. As I see you disabled event behavior during default import processes and trigger all events manually. What was the purpose of it? I need also to trigger event in my custom import. Should i trigger it manually? Or can enable event behavior only during my import?

Comments

  • bonjour! the background to disabling it is that in many cases there are a lot of duplicated events that would be fired during import. potentially hundreds of thousands.

  • so we disable and accumulate the events and only fire them once, after import

  • Unknown
    edited July 2020

    see \Spryker\Zed\DataImport\Business\Model\DataImportStep\PublishAwareStep

  • Unknown
    edited July 2020

    i think it could also be possible to activate the behaviour, but @UK9N7MP96 probably has more insight here

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet

    ok. good to know. thank you for inforamtion

  • if need be you might have a look here:

  • Unknown
    edited July 2020

    \Spryker\Zed\DataImport\Communication\Plugin\DataImportEventBehaviorPlugin

  • ah wait, i was copying the wrong locations above 🤦

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet

    yes yes. I found it already :)

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet

    thanks

  • that one is registered as before hook on most of the importers, e.h. the importer collection

  • (fixed the above class names, if someone else should stumble upon this)

  • There is also the issue with triggering events related to records that are inside a transaction that is not commited yet… Yhis can lead to issues…

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet

    yes I found this hook during debugging) because I added event behavior to the database table but it didn't work. And found this hook then

  • @U010MDPMB3N can you elaborate?

  • Unknown
    edited July 2020

    If we don’t control the flow of the events, they will be sent to RabbitMQ with ids that are not yet saved on the DB. Then, when the workers process them, they will complain because the data was, at that point, not yet commited (pending transaction)

  • ah, ok. another reason to accumulate first