Mi Galaxy EMQ Book

createTag()


Create Tag

Method parameter CreateTagRequest

queueName : String : required

Name of Tag-related Queue

tagName : String : required

Name of Tag waiting to be created

startTimestamp : long : optional

The start timestamp of the tag. When this number is 0, it means to receive starting from the oldest remaining Message in the queue.
When this value is less than 0, it means to receive starting from the current time.
The default value is -1

userAttributes : Map< String, String > : optional

User-defined attributes associated with tags, such as tag descriptions

attributeName : String : optional
attributeValue : MessageAttribute : optional

attributeName is used together with attributeValue to filter the certain attributes of messages received via tags.
If these two parameters are not set, all messages in the Queue are received
If the attributeName is specified, the field type in the attributeValue is set to "empty", indicating that all messages with the attribute of the attributeName (case-sensitive) are received
. Otherwise, only those messages whose attributeName, attributeValue.type and attributeValue.value match at the same time will be received via Tag
For a detailed explanation of the MessageAttribute type, see sendMessage()

attributesFilter : AttributesFilter : optional

The backend implements a more efficient filtering interface for the filter conditions set by the attributes filter list and attributes filter logic. AttributesFilter includes 2 fields:

  • attributes : map< string, Message.MessageAttribute > : List of required filter attributes
  • logicalOperator : LogicalOperator : Required logical relationship between filter attributes, divided into AND and OR

Method return CreateTagResponse

queueName : String

Same as the queueName in request

tagName : String

Same as tagName in request

startTimestamp : long

The real start timestamp of the created Tag
When the timestamp in the creation request is less than or equal to 0, or less than the timestamp of the oldest Message retained in the Queue, this number will be greater than the value in the request

Note
Once a Tag is created, its attributes (including the start timestamp, filter, etc.) cannot be changed. If you need to adjust the attribute, you can only delete the tag and create it again.
Adding a tag will impose an additional burden on the EMQ system, so each Queue can create up to 20 corresponding tags (not adjustable).

deleteTag()


Delete Tag

Method parameter DeleteTagRequest

queueName : String : required
tagName : String : required

Method return void

listTag()


Lists the names of all the tags associated with a Queue

Method parameter ListTagRequest

queueName : String : required

Method return ListTagResponse

queueName : String
tagName : List< String >

getTagInfo()


Method parameter GetTagInfoRequest

queueName : String : required
tagName : String : optional

The name of the Tag to be obtained
When this value is null, get the Queue default tag information

Method return GetTagInfoResponse

queueName : String
tagName : String
startTimestamp : long

Tag start timestamp, same as value in CreateTagResponse
If it is the default tag of Queue, this value is 0

tagState : QueueState

For specific fields see the explanation in getQueueInfo().

userAttributes : Map< String, String >

User-defined attributes

attributeName : String

Constitutes the tag filter information together with the following attributeValue

attributeValue : MessageAttribute
attributesFilter : AttributesFilter : optional

Filtered attribute list and logical relationship