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 | Compatible | All features of ApsaraMQ for RocketMQ 5.x instances are supported. | |
Remoting | 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. | ||
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 | Compatible | All features of ApsaraMQ for RocketMQ 4.x instances are supported. | ||
Compatible | ||||
gRPC v1 | Compatible | |||
HTTP | Compatible |
TCP
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)
C/C++ SDK
HTTP
HTTP client SDKs for commercial use (recommended for multiple programming languages)
Python SDK
Node.js SDK
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:
| HTTP client SDKs are recommended as an alternative option. The following items describe the benefits of HTTP client SDKs:
|
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.
NoteFor 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.