93 lines
5.4 KiB
C#
93 lines
5.4 KiB
C#
/*
|
||
* Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing,
|
||
* software distributed under the License is distributed on an
|
||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||
* KIND, either express or implied. See the License for the
|
||
* specific language governing permissions and limitations
|
||
* under the License.
|
||
*/
|
||
|
||
namespace TencentCloud.Cmq.V20190304.Models
|
||
{
|
||
using Newtonsoft.Json;
|
||
using System.Collections.Generic;
|
||
using TencentCloud.Common;
|
||
|
||
public class CreateSubscribeRequest : AbstractModel
|
||
{
|
||
|
||
/// <summary>
|
||
/// 主题名字,在单个地域同一帐号下唯一。主题名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。
|
||
/// </summary>
|
||
[JsonProperty("TopicName")]
|
||
public string TopicName{ get; set; }
|
||
|
||
/// <summary>
|
||
/// 订阅名字,在单个地域同一帐号的同一主题下唯一。订阅名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。
|
||
/// </summary>
|
||
[JsonProperty("SubscriptionName")]
|
||
public string SubscriptionName{ get; set; }
|
||
|
||
/// <summary>
|
||
/// 订阅的协议,目前支持两种协议:http、queue。使用http协议,用户需自己搭建接受消息的web server。使用queue,消息会自动推送到CMQ queue,用户可以并发地拉取消息。
|
||
/// </summary>
|
||
[JsonProperty("Protocol")]
|
||
public string Protocol{ get; set; }
|
||
|
||
/// <summary>
|
||
/// 接收通知的Endpoint,根据协议Protocol区分:对于http,Endpoint必须以“`http://`”开头,host可以是域名或IP;对于Queue,则填QueueName。 请注意,目前推送服务不能推送到私有网络中,因此Endpoint填写为私有网络域名或地址将接收不到推送的消息,目前支持推送到公网和基础网络。
|
||
/// </summary>
|
||
[JsonProperty("Endpoint")]
|
||
public string Endpoint{ get; set; }
|
||
|
||
/// <summary>
|
||
/// 向Endpoint推送消息出现错误时,CMQ推送服务器的重试策略。取值有:1)BACKOFF_RETRY,退避重试。每隔一定时间重试一次,重试够一定次数后,就把该消息丢弃,继续推送下一条消息;2)EXPONENTIAL_DECAY_RETRY,指数衰退重试。每次重试的间隔是指数递增的,例如开始1s,后面是2s,4s,8s...由于Topic消息的周期是一天,所以最多重试一天就把消息丢弃。默认值是EXPONENTIAL_DECAY_RETRY。
|
||
/// </summary>
|
||
[JsonProperty("NotifyStrategy")]
|
||
public string NotifyStrategy{ get; set; }
|
||
|
||
/// <summary>
|
||
/// 消息正文。消息标签(用于消息过滤)。标签数量不能超过5个,每个标签不超过16个字符。与(Batch)PublishMessage的MsgTag参数配合使用,规则:1)如果FilterTag没有设置,则无论MsgTag是否有设置,订阅接收所有发布到Topic的消息;2)如果FilterTag数组有值,则只有数组中至少有一个值在MsgTag数组中也存在时(即FilterTag和MsgTag有交集),订阅才接收该发布到Topic的消息;3)如果FilterTag数组有值,但MsgTag没设置,则不接收任何发布到Topic的消息,可以认为是2)的一种特例,此时FilterTag和MsgTag没有交集。规则整体的设计思想是以订阅者的意愿为主。
|
||
/// </summary>
|
||
[JsonProperty("FilterTag")]
|
||
public string[] FilterTag{ get; set; }
|
||
|
||
/// <summary>
|
||
/// BindingKey数量不超过5个, 每个BindingKey长度不超过64字节,该字段表示订阅接收消息的过滤策略,每个BindingKey最多含有15个“.”, 即最多16个词组。
|
||
/// </summary>
|
||
[JsonProperty("BindingKey")]
|
||
public string[] BindingKey{ get; set; }
|
||
|
||
/// <summary>
|
||
/// 推送内容的格式。取值:1)JSON;2)SIMPLIFIED,即raw格式。如果Protocol是queue,则取值必须为SIMPLIFIED。如果Protocol是http,两个值均可以,默认值是JSON。
|
||
/// </summary>
|
||
[JsonProperty("NotifyContentFormat")]
|
||
public string NotifyContentFormat{ get; set; }
|
||
|
||
|
||
/// <summary>
|
||
/// For internal usage only. DO NOT USE IT.
|
||
/// </summary>
|
||
internal override void ToMap(Dictionary<string, string> map, string prefix)
|
||
{
|
||
this.SetParamSimple(map, prefix + "TopicName", this.TopicName);
|
||
this.SetParamSimple(map, prefix + "SubscriptionName", this.SubscriptionName);
|
||
this.SetParamSimple(map, prefix + "Protocol", this.Protocol);
|
||
this.SetParamSimple(map, prefix + "Endpoint", this.Endpoint);
|
||
this.SetParamSimple(map, prefix + "NotifyStrategy", this.NotifyStrategy);
|
||
this.SetParamArraySimple(map, prefix + "FilterTag.", this.FilterTag);
|
||
this.SetParamArraySimple(map, prefix + "BindingKey.", this.BindingKey);
|
||
this.SetParamSimple(map, prefix + "NotifyContentFormat", this.NotifyContentFormat);
|
||
}
|
||
}
|
||
}
|
||
|