All Products
Search
Document Center

ApsaraMQ for RocketMQ:Billing of the messaging feature

Last Updated:Jul 17, 2024

The messaging feature is a basic feature provided by ApsaraMQ for RocketMQ. After you activate ApsaraMQ for RocketMQ, the messaging feature is automatically enabled. This topic describes the pricing details of the messaging feature of ApsaraMQ for RocketMQ Standard Edition instances. This topic also provides billing examples.

Billing formulas

ApsaraMQ for RocketMQ Standard Edition instances are billed based on the pay-as-you-go billing method. Instances of this edition are suitable for scenarios in which the number of messages is small or greatly fluctuates. You are charged only for messages that are transmitted and resources that are used. This helps maximize your resource utilization.

The messaging fees of a Standard Edition instance is calculated by using the following formula.

标准版实例消息收发费用

API call fees

Description

API call fees = (Number of API calls initiated to receive messages + Number of API calls initiated to deliver messages) × Unit price of API calls

You are charged for API calls based on the total number of API calls initiated to receive and deliver messages on a broker each month. Tiered pricing is used to calculate API call fees. The unit prices of API calls vary based on the region.

The following rules are used to calculate the number of API calls initiated to receive and deliver messages:

  • Each time an ApsaraMQ for RocketMQ broker receives a normal message, one API call to receive messages is counted. Each time an ApsaraMQ for RocketMQ broker delivers a normal message, one API call to deliver messages is counted, regardless of whether the message is consumed.

  • One API call to receive or deliver a featured message is counted as five API calls to receive or deliver a normal message. For example, if an ApsaraMQ for RocketMQ broker receives one transactional message and delivers the message to a consumer twice, the number of API calls initiated to receive and deliver the transactional message is 15. The number of API calls is calculated by using the following formula: 1 × 5 + 2 × 5 = 15.

  • The maximum size of a message body is 4 MB. The system calculates the number of API calls based on a message size of 4 KB. For example, if an ApsaraMQ for RocketMQ broker delivers a message that is 16 KB in size, the number of API calls initiated to deliver the message is 4. The number of API calls is calculated by using the following formula: 16/4 = 4.

  • When you consume messages over HTTP, the consumer client actively calls the consumption method to obtain messages. The long polling and short polling modes are supported. The frequency to call the consumption method is controlled by the consumer application.

    • Long polling: If no message exists in a topic, the subscription request is suspended on the broker and a response is returned until a message is produced in the topic or the specified waiting time elapses. You can specify up to 30 seconds for the waiting time. When messages are returned from the broker, the system counts the number of API calls initiated to deliver messages based on the preceding rules. If no message is returned from the broker, the system counts the number of API calls initiated to deliver messages as one.

    • Short polling: If no message exists in a topic, the broker immediately returns a response. After the client receives the response, the client repeatedly initiates subscription requests. In this case, a subscription request is counted as one API call initiated to deliver messages.

    If no message is generated in a topic and the short polling mode is used to obtain messages, a large number of invalid subscription requests may be generated. You are charged API call fees for these requests. To reduce the number of invalid subscription requests and save costs, we recommend that you use the long polling mode and increase the waiting time for long polling. For more information, see Operation for consuming messages.

Note

ApsaraMQ for RocketMQ provides the following types of messages: normal messages, scheduled messages, delayed messages, transactional messages, and ordered messages. All these types of messages are featured messages except for normal messages. For more information, see Message types.

Unit prices

  • Prices at different tiers

    Note

    Each Alibaba Cloud account has a total free quota of 20 million API calls for messaging each month. The prices in the following table are for API calls that exceed the free quota.

    Table 1. API call fees (public cloud)

    Table 2. API call fees (Alibaba Finance Cloud and Alibaba Gov Cloud)

    Table 3. API call fees

    Billing tier

    Number of API calls initiated to receive and deliver messages (100 million calls per month)

    Unit price by region (USD per one million calls)

    UAE (Dubai), Singapore, China (Hong Kong), Japan (Tokyo), UK (London), Germany (Frankfurt), US (Virginia), US (Silicon Valley), and Australia (Sydney)

    Malaysia (Kuala Lumpur), India (Mumbai) Closing Down, Indonesia (Jakarta), and Philippines (Manila)

    Internet, China (Hangzhou), China (Shanghai), China (Shenzhen), China (Chengdu), China (Qingdao), China (Beijing), China (Zhangjiakou), and China (Hohhot)

    SAU (Riyadh - Partner Region)

    First tier

    0 to 10

    0.45

    0.42

    0.31

    0.54

    Second tier

    10 to 50

    0.41

    0.38

    0.28

    0.492

    Third tier

    50 to 100

    0.34

    0.31

    0.23

    0.408

    Fourth tier

    100 to 500

    0.3

    0.27

    0.20

    0.36

    Fifth tier

    > 500

    0.27

    0.25

    0.19

    0.324

  • Rules for tiered pricing

    The tiered pricing schedule is based on the total number of API calls initiated to receive and deliver messages by an Alibaba Cloud account each month.

    Note

    If you use an Alibaba Cloud account to authorize another Alibaba Cloud account by using a Resource Access Management (RAM) role, the bill is charged to the authorizing Alibaba Cloud account. If you use an Alibaba Cloud account to authorize RAM users in the Alibaba Cloud account to make calls, the bill is charged to the Alibaba Cloud account.

