Distributed Message Service RocketMQ

Creating a Subscription Group

2024-07-04 06:32:04

API Introduction

Used to create a subscription group.

API Restrictions

None.

URl

POST     https://[endpoint]/v2/group/create

Request Parameters

Request Parameters

Required or Not

Position

Parameter Type

Description

prodInstId

Yes

body

String

Instance   ID

brokerNameList

Yes

body

List<String>

List of Broker Names

subscriptionGroupConfig

Yes

body

SubscriptionGroupConfig

Subscription Group Configuration

groupName

Yes

subscriptionGroupConfig

String

Subscription Group Name

consumeEnable

Yes

subscriptionGroupConfig

boolean

Whether to allow consumption? Default   value: true

firstConsumeMechanism

Yes

subscriptionGroupConfig

String

First offset

1. Specified by the client

2. The first message

3. The latest position

pullMechanism

Yes

subscriptionGroupConfig

String

Consumption   mechanism. Value: 1

Response Parameter

Response Parameter

Parameter Type

Description

statusCode

String

The   status code of the interface on the system layer. Success: 800; failure: 900.

message

String

Status   Description

returnObj

String

Return   the object. The parameters included in this parameter are described in the   comments in Response Examples.

Sample Request

POST     https://[endpoint]/v2/group/create

{

    "subscriptionGroupConfig":{

        "consumeEnable":true,

        "firstConsumeMechanism":"1",

        "groupName":"group2",

        "pullMechanism":"1"

 

    },

    "brokerNameList":[

        "mq_test_broker_1"

    ],

    "prodInstId":"mq_test"

}

Examples of a Successful Response

{

    "returnObj":{

 

    },

    "message":"success",

    "statusCode":800

}Example of a Failed Response

{

    "returnObj": {},

    "message": "...",

    "statusCode": "900"

}


DSUzrdKLAeZF