Best Practices - Client Connection and Subscription

Examples are given to describe how to connect and consume MQ messages via MQTT.fx.

MQTT Client Download

Message Queuing Service Enabling and Configuration

Step 1 Service Enabling and Resource Creation

Add a message queuing service instance and create a topic and subscription.

In this example:

Instance name: mq-for-test, topic name: topic-test, and subscription name: test-sub

MQTT.fx Client Configuration

Step 1 Client Configuration

Open MQTT.fx client and go to the configuration page.

Set Profile Name, i.e. MQ in this example.

Set access address and port, username and password, where:

username is set as instance name and password is shown in Access Authentication, Here is an example of password:

version=2018-10-31&method=sha1&sign=%2FRdtyYy4l27DUwFKl74sqZelmV0%3D&res=mqs/mq-for-test&et=1564718131

Click SSL/TLS to proceed to the encryption settings.

Select CA certificate file to import a certificate

Click OK to finish the configuration.

Step 2 Client Connection

Click the arrow down icon to select profile MQ.

Click Connect to connect to the message queuing service.

Step 3 Subscription and Data Consumption

Select Subscribe configuration and enter a subscription name. The rules for naming your subscription are as follows:

$sys/pb/consume/$instance nam/$TOPIC/$SUB

In this example, the subscription name is:

$sys/pb/consume/mq-for-test/topic-test/test-sub

Select QoS1 and click Subscribe to finish MQTT subscription.

个搜索结果,搜索内容 “

    0 个搜索结果,搜索内容 “