Geting Subscription Properties

Last updated: 2019-07-05 15:25:25

1. API Description

This API (GetSubscriptionAttributes) is used to acquire the attributes of a created subscription.

Domain for public network API request:

Domain for private network API request:

At any time (including alpha test), any downstream traffic generated when using public network domain will incur traffic fee. It is strongly recommended that users on Tencent Cloud use private network domain, as it will not incur any traffic fee.

  • The "region" should be replaced by a specific region: gz (Guangzhou), sh (Shanghai), bj (Beijing). The "region" value in the common parameter should be kept consistent with that in the domain. In case of inconsistency, the one in the domain should prevail. The request should be sent to the region specified by the domain.
  • Requests for accessing via public network domain support both HTTP and HTTPS. Requests for accessing via private network only support HTTP.
  • Some of the input parameters are optional, so the default values are not required.
  • All output parameters will be returned to the user when the request is successful; otherwise, at least code, message, and requestId will be returned.

2. Input Parameters

The following request parameter list only provides API request parameters. For other parameters, refer to Common Request Parameters.

Parameter Name Required Type Description
topicName Yes String Topic name. It is unique under the same account in a single region. Topic name is a string with no more than 64 characters. It must start with letter, and the rest may contain letters, numbers and dashes (-).
subscriptionName Yes String Subscription name. It is unique for the same topic under the same account in a single region. Subscription name is a string with no more than 64 characters. It must start with letter, and the rest may contain letters, numbers and dashes (-).

3. Output Parameters

Parameter Name Type Description
code Int 0: Succeeded. For the meanings of other returned values, please refer to Error Codes.
message String Error message.
requestId String ID of the request generated by server. When there is an internal error on the server, users can submit this ID to backend to locate the problem.
topicOwner String Topic owner's appid.
msgCount Int Number of messages waiting to be sent for the subscription.
protocol String Subscription protocol. Currently, two types of protocols are supported: HTTP, queue. When using HTTP protocol, users need to build web server to receive messages on their own. When using queue, messages will be automatically pushed to the CMQ queue and users can pull the messages concurrently.
endpoint String endpoint used to receive notification. It varies with the protocol: for HTTP, endpoint must start with "http://", and host can be either domain or IP; for queue, queueName is entered here.
notifyStrategy String Retry policy for the CMQ push server in case of errors when pushing messages to the endpoint. Available values are: 1) BACKOFF_RETRY (backoff retry). Re-push the message at regular intervals. Discard the message after a certain number of reties have been committed, then continue pushing the next message; 2) EXPONENTIAL_DECAY_RETRY (exponential decay retry). The interval between retries is increased exponentially, for example, retry in 1s first, then 2s, 4s, 8s...Since the cycle of a Topic message is one day, the retry operations will last for at most one day before the message is discarded. Default is EXPONENTIAL_DECAY_RETRY.
notifyContentFormat String Notification content format. Available values are: 1) JSON; 2) SIMPLIFIED, i.e. raw format. If the protocol is queue, the value must be SIMPLIFIED. If the protocol is HTTP, both values are available. Default is JSON.
createTime Int Subscription creation time. A Unix timestamp will be returned (accurate to second).
lastModifyTime Int The time when the subscription attributes were last modified. A Unix timestamp will be returned (accurate to second).
bindingKey String Array The filtering policy used for the subscribers to receive messages.

4. Example


 &<Common request parameters>


"code" : 0,
"message" : "",
"lastModifyTime": 1462269960