Calling Developers!
We are reenergizing our code contribution process! Learn More

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..

HI Team if we save the data in storage table then with the help of queue, data is automatically push

Options
U03TXRYL7U7
U03TXRYL7U7 Posts: 64 🧑🏻‍🚀 - Cadet

HI Team
if we save the data in storage table then with the help of queue, data is automatically pushed to redis
please let me know is there any way to do opposite
if i will delete the data from storage table, will it delete data from redis?
in my case it is not happening
Can you please help in same

Comments

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,005 ⚖️ - Guardians (admin)
    Options

    Heyhey, since the data-synching from the storage table to redis is done through a so called “behavior” in propel it is important HOW you delete the data.

    if you use some ootb Pub&Sync from the demoshop then you must not delete directly in the database but use propel and then the removal should also be synched to redis.

  • U03TXRYL7U7
    U03TXRYL7U7 Posts: 64 🧑🏻‍🚀 - Cadet
    Options

    I have used following schema file to create storage file:

    <?xml version="1.0"?>
    <database xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>" name="zed" xsi:noNamespaceSchemaLocation="<http://static.spryker.com/schema-01.xsd>" namespace="Orm\Zed\Config\Persistence" package="src.Orm.Zed.Config.Persistence">
        <table name="pyz_config_storage" idMethod="native" allowPkInsert="true" phpName="PyzConfigStorage" identifierQuoting="true">
            <column name="id_pyz_config_storage" required="true" type="INTEGER" primaryKey="true" autoIncrement="true" />
            <column name="fk_lookup_key" required="true" type="VARCHAR" size="255" />
            <foreign-key foreignTable="pyz_config">
                <reference local="fk_lookup_key" foreign="lookup_key" />
            </foreign-key>
    
            <behavior name="synchronization">
                <parameter name="resource" value="config" />
                <parameter name="key_suffix_column" value="fk_lookup_key" />
                <parameter name="queue_group" value="sync.storage.pyz_config" />
            </behavior>
            <behavior name="timestampable" />
            <id-method-parameter value="pyz_config_storage_pk_seq" />
        </table>
    </database>
    

    and then deleting using following code:

    $isConfigStorage = $this->getFactory()->createPyzConfigStorageQuery()
                                         ->filterByFkLookupKey($configKey)
                                         ->delete();
    

    this is deleting from storage table but not from redis.

  • U03TXRYL7U7
    U03TXRYL7U7 Posts: 64 🧑🏻‍🚀 - Cadet
    Options

    Can you please let me know what i am missing

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,005 ⚖️ - Guardians (admin)
    Options

    On the first look it seems to be fine. Have you checked if there is any new message in the queue “sync.storage.pyz_config” once you delete it? The best would be to disable the scheduler for this for the moment with docker/sdk console scheduler:suspend

    if this does not help then i can not help more without debugging by myself.

  • U03TXRYL7U7
    U03TXRYL7U7 Posts: 64 🧑🏻‍🚀 - Cadet
    Options

    no new message in the queue after deletion
    I have specified events like this:

    public const ENTITY_PYZ_CONFIG_CREATE = 'Entity.pyz_config.create';
        public const ENTITY_PYZ_CONFIG_UPDATE = 'Entity.pyz_config.update';
        public const ENTITY_PYZ_CONFIG_DELETE = 'Entity.pyz_config.delete';
    

    it is not getting listened in the listener.