This topic describes the Software Development Kits (SDKs) that are provided by ApsaraMQ for Kafka for multiple programming languages.

Introduction

The SDK files include demos, library files, toolchains, and compilation scripts. When you use a Message Queue for Apache Kafka SDK, you do not need to write code to develop the SDK. You can go to the directory in which the SDK is installed, specify the required information in the files of the SDK, and then compile the SDK.

SDKs

The following table describes the SDKs that are provided by ApsaraMQ for Kafka for different programming languages. You can follow the links in the table to download the SDKs, learn how to use the SDKs, and check the SDK update history.
SDKDemoSupported protocolReferenceREADME file
Java SDKJava SDK Demo
  • PLAINTEXT
  • SASL_SSL/PLAIN
  • SASL_PLAINTEXT/PLAIN
  • SASL_PLAINTEXT/SCRAM
Send and receive messages by using an instance endpointREADME.md
Python SDKPython SDK Demo
  • PLAINTEXT
  • SASL_SSL/PLAIN
Use the SDK for Python to send and subscribe to messages
C++ SDKC++ SDK Demo
  • PLAINTEXT
  • SASL_SSL/PLAIN
Use the SDK for C++ to send and subscribe to messages
Go SDKGo SDK Demo
  • PLAINTEXT
  • SASL_SSL/PLAIN
  • SASL_PLAINTEXT/PLAIN
  • SASL_PLAINTEXT/SCRAM
Use the SDK for Go to send and subscribe to messagesREADME.md
PHP SDKPHP SDK Demo
  • PLAINTEXT
  • SASL_SSL/PLAIN
Use the SDK for PHP to send and subscribe to messages
Ruby SDKRuby SDK Demo
  • PLAINTEXT
  • SASL_SSL/PLAIN
Use the SDK for Ruby to send and subscribe to messagesREADME.md
Node.js SDKNode.js SDK Demo
  • PLAINTEXT
  • SASL_PLAIN
Use the SDK for Node.js to send and subscribe to messagesREADME.md
C# SDKNone
  • PLAINTEXT
  • SASL_SSL/PLAIN
  • SASL_PLAINTEXT/PLAIN
  • SASL_PLAINTEXT/SCRAM
Use the SDK for C# to send and subscribe to messagesREADME.md

Usage notes

Instance endpoints

Select an endpoint on your client. ApsaraMQ for Kafka provides the following endpoints to connect your client to a Message Queue for Apache Kafka instance, and then send and consume messages.

  • Default endpoint: Use the default endpoint to connect to a ApsaraMQ for Kafka instance, and then send and consume messages.
  • SSL endpoint: Use the SSL endpoint to connect to a ApsaraMQ for Kafka instance, and then send and consume messages based on PLAIN authentication. PLAIN authentication is a simple authentication mechanism that is used to verify usernames and passwords. ApsaraMQ for Kafka provides optimized PLAIN authentication that allows you to dynamically create Simple Authentication and Security Layer (SASL) users for an instance without the need to restart the instance.
    Important If you deployed an instance and the SSL certificate is a 1,024-bit certificate, you can upgrade the SSL certificate to a 4,096-bit certificate for better security. For more information, see Update the SSL certificate algorithm.
  • SASL endpoint: Use the SASL endpoint to connect to a ApsaraMQ for Kafka instance over a virtual private cloud (VPC) and send and consume messages based on PLAIN authentication or SCRAM-SHA-256 authentication. When you use the SASL endpoint, the following authentication mechanisms are available:
    • PLAIN: a simple authentication mechanism that is used to verify usernames and passwords. ApsaraMQ for Kafka provides PLAIN authentication that allows you to dynamically create SASL users for an instance without the need to restart the instance.
    • SCRAM-SHA-256: a hash-based authentication mechanism that allows you to verify usernames and passwords on clients and brokers. SCRAM-SHA-256 authentication provides better security than PLAIN authentication. SCRAM-SHA-256 authentication also allows you to dynamically create SASL users for a ApsaraMQ for Kafka instance without the need to restart the instance.

For more information, see Comparison among endpoints.

Demos

Obtain the demo file of the SDK that you want to use, specify the required information, and then run the program to send and consume messages. For more information, click the demo link of the SDK and then follow the instructions that are displayed on the page that appears.

References

  • Purchase and deploy a ApsaraMQ for Kafka instance based on your network type.ApsaraMQ for Kafka For more information, see Purchase and deploy a VPC-connected instance and Purchase and deploy an Internet- and VPC-connected instance.
  • Create the topic and Group that you want to use to send and consume messages. For more information, see Step 3: Create resources.
  • Message Queue for Apache Kafka verifies only the identity of the default SASL user of an Internet- and VPC-connected instance, and then authorizes the default SASL user to read and write all topics and all consumer groups in the instance. If you want to perform fine-grained access control, enable the access control list (ACL) feature, create an SASL user, and then grant the SASL user specific permissions on the resources of your ApsaraMQ for Kafka instance based on your business requirements. After you enable the ACL feature, the system revokes the default permissions that are granted to the SASL user. For more information, see Grant permissions to SASL users.