tencent cloud

Feedback

Use Cases

Last updated: 2024-10-18 17:35:37

    Flash Sale Scene

    Flash sale is a very common scene in e-commerce systems. There are various solutions, but using TDMQ for RabbitMQ is an effective approach.
    If the inventory deduction is complex (such as involving product information itself or affecting other systems), it is recommended to use a database for inventory quantity deduction. You can use an asynchronous approach to handle this high-concurrency inventory update.
    1. When a user places an order, the order is not generated immediately but is sequentially placed into a queue.
    2. The order module processes orders according to its speed, retrieving them from the queue one by one to perform the inventory deduction operation.
    3. Once the order is successfully generated, the user can proceed with the payment.
    This method is designed for the flash sale scene, following the first-come, first-served principle to ensure fairness. All users can try to purchase, and then wait for order processing. Finally, the order is generated (if stock is insufficient, the order fails).
    

    Priority Messages

    When messages are consumed, if their level of importance varies, and higher-priority messages need to be consumed first, you can use the priority queue feature of TDMQ for RabbitMQ. This ensures that higher-priority messages are consumed ahead of others.
    Business scene example:
    For instance, in an order payment reminder scene, when a customer places an order on an e-commerce system, the system promptly sends the order to the customer. If the payment is not completed within the specified time, a reminder SMS will be sent to the customer. However, the e-commerce system distinguishes between major and minor customers. Payment reminders for major customers need to be prioritized, while reminders for smaller customers will have a lower priority.
    The priority queue feature of TDMQ for RabbitMQ can effectively support this scene, ensuring that high-priority messages don’t remain queued for too long. If an order is identified as coming from a major customer, it can be assigned a relatively higher priority for faster processing; otherwise, it will follow the default priority.
    

    Delayed Message Scene

    In real-world business systems, there is often a need to send delayed messages. If you implement the delay logic yourself, ensuring reliability and delay accuracy can be challenging. Using a messaging middleware like TDMQ for RabbitMQ can effectively handle such requirements. Scenes for using delayed messages include:
    In an order system, after a user places an order, they have 30 minutes to complete the payment. If the payment is not successfully made within 30 minutes, the order will undergo exception handling. In this case, the delayed message capability of TDMQ for RabbitMQ can be used to handle these timed-out orders.
    In an IoT system, users may want to remotely control smart devices to operate at a specified time using their mobile phones. In this case, the control instructions can be sent to a delayed queue, and once the specified time arrives, the control instructions will be pushed to the smart device.
    

    Message Broadcasting

    Many business systems need to broadcast information to downstream systems. Using RPC for this purpose can lead to high coupling and increased pressure on the upstream system. In this case, the Fanout Exchange feature of TDMQ for RabbitMQ can be used to handle such requirements. Applicable scenes include:
    Massively Multiplayer Online (MMO) games can use it for leaderboard updates or other global events;
    Sports news websites can use it to distribute live score updates to clients in near real-time;
    Distributed systems can use it to broadcast various status and configuration updates;
    Group chats can use it to distribute messages among participants.
    

    Flexible Routing Scenes

    With the rise of microservice architecture, services are often broken down into smaller components, and data from these services is sent as messages to different queues using carefully designed distribution strategies. TDMQ for RabbitMQ’s flexible message routing capabilities can be fully used to distribute messages to target Queues. Applicable scenes include:
    Log processing scenes, where logs can be delivered to different Queues based on type. For example, Error logs can have a dedicated queue for priority processing.
    In an e-commerce logistics system, logistics information can be distributed by region to different consumers for processing.
    Complex routing scenes.
    
    
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support