Create and manage topics

更新时间:
复制 MD 格式

A topic is the first-level classification of messages in SOFAStack MSMQ. A message producer sends messages to a topic, and a message consumer subscribes to the topic to obtain and consume messages.

Create a topic

  1. Log on to the SOFAStack console.

  2. In the left-side navigation pane, choose Middleware > MSMQ > Topics.

  3. Click Create Topic. In the Create Topic dialog box, configure the following information about the topic:

    • Topic: the name of the topic.

      • A topic can contain only letters, digits, hyphen (-), and underscores (_). You must use one of letters and digits. hyphen (-) and underscores (_) are optional.

      • The name must be 3 to 64 characters in length.

      • The name cannot start with "CID" or "GID".

    • Message Type: The following types of messages are supported: normal messages, ordered messages, transactional messages, and scheduled messages. For more information about message types, see Message types.

    • Description: optional. The description of the topic can be up to 256 characters in length.

  4. Click OK.

After the topic is created, you can go to the details page or send a test message.

View topic details

In the topic list, click the name of the target topic to go to the details page of the topic. The details page provides the following information:

  • Basic Information: the topic name, type, permission, creation time, last discovery time, and description.

  • Subscription: includes the last delivery time, all group IDs that have subscribed to the topic, and their information, such as the consumption mode.

  • Resource Monitoring: allows you to view the changes in message production data per minute and per second, data volume per minute, and average message size of the topic within the specified time range, as shown in the following figure.

Send a test message

You can use a test message to verify the availability of a topic. After a message is sent, you can view the message sending status in the Message Query section. For official production, use the SDK to send messages.

  1. In the topic list, find the topic that you want to send and click Send Test Message in the Actions column.

  2. In the Send Test Message dialog box, configure the following information:

    • Tag: optional. It is used to level 2 category messages under the topic. For more information, see Topics and tags.

    • Key: Optional. The business identifier of the message. The business identifier is set by the message producer and uniquely identifies a business logic.

    • message body: required. The specific message content to be sent.

  3. Click OK to send a test message.

After a message is sent, you can click Go to Message Query to view the sending status of the message, or copy the message ID of the message to query the message. For more information, see Message query.

Delete a topic

To avoid unnecessary fees, delete topics that are no longer used.

  1. In the topic list, find the topic that you want to delete and click Delete in the Actions column.

  2. In the message that appears, click OK.

    Important

    After a topic is deleted, related producers and consumers will stop services immediately, and all related resources will be cleared in 10 minutes. Exercise caution when you perform this operation.

Subsequent operations