Billing example

  • Example on how to calculate the number of API calls initiated to receive and deliver messages

    • An ApsaraMQ for RocketMQ broker receives seven million normal messages per day from a producer. The number of API calls initiated to deliver the messages is estimated to be eight million in view of the fact that a topic may be subscribed to by multiple groups and specific messages may be retried. The size of each message is 40 KB.

    • The ApsaraMQ for RocketMQ broker also receives three million featured messages per day from a producer. The number of API calls initiated to deliver the messages is three million. The size of each message is 2 KB.

    The total number of API calls initiated to receive and deliver messages per day is calculated by using the following formula: Number of API calls = (Number of API calls initiated to receive normal messages + Number of API calls initiated to deliver normal messages) × Multiplier for message size + (Number of API calls initiated to receive featured messages + Number of API calls initiated to deliver featured messages) × 5 × Multiplier for message size. Therefore, the total number of API calls initiated to receive and deliver messages per day is 180 million based on the following formula: (7 million + 8 million) × ⌈40/4⌉ + (3 million + 3 million) × 5 × ⌈2/4⌉ = 180 million.

    Note

    ⌈ ⌉ indicates that the number is rounded up to the smallest integer that is greater than or equal to the value.

  • Example on how to calculate API call fees

    The following table describes the accumulated API calls initiated to receive and deliver messages and the tiered pricing schedule of an instance in which 500 million API calls are initiated to receive and deliver messages per day in the China (Shanghai) region.

    Item

    First day of the month

    Second day of the month

    Third day of the month

    Fourth day of the month

    ...

    Eleventh day of the month

    ...

    Number of API calls initiated to receive and deliver messages on the day

    500 million

    500 million

    500 million

    500 million

    ...

    500 million

    ...

    Accumulated number of API calls

    500 million

    1 billion

    1.5 billion

    2 billion

    ...

    5.5 billion

    ...

    Unit price (USD per one million calls)

    0.31 (first tier)

    0.31 (first tier)

    0.28 (second tier)

    0.28 (second tier)

    ...

    0.23 (third tier)

    ...

    Fees on the day (USD)

    155

    155

    140

    140

    ...

    115

    ...

Topic occupancy fees

Description

Topic occupancy fees = The price of a topic × Number of topics × Number of days

You are charged for occupying topics on ApsaraMQ for RocketMQ instances. Each topic is billed once every day. The prices of topics vary based on the number of API calls initiated to receive and deliver messages in the topic.

Important

You are charged for each topic that you create, regardless of whether the topic is used. We recommend that you delete topics that you no longer require at the earliest opportunity to prevent unnecessary fees.

Unit prices

  • Prices at different tiers

    Table 4. Topic occupancy fees (public cloud)

    Table 5 Topic occupancy fees (Alibaba Gov Cloud and Alibaba Finance Cloud)

    Table 6. Topic occupancy fees

    Billing tier

    Number of API calls initiated to receive and deliver messages (10,000 calls per topic-day)

    Unit price by region (USD per topic-day)

    China (Hong Kong), Singapore, Japan (Tokyo), UAE (Dubai), Australia (Sydney), US (Virginia), US (Silicon Valley), Germany (Frankfurt), and UK (London)

    Malaysia (Kuala Lumpur), India (Mumbai) Closing Down, Indonesia (Jakarta), and Philippines (Manila)

    Internet, China (Hangzhou), China (Shanghai), China (Shenzhen), China (Chengdu), China (Qingdao), China (Beijing), China (Zhangjiakou), and China (Hohhot)

    SAU (Riyadh - Partner Region)

    First tier

    0 to 100

    0.45

    0.42

    0.31

    0.54

    Second tier

    100 to 500

    0.34

    0.31

    0.23

    0.408

    Third tier

    500 to 1,000

    0.11

    0.11

    0.08

    0.132

    Fourth tier

    > 1,000

    0

    0

    0

    0

  • Rules for tiered pricing

    The tiered pricing schedule is based on the total number of API calls initiated to receive and deliver messages in the topic every day.

    Note

    If you use an Alibaba Cloud account to authorize another Alibaba Cloud account by using a RAM role, the bill is charged to the authorizing Alibaba Cloud account. If you use an Alibaba Cloud account to authorize RAM users in the Alibaba Cloud account, the bill is charged to the Alibaba Cloud account.

Billing example

You create a specific number of topics on an instance that resides in the China (Shanghai) region.

You are charged for occupying topics on ApsaraMQ for RocketMQ instances. Each topic is billed once every day. The topic occupancy fees on a day is the sum of the fees that are generated by all topics that day.

Item

First day of the month

Second day of the month

Third day of the month

...

Topic_1

The number of API calls initiated to receive and deliver messages: 100,000. The fees fall in the first tier.

Topic occupancy fees: USD 0.31.

The number of API calls initiated to receive and deliver messages: 1.2 million. The fees fall in the second tier.

Topic occupancy fees: USD 0.23.

The number of API calls initiated to receive and deliver messages: 300,000. The fees fall in the first tier.

Topic occupancy fees: USD 0.31.

...

Topic_2

The number of API calls initiated to receive and deliver messages: 5.5 million. The fees fall in the third tier.

Topic occupancy fees: USD 0.08.

The number of API calls initiated to receive and deliver messages: 800,000. The fees fall in the first tier.

Topic occupancy fees: USD 0.31.

The number of API calls initiated to receive and deliver messages: 100,000. The fees fall in the first tier.

Topic occupancy fees: USD 0.31.

...

...

...

...

...

...

Topic_n

...

...

...

...