Push messages to an HTTP server

更新时间:
复制 MD 格式

Simple Message Queue (SMQ), formerly MNS, lets you push messages from a topic to an HTTP server.

Step 1: Create a topic

  1. Log on to the SMQ console.

  2. In the left-side navigation pane, choose Topic Model > Topics.

  3. In the top navigation bar, select a region.

  4. On the Topics page, click Create Topic.

  5. In the Create Topic panel, configure the parameters and click OK.

    • Name: Enter a name for the topic.

    • Maximum Message Length: The maximum size of a message body that you can send to the topic.

    • Enable Logging Feature: Specifies whether to enable log management.

    After the topic is created, the Topic Details page is displayed.

Step 2: Create a subscription

  1. In the left-side navigation pane, choose Topic Model > Subscriptions.

  2. On the Subscriptions page, click Create Subscription.

  3. In the Create Subscription panel, configure the parameters and click OK.

    • Topic Name: The topic to subscribe to.

    • Subscription Name: Enter a name for the subscription.

    • Subscription: Select HTTP.

    • Endpoint: Enter the HTTP URL.

      Note

      The endpoint does not support an intranet IP.

    • Optional: Message Filtering Tag: Enter a tag to filter messages.

    • Retry Policy: The policy for retrying failed message deliveries.

      • BACKOFF_RETRY: Retries a failed delivery up to 3 times. The interval between retries is a random value between 10 and 20 seconds.

      • DECAY_RETRY: Retries a failed delivery up to 176 times over one day. The retry interval increases exponentially (from 2^0 seconds), capping at 512 seconds. It then continues at 512-second intervals.

    • Message Format: The format of pushed messages.

      • SIMPLIFIED: The message body contains only the raw content you published, without any message attributes.

      • JSON: The message body is a JSON object that includes both the message content and its attributes.

      • XML: The message body is an XML document that includes both the message content and its attributes.

Step 3: Publish a message

  1. On the Topics page, find your topic, and in the Actions column, click Publish Message.

  2. On the Try Publishing Message to {topic} Topic page, configure the parameters and click Publish Message.

    • Message Content: Enter the body of the message.

    • Optional: Message Tag: Enter a tag to filter messages.

    • Subscription Type: Select HTTP.

Related documents

To learn how to verify signatures for HTTP messages with a client SDK, see Verify a signature on an HTTP server.