Forums

Covering OroCommerce topics, B2B eCommerce trends, community updates and company announcements.

Forums OroCommerce How to clean the older entries created by oro:message-queue:consume command?

This topic contains 4 replies, has 3 voices, and was last updated by Prabhat Prabhat 3 months, 3 weeks ago.

  • Creator
    Topic
  • #19704
    Prabhat
    Prabhat
    Participant

    Hi,

    Due to oro:message-queue:consume command running, http://<ApplicationURL>/admin/message-queue/jobs has more than 3 lakh entries i.e. if we check the database, the table oro_message_queue_job contains those 3 lakh entries as well. If we don’t want that due to so many entries, our database gets filled up faster, we need to remove the older entries. Is there any proper way to clean the older entries created by oro:message-queue:command?

    Thanks & Regards,
    Prabhat Nagpal

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #19839

    Yurii Muratov
    Participant

    Hello, @Prabhat.

    There is cron command ‘oro:cron:message-queue:cleanup’ https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/MessageQueueBundle/Command/CleanupCommand.php.

    This command should be executed automatically by cron (how to configure the cron task you can read here https://oroinc.com/orocrm/doc/current/dev-guide/background-tasks/cron) once a day.

    This command will delete succsess jobs that was completed 2+ weeks ago and failed jobs that was failed 1+ month ago.

    #25080
    Prabhat
    Prabhat
    Participant

    Hi Yurii,

    I think this has been added in newer version of OroCommerce Edition. Please can you tell me how to do this in version 1.3.0

    Regards,
    Prabhat Nagpal

    #25081
    vseniuk
    vseniuk
    Participant

    Hi, @Prabhat.

    Command oro:cron:message-queue:cleanup is included in OroCommerce 1.3. Here is the link. You can run it manually app/console oro:cron:message-queue:cleanup –env=prod

    #25084
    Prabhat
    Prabhat
    Participant

    Hi Vseniuk,

    I checked MessageQueueBundle folder but I was not able to find the Command folder even. So what I did was created the Command Folder manually, created a file named CleanupCommand.php and copied the same content as it was on github link. After that, I cleared the cache and ran the command oro:cron:definitions:load. I found out that it set up a new schedule with oro:cron:message-queue:cleanup. So, I manually ran this command and it cleared my old entries. I am glad it worked.

    I just want to ask one thing, manually putting this php file did worked but can it brick my orocommerce environment anyhow in the future?

    Regards,
    Prabhat Nagpal

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No
ssossossosso