Files
g.hnyhua.cn/TencentCloud/Cmq/V20190304/Models/CreateSubscribeRequest.cs
2026-02-07 15:48:27 +08:00

93 lines
5.4 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* 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区分对于httpEndpoint必须以“`http://`”开头host可以是域名或IP对于Queue则填QueueName。 请注意目前推送服务不能推送到私有网络中因此Endpoint填写为私有网络域名或地址将接收不到推送的消息目前支持推送到公网和基础网络。
/// </summary>
[JsonProperty("Endpoint")]
public string Endpoint{ get; set; }
/// <summary>
/// 向Endpoint推送消息出现错误时CMQ推送服务器的重试策略。取值有1BACKOFF_RETRY退避重试。每隔一定时间重试一次重试够一定次数后就把该消息丢弃继续推送下一条消息2EXPONENTIAL_DECAY_RETRY指数衰退重试。每次重试的间隔是指数递增的例如开始1s后面是2s4s8s...由于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>
/// 推送内容的格式。取值1JSON2SIMPLIFIED即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);
}
}
}