By creating a RocketMQ data source, you can enable Dataphin to read business data from RocketMQ or write data to RocketMQ. This topic describes how to create a RocketMQ data source.
Background information
RocketMQ refers to Alibaba Cloud Message Queue for RocketMQ, which is a distributed "message, event, stream" unified processing platform built by Alibaba Cloud based on Apache RocketMQ with low latency, high concurrency, high reliability. If you are using Alibaba Cloud Message Queue for RocketMQ, you need to create a RocketMQ data source before connecting to Dataphin for data development. For more information, see What is ApsaraMQ for RocketMQ.
Permission policies
Only custom global roles with the Create Data Source permission and system roles such as super administrator, data source administrator, domain architect, and project administrator can create data sources.
Procedure
On the Dataphin homepage, click Management Center > Datasource Management in the top navigation bar.
On the Datasource page, click +Create Data Source.
On the Create Data Source page, select RocketMQ in the Message Queue section.
If you have recently used RocketMQ, you can also select RocketMQ in the Recently Used section. You can also quickly search for RocketMQ by entering keywords in the search box.
On the Create RocketMQ Data Source page, configure the parameters for connecting to the data source.
Configure the basic information of the data source.
Parameter
Description
Datasource Name
The name must meet the following requirements:
It can contain only Chinese characters, letters, digits, underscores (_), and hyphens (-).
It cannot exceed 64 characters in length.
Datasource Code
After you configure the data source code, you can reference tables in the data source in a Flink_SQL node by using the format
data source code.table nameordata source code.schema.table name. If you need to automatically access the data source in the corresponding environment based on the current environment, access it using the variable format${data source code}.tableor${data source code}.schema.table. For more information, see Dataphin data source table development method.ImportantThe data source code cannot be modified after it is configured successfully.
After the data source code is configured successfully, you can preview data on the object details page in the asset directory and asset inventory.
In Flink SQL, only MySQL, Hologres, MaxCompute, Oracle, StarRocks, Hive, and SelectDB data sources are currently supported.
Data Source Description
A brief description of the data source. It cannot exceed 128 characters.
Data Source Configuration
Select the data source to be configured:
If the business data source distinguishes between production and development data sources, select Production + Development Data Source.
If the business data source does not distinguish between production and development data sources, select Production Data Source.
Configure the connection parameters between the data source and Dataphin.
If you select Production + Development Data Source for Data Source Configuration, you need to configure the connection information for both Production + Development Data Source. If you select Production Data Source, you only need to configure the connection information for the Production Data Source.
NoteTypically, production and development data sources should be configured as different data sources to achieve environment isolation between development and production data sources, reducing the impact of development data sources on production data sources. However, Dataphin also supports configuring them as the same data source with identical parameter values.
Parameter
Description
Endpoint
The endpoint of the RocketMQ instance. You can view the endpoint on the Instance Details page in the Message Queue for RocketMQ console.
We recommend that you select the endpoint for internal network access under the TCP protocol client access point.
ImportantYou can use the endpoint for internal network access only when the RocketMQ instance and the Dataphin instance are in the same region.
Instance ID
The ID of the RocketMQ instance. You can view the instance ID on the Instance Details page in the Message Queue for RocketMQ console.
Access ID, Access Key
The AccessKey ID and AccessKey Secret of the account to which the RocketMQ data source belongs. For information about how to obtain them, see Create an AccessKey pair.
ImportantWhen creating a RocketMQ data source, testing whether the data source can connect to Dataphin normally is not supported. Therefore, you need to ensure the correctness of the connection information.
Click OK to complete the creation of the RocketMQ data source.