MNS allows you to push messages to a specified HTTP server of a topic. This article describes
how to push messages to an HTTP server.
Step 1: Create a topic
- Log on to the MNS console.
- In the left-side navigation pane, click Topics.
- In the top navigation bar, select a region.
- On the Topics page, click Create Topic.
- In the Create Topic dialog box, set the following parameters and click OK.
- Name: the name of the topic.
- Maximum Message Length: the maximum body length of the message that is sent to the topic.
- Enable Logging Feature: specifies whether to enable the logging feature.
The Topic Details page appears.
Step 2: Create a subscription
- Log on to the MNS console.
- In the left-side navigation pane, click Topics.
- In the top navigation bar, select a region.
- On the Topics page, find the topic. Click View Subscriptions in the Actions column.
- On the Manage Subscriptions page, click Create Subscription.
- In the Create Subscription dialog box, set the following parameters and click OK.
- Name: Enter the name of the subscription.
- Push Type: Select HTTP.
- Receiver Endpoint: Enter the endpoint of the HTTP server.
Note The endpoint of the HTTP server cannot be an internal IP address.
- Optional:Message Filtering Tag: Enter a tag to filter messages.
- Retry Policy: Select a retry policy.
- Message Pushing Format: Select a format for pushed messages.
Step 3: Publish messages
- Log on to the MNS console.
- In the left-side navigation pane, click Topics.
- In the top navigation bar, select a region.
- On the Topics page, find the topic to which you want to publish a message. Choose in the Actions column.
- On the Try Publishing Message to Topic page, set the following parameters and click Publish Message.
- Message Content: Enter the message content.
- Optional:Message Tag: Enter a tag to filter messages.
- Subscription Type: Select HTTP.