다음을 통해 공유


소비자 그룹 만들기

새 소비자 그룹을 만듭니다. 소비자 그룹을 만들 때 ConsumerGroupDescription에서 다음 속성을 지정할 수 있습니다. 속성을 지정하지 않으면 Event Hubs는 해당 속성의 기본값을 사용합니다. ConsumerGroupDescription 속성을 참조하세요.

ConsumerGroupDescription 속성의 기본값:

속성 이름 기본값
UserMetadata (empty)

요청

메서드 요청 URI
PUT https://{servicebusNamespace}.servicebus.windows.net/{eventHubPath}/consumergroups/{consumergroupName}

요청 헤더

Event Hubs와 관련된 모든 요청에 사용되는 헤더 및 매개 변수에 대한 일반적인 매개 변수 및 헤더를 참조하세요.

응답

응답에는 HTTP 상태 코드, 응답 헤더 집합 및 응답 본문이 포함되어 있습니다.

요소 이름 필수 Type 버전 Description
CreatedAt 예, 읽기 전용 string 2014-01 소비자 그룹을 만든 정확한 시간입니다.
UpdatedAt 예, 읽기 전용 문자열 2014-01 소비자 그룹이 업데이트된 정확한 시간입니다.

응답 코드

코드 Description
201 만들어졌습니다.
400 잘못된 요청입니다.
401 인증 실패
403 할당량을 초과했습니다. 소비자 그룹이 만들어지지 않았습니다.
409 지정된 소비자 그룹이 이미 있거나 지정된 경로가 이미 점유되어 있습니다.
500 내부 오류입니다.

응답 본문

요청이 성공하면 응답 본문에 지정된 소비자 그룹에 대한 설명이 포함됩니다. 요청이 성공하지 못하면 본문에 오류 코드와 오류 메시지가 포함됩니다.

예제

요청

참고

공통 매개 변수 및 헤더에 설명된 대로 권한 부여 헤더에 Azure Active Directory 토큰을 사용할 수도 있습니다. 예: Authorization: Bearer <Azure AD token>

PUT https://your-namespace.servicebus.windows.net/your-event-hub/consumergroups/testCG?timeout=60&api-version=2014-01 HTTP/1.1  
Authorization: SharedAccessSignature sr=https%3A%2F%2Fyour-namespace.servicebus.windows.net%2F&sig=your-sas-key&se=1455847106&skn=RootManageSharedAccessKey  
Content-Type: application/atom+xml;type=entry;charset=utf-8  
Host: your-namespace.servicebus.windows.net  
  
<entry xmlns="http://www.w3.org/2005/Atom">  
   <content type="application/xml">  
      <ConsumerGroupDescription xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">  
      </ConsumerGroupDescription>  
   </content>  
</entry>  
  

응답

HTTP/1.1 201 Created  
Content-Type: application/atom+xml;type=entry;charset=utf-8  
Server: Microsoft-HTTPAPI/2.0  
Date: Fri, 19 Feb 2016 01:52:50 GMT  
Content-Length: 776  
  
<?xml version="1.0" encoding="UTF-8"?>  
<entry xmlns="http://www.w3.org/2005/Atom">  
   <id>https://your-namespace.servicebus.windows.net/your-event-hub/consumergroups/testCG?timeout=60&api-version=2014-01</id>  
   <title type="text">testCG</title>  
   <published>2016-02-19T01:52:50Z</published>  
   <updated>2016-02-19T01:52:50Z</updated>  
   <link rel="self" href="https://your-namespace.servicebus.windows.net/your-event-hub/consumergroups/testCG?timeout=60&api-version=2014-01" />  
   <content type="application/xml">  
      <ConsumerGroupDescription xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">  
         <CreatedAt>2016-02-19T01:52:50.570652Z</CreatedAt>  
         <UpdatedAt>2016-02-19T01:52:50.570652Z</UpdatedAt>  
      </ConsumerGroupDescription>  
   </content>  
</entry>