หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ ROMA Connect/ User Guide (ME-Abu Dhabi Region)/ Getting Started/ Using ROMA Connect for Message Integration

Using ROMA Connect for Message Integration

Updated on 2024-07-10 GMT+08:00

Overview

ROMA Connect provides secure and standard message channels to implement integration with different message systems.

This chapter provides a configuration example of interworking with ROMA Connect using Kafka command-line tool to help you get familiar with the message integration process.

The steps for integrating messages with ROMA Connect are as follows:

Prerequisites

Before performing this operation, complete the following preparations:

  • An EIP has been bound to the ROMA Connect instance.
  • The Java JDK has been downloaded and installed on your local PC, and related environment variables have been configured.
  • The open-source Kafka command-line tool of the corresponding version has been downloaded based on the Kafka version of the ROMA Connect instance. You can view the Kafka version in the MQS Information area on the Instance Information page of the ROMA Connect console.
    NOTE:

    The Kafka server version of ROMA Connect can be 1.1.0 or 2.3.0. Therefore, you must use the Kafka command-line tool of the same version as the server to avoid unpredictable problems.

  • If MQS SASL_SSL has been enabled for the ROMA Connect instance, ensure that the has been downloaded. To download the client certificate, log in to the ROMA Connect console, choose Message Queue Service > Topic Management, and click Download SSL Certificate.

Step 1: Create a Message Topic

A topic is a channel for message transmission between the message client and ROMA Connect. The client sends messages to and receives messages from ROMA Connect through the topic.

  1. Create an integration application.
    1. Log in to the ROMA Connect console. On the Instances page, click View Console next to a specific instance.
    2. In the navigation pane on the left, choose Integration Applications. In the upper right corner of the page, click Create Integration Application.
    3. In the dialog box displayed, set Name and Description, and click OK.
  2. Create a message topic.
    1. In the navigation pane on the left, choose Message Queue Service > Topic Management. On the page displayed, click Create Topic in the upper right corner.
    2. In the Create Topic dialog box, set topic parameters and click OK.
      Figure 1 Creating a topic
      Table 1 Topic parameters

      Parameter

      Description

      Topic Name

      Enter a topic name. It is recommended that you enter a name based on naming rules to facilitate search.

      Integration Application

      Select the integration application created in 1.

      Permission

      Select the topic permission for the integration application to which the topic belongs. In this example, select Publish/Subscribe, which indicates that the topic can be used to produce and consume messages.

      Partitions

      The appropriate number of partitions can improve the concurrent performance of message creation and retrieval. Retain the default value 3.

      Replicas

      ROMA Connect automatically backs up data on each replica. If one replica is faulty, data will still be available. The reliability increases with the number of replicas of a topic. Retain the default value 3.

      Aging Period (h)

      After the aging time expires, messages stored in the topic are deleted. Retain the default value 72.

      Synchronous Replication

      When a client creates a message to a topic, ROMA Connect determines whether to replicate the message to all replicas and then returns a response to the client. You do not need to enable this option.

      Synchronous Flushing

      Specifies whether each message created by a client to the topic is immediately written to the disk. You do not need to enable this option.

      Tag

      A tag can be added for a topic to facilitate topic search. You do not need to add a tag.

      Sensitive Fields

      If a message sent to a topic contains sensitive fields, the sensitive fields will be shielded. You do not need to add sensitive fields.

      Description

      Enter a brief description of the topic.

Step 2: Send and Receive Messages to and from a Topic

Use the Kafka command-line tool on the local PC to send messages to and receive messages from topics in CLI mode.

The operations for sending and receiving messages to and from a topic vary depending on whether SASL_SSL is enabled for the ROMA Connect instance. If SASL_SSL is enabled, messages sent and received by clients to and from topics are encrypted before transmission.

  1. Decompress the Kafka command-line tool and client certificates.

    Locate the downloaded Kafka command-line tool and client certificate files on your local PC and decompress them.

    The following uses Windows as an example. Assume that the Kafka command-line tool path is D:\kafka_2.11-1.1.0 and the client certificate file path is D:\cert.

  2. (Optional) Modify the kafka-run-class.bat file in the Kafka command-line tool. This step is required only if the Kafka command-line tool 1.1.0 is used. Otherwise, skip this step.

    Find the kafka-run-class.bat file in the D:\kafka_2.11-1.1.0\bin\windows directory and add double quotation marks ("") to %CLASSPATH% in the following script line:

    set COMMAND=%JAVA% %KAFKA_HEAP_OPTS% %KAFKA_JVM_PERFORMANCE_OPTS% %KAFKA_JMX_OPTS% %KAFKA_LOG4J_OPTS% -cp "%CLASSPATH%" %KAFKA_OPTS% %*
  3. (Optional) Modify the configuration file of the Kafka command-line tool. This step is performed only if SASL_SSL is enabled for the ROMA Connect instance. Otherwise, skip this step.

    Locate the consumer.properties and producer.properties files in D:\kafka_2.11-1.1.0\config and add the following content to the files separately:

    sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required \
    username="**********" \
    password="**********";
    sasl.mechanism=PLAIN
    security.protocol=SASL_SSL
    ssl.truststore.location=D:/cert/client.truststore.jks
    ssl.truststore.password=dms@kafka
    ssl.endpoint.identification.algorithm=

    In the preceding information:

    • The values of username and password are the key and secret of the integration application to which the topic belongs. You can click the integration application name on the Integration Applications page of the ROMA Connect console to view and obtain the key and secret.
    • The value of ssl.truststore.location is the path for storing the client certificate obtained in 1.
      NOTICE:

      The certificate path in Windows must contain slashes (/).

  4. On the command line window, run the following command to go to the directory where the Kafka command-line tool is stored:
    d:
    cd kafka_2.11-1.1.0\bin\windows
  5. Produce messages to ROMA Connect.
    1. Run the following command to create a connection with the topic for producing messages:
      If SASL_SSL is not enabled for the ROMA Connect instance, run the following command:
      kafka-console-producer.bat --broker-list IP:9094,IP:9095,IP:9096 --topic TopicName

      If SASL_SSL is enabled for the ROMA Connect instance, run the following command:

      kafka-console-producer.bat --broker-list IP:9095,IP:9096,IP:9097 --topic TopicName --producer.config ../../config/producer.properties

      In the preceding information:

      • IP indicates the MQS connection address of ROMA Connect. You can obtain the address by viewing EIP on the Instance Information page of the ROMA Connect console.
      • TopicName indicates the name of the topic created in Step 1: Create a Message Topic.
    2. Enter the message contents and send the messages to the topic.
      >Message1
      >Message2
      >Message3

      In the preceding information, Message1, Message2, and Message3 indicate the actual message contents sent to the topic. Each row indicates a message.

    3. On the ROMA Connect console, choose Message Queue Service > Message Query.
    4. Click Advanced Search to expand advanced search options.
    5. Enter search criteria and click Search to query the messages sent by the client.
      • Select the message topic created in Step 1: Create a Message Topic for Topic Name.
      • Select Creation time for Search By and select the time segment for the client to send messages to ROMA Connect.
    6. Click Message Body next to the message record and check whether the message content is the same as that sent in 5.b.
      Figure 2 Querying messages
  6. Consume messages from ROMA Connect.
    1. Run the following command to create a connection with the topic for reading messages:
      If SASL_SSL is not enabled for the ROMA Connect instance, run the following command:
      kafka-console-consumer.bat --bootstrap-server IP:9094,IP:9095,IP:9096 --topic TopicName --from-beginning

      If SASL_SSL is enabled for the ROMA Connect instance, run the following command:

      kafka-console-consumer.bat --bootstrap-server IP:9095,IP:9096,IP:9097 --topic TopicName --from-beginning --consumer.config ../../config/consumer.properties

      In the preceding information:

      • IP indicates the MQS connection address of ROMA Connect. You can obtain the address by viewing EIP on the Instance Information page of the ROMA Connect console.
      • TopicName indicates the name of the topic created in Step 1: Create a Message Topic.
    2. After the command is executed, the system is continuously connected to the topic and reads messages. To stop reading messages, press Ctrl+C, enter Y, and press Enter.

เราใช้คุกกี้เพื่อปรับปรุงไซต์และประสบการณ์การใช้ของคุณ การเรียกดูเว็บไซต์ของเราต่อแสดงว่าคุณยอมรับนโยบายคุกกี้ของเรา เรียนรู้เพิ่มเติม

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback