This topic describes the on-premises debugging tool that is used to simulate how MNS pushes messages from a topic to HTTP or HTTPS endpoints. The tool helps you develop and test clients.

Release notes

The debugging tool supports Python 2.5 to 3.0 (excluding 3.0). This tool can run on both the Windows and Linux operating systems.

Release date Version New feature
2017-05-02 Version 1.0.1
  • Pushes messages in the JSON format.
  • Fixes the bug that occurs on the Content-MD5 parameter when you run the notifymsg_withauth command.
2016-04-20 Version 1.0.0
  • Allows you to run the notifymsg_withauth command that is used to test the authentication logic on clients.
  • Allows you to run the notifymsg_withoutauth command that is used to test the message processing logic on clients.

Usage notes

Download and decompress the package, and go to the mns_topic_tool directory.

Test the authentication logic

Send an HTTP or HTTPS request to the endpoint that is specified by the host parameter. You cannot specify other parameters.

  • Command syntax:

    python mns_topic_tool.py notifymsg_withauth --host=http(s)://xxx

  • Example:HTTP authentication

Test the message processing logic

Send an HTTP or HTTPS request to the endpoint that is specified by the host parameter. You can specify multiple parameters, such as the body and format parameters.

However, the request does not contain a signature. Therefore, you must specify the authentication logic of the client. Otherwise, the message cannot be processed due to authentication failure.

  • Command syntax:

    python mns_topic_tool.py notifymsg_withoutauth --host=http(s)://xxx [--uri=xxx] [--body=xxx] [--base64=true/false] [--format=xml/simplfied] [--topicowner=xxx] [--topicname=xxx] [--subscriber=xxx] [--subname=xxx] [--pubtime=xxx]

    The following table describes the parameters.

    Parameter Description Default value
    uri The requested URI. /notifications
    body The body of the message. TestMessage
    base64 Specifies whether to perform Base64 encoding on the message. false
    format The content format of the request body. Valid values: xml and simplified. xml
    topicowner The TopicOwner parameter that is specified in the request body of the XML format. TestTopicOwner
    topicname The TopicName parameter that is specified in the request body of the XML format. TestTopicName
    subscriber The Subscriber parameter that is specified in the request body of the XML format. TestSubscriber
    subname The SubscriptionName parameter that is specified in the request body of the XML format. TestSubscriptionName
    pubtime The PublishTime parameter that is specified in the request body of the XML format. The current system time.
  • Example:Message processing logic