All Products
Search
Document Center

ApsaraMQ for RocketMQ:Overview

Last Updated:Oct 22, 2024

ApsaraMQ for RocketMQ supports TCP client SDKs and HTTP client SDKs for multiple programming languages. This topic describes the differences between TCP client SDKs and HTTP client SDKs. This topic also describes the usage notes for TCP client SDKs and HTTP client SDKs.

Compatibility description

The following table describes the compatibility between ApsaraMQ for RocketMQ broker versions and client SDK versions.

Instance version

Protocol

Client version

Compatibility

Limit

ApsaraMQ for RocketMQ 5.x instance

gRPC v2

Apache RocketMQ 5.x SDKs

Compatible

All features of ApsaraMQ for RocketMQ 5.x instances are supported.

Remoting

Apache RocketMQ 3.x and 4.x SDKs

Compatible

The messaging feature is supported. Message trace data and specific metrics cannot be displayed.

Note

Metrics that are related to producers and consumers cannot be displayed. For more information, see Metric details.

Apache RocketMQ TCP client 1.x SDKs

Compatible

gRPC v1

ApsaraMQ for RocketMQ TCP client 2.x SDKs

Incompatible

ApsaraMQ for RocketMQ 5.x instances cannot be accessed by using Apache RocketMQ TCP client 2.x SDKs.

HTTP

ApsaraMQ for RocketMQ HTTP client SDKs

Incompatible

ApsaraMQ for RocketMQ 5.x SDKs do not support the HTTP protocol.

ApsaraMQ for RocketMQ 4.x instance

gRPC v2

ApsaraMQ for RocketMQ 5.x SDKs

Incompatible

You cannot access ApsaraMQ for RocketMQ 4.x instances by using SDKs that correspond to ApsaraMQ for RocketMQ 5.x instances.

Remoting

Apache RocketMQ 3.x and 4.x SDKs

Compatible

All features of ApsaraMQ for RocketMQ 4.x instances are supported.

Apache RocketMQ TCP 1.x SDKs

Compatible

gRPC v1

Apache RocketMQ TCP client 2.x SDKs

Compatible

HTTP

Apache RocketMQ HTTP client SDKs

Compatible

TCP

Important

Open source SDKs are used only when you migrate data from open source Apache RocketMQ to Message Queue for Apache RocketMQ but do not want to modify the code. In other scenarios, we recommend that you use SDKs for commercial use provided by ApsaraMQ for RocketMQ. The SDKs for commercial use provide more features and higher stability than open source SDKs.

Commercial editions of TCP client SDKs (ONS 1.x and 2.x SDKs)

HTTP

HTTP client SDKs for commercial use (recommended for multiple programming languages)

Comparison between TCP client SDKs and HTTP client SDKs

TCP client SDKs and HTTP client SDKs provide different features. We recommend that you select a protocol type based on your business requirements.

Item

TCP client SDK

HTTP client SDK

Suggestions

TCP client SDKs are recommended as the preferred option. The following items describe the benefits of TCP client SDKs:

  • Applicable to scenarios in which high concurrency is required due to excellent transmission performance.

  • Provide more messaging features and iterate at a higher frequency compared with HTTP client SDKs.

  • Provide more observability metrics and more comprehensive message accumulation and reset features compared with HTTP client SDKs.

HTTP client SDKs are recommended as an alternative option. The following items describe the benefits of HTTP client SDKs:

  • Can be used in scenarios in which a programming language that is not supported by TCP client SDKs is used.

  • Applicable to simple scenarios due to lightweight access and few features.

Normal messages

支持

支持

Ordered messages

支持

支持

Scheduled messages and delayed messages

支持

支持

Transactional messages

支持

支持

Push consumers

支持

不支持

Pull consumers

支持

不支持

Batch consumption

支持

不支持

Broadcasting consumption

支持

不支持

Clustering consumption

支持

支持

Message retry

支持

支持

Query message traces

支持

支持

Dead-letter queues

支持

支持

Reset consumer offsets

支持

不支持

Usage notes

  • Each type of endpoint can be used only by clients of the same protocol type. For example, if you want to use a TCP client SDK to send and receive messages, you must use the TCP endpoint of your ApsaraMQ for RocketMQ instance to access the ApsaraMQ for RocketMQ broker.

  • ApsaraMQ for RocketMQ allows you to send and receive messages by using groups that are created for HTTP clients and TCP clients. You must create different groups for clients of different types. For example, if you want to use a TCP client SDK to send and receive messages, you must use a group that is created only for TCP clients.

  • Messages can be transmitted between TCP clients and HTTP clients. Message information such as attributes, content, tags, and keys must comply with Extensible Markup Language (XML) rules because HTTP uses XML serialization. Otherwise, messages may fail to be sent or consumed.

    You can use Base64 to encode or decode messages that do not comply with XML rules.

    Note

    For more information about XML rules, see Extensible Markup Language (XML) 1.0 (Fifth Edition). You can also use the third-party tool xml_validator to check whether your messages comply with XML rules based on your business requirements. For more information about xml_validator, see XML Validator.

  • Public and private endpoints for TCP and HTTP clients are provided in all regions. In production environments, we recommend that you access ApsaraMQ for RocketMQ in virtual private clouds (VPCs). If you want to access ApsaraMQ for RocketMQ across regions, from on-premises data centers, or over the Internet while Cloud Enterprise Network (CEN) is unavailable, you can use public endpoints to access ApsaraMQ for RocketMQ instances. If you use public endpoints to access ApsaraMQ for RocketMQ instances, you are charged for outbound Internet traffic. For more information, see Billing of Internet traffic.