ApsaraMQ for RocketMQ provides the TCP client SDKs and the HTTP client SDKs for multiple programming languages. You can use the SDKs to send and subscribe to different types of messages. This topic describes the procedure and usage notes for the TCP client SDKs and the HTTP client SDKs for multiple programming languages. You can refer to the procedure and the usage notes to send and subscribe to standard messages.
Background information
ApsaraMQ for RocketMQ supports four types of messages. For more information, see Message types. Normal messages are used in the examples that are provided in this topic. The procedure that is described in this topic cannot be used to send or subscribe to other types of messages. Each topic can be used to send or subscribe only to messages of a specific type.
Procedure
You can use the procedures that are shown in the following figure based on the protocol that you selected.
Additional considerations
ApsaraMQ for RocketMQ provides different client SDKs for consumers that use different protocols. We recommend that you create different groups for consumers that use different protocols. For information about the limits on using groups for each protocol, see Manage groups.
An ApsaraMQ for RocketMQ instance has a TCP endpoint and an HTTP endpoint. If you want to send and subscribe to messages over TCP, use a TCP client SDK and the TCP endpoint. If you want to send and subscribe to messages over HTTP, use an HTTP client SDK and the HTTP endpoint.
Public endpoints and private endpoints for TCP and HTTP are provided in all regions. In production environments, we recommend that you access Message Queue for Apache RocketMQ by using a virtual private cloud (VPC). If you want to access Message Queue for Apache RocketMQ across regions, from on-premises data centers, or over the Internet, and Cloud Enterprise Network (CEN) is not available, you can use public endpoints. You are charged for outbound traffic when you use public endpoints. For more information, see Billing of Internet traffic.