OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums 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 6 years ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #32832

    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
  • #32833

    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.

    #32834

    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

    #32835

    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

    #32836

    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)

The forum ‘OroCommerce’ is closed to new topics and replies.

Back to top