How to generated Auto Coupon Sales rule by message queue in Magento 2?

Auto Coupon sales rule Magento will be helpful to create automatically discount codes for the admin user.

You don’t need to create manual action to generate it, By default that will be auto-generated 12 characters long.

In the Sales rule, From Magento 2.3 Message Queue will be used to generate coupon codes in Magento.

If you want to generate an auto coupon code via the Command line interface (CLI), You need to run the command,

bin/magento queue:consumer:start codegeneratorProcessor

codegeneratorProcessor message queue will be used to create a new list of discount codes.

While You can click on Generate button from the Sales rule edit page, with the no. of Coupon qty field, It will show the message,

Message is added to the queue, wait to get your coupons soon.

Coupon entry generated in the queue_message database table with topic_name sales_rule.codegenerator.