Cloud Storage 구독은 수신되는 메시지를 기존 Cloud Storage 버킷에 기록하는 내보내기 구독 유형입니다. 별도의 구독자 클라이언트를 구성할 필요가 없습니다.
Google Cloud 콘솔, Google Cloud CLI, 클라이언트 라이브러리 또는 Pub/Sub API를 사용하여 Cloud Storage 구독을 생성, 업데이트, 나열, 분리, 삭제합니다.
Cloud Storage 구독 유형이 없으면 메시지를 읽고 Cloud Storage 버킷에 작성하는 구독자(예: Dataflow)와 풀 또는 푸시 구독이 필요합니다. 메시지를 Cloud Storage 버킷에 저장하기 전에 추가 처리가 필요하지 않은 경우 Dataflow 작업을 실행하는 오버헤드가 필요하지 않습니다. 대신 Cloud Storage 구독을 사용할 수 있습니다.
그러나 데이터를 Cloud Storage 버킷에 저장하기 전에 일부 데이터 변환이 필요한 Pub/Sub 시스템에는 여전히 Dataflow 파이프라인이 권장됩니다.
다음 이미지는 Cloud Storage 구독과 Cloud Storage 간의 워크플로를 보여줍니다.
그림 1. Cloud Storage 구독 워크플로
다음은 그림 1을 참조하는 워크플로에 대한 간략한 설명입니다.
Pub/Sub는 Cloud Storage API를 사용하여 Cloud Storage 버킷으로 데이터를 전송합니다. 쓰기 작업이 성공적으로 완료되면 API가 OK 응답을 반환합니다.
메시지가 일괄적으로 Cloud Storage 버킷에 전송됩니다.
단일 배치는 Cloud Storage 버킷에 저장된 객체에 해당합니다. 객체 크기와 객체 생성 후 경과 시간을 기반으로 일괄 설정을 구성할 수 있습니다.
Cloud Storage 버킷에 객체를 쓰는 워크플로에는 OK 응답이 두 개 필요합니다. 첫 번째 OK 응답은 메시지가 객체에 성공적으로 작성되면 전송됩니다. 두 번째 OK 응답은 메시지가 포함된 객체가 완료되면 전송됩니다. 메시지는 메시지가 포함된 Cloud Storage 객체가 성공적으로 완료된 후에만 버킷에 표시됩니다.
쓰기 작업 중에 오류가 발생하면 Pub/Sub 메시지 자체가 부정적으로 확인됩니다.
그러면 메시지가 다시 전송됩니다. 메시지 쓰기 작업이 충분히 실패하고 구독에 데드 레터 주제가 구성된 경우 메시지는 데드 레터 주제로 이동합니다.
Cloud Storage 구독의 속성
Cloud Storage 구독을 만들 때 몇 가지 추가 속성을 지정해야 합니다. 이러한 속성에는 일반적인 구독 속성, 파일 이름 및 형식 요구사항, 스토리지 요구사항 등이 포함됩니다.
이러한 속성에 대한 자세한 내용은 Cloud Storage 구독 속성을 참조하세요.
메시지 처리 실패
Pub/Sub 메시지를 Cloud Storage 버킷에 쓸 수 없으면 메시지를 확인할 수 없습니다.
이러한 전송할 수 없는 메시지를 전달하려면 Cloud Storage 구독에서 데드 레터 주제를 구성합니다.
Pub/Sub가 Cloud Storage에 메시지를 쓸 수 없으면 Pub/Sub는 push 백오프 동작과 비슷한 방식으로 메시지 전송을 중단합니다.
할당량
할당량 제한은 각 리전의 Cloud Storage 구독자 처리량에 적용됩니다. Cloud Storage 구독의 할당량에 대한 자세한 내용은 Pub/Sub 할당량 및 한도의 내보내기 구독자 할당량 한도를 참고하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["A Cloud Storage subscription is a type of export subscription\nthat writes messages to an existing Cloud Storage bucket as\nthey are received. You don't need to configure a separate subscriber client.\nUse the Google Cloud console, the Google Cloud CLI, the client libraries, or\nthe Pub/Sub API to create, update, list, detach, or delete a\nCloud Storage subscription.\n| **Key Point:** Understand the workflow for a Cloud Storage subscription and read about the permissions, properties, quotas, and pricing related to the subscription.\n\nWithout the Cloud Storage subscription type,\nyou need a pull or push subscription and a subscriber\n(such as Dataflow) that reads messages and writes them to\na Cloud Storage bucket. The overhead of running a\nDataflow job is not necessary when messages don't require\nadditional processing before storing them in a Cloud Storage bucket;\nyou can use a Cloud Storage subscription instead.\n\nHowever, a Dataflow pipeline is still recommended for\nPub/Sub systems where some data transformation is required\nbefore the data is stored in a Cloud Storage bucket.\n\nTo learn how to stream data from Pub/Sub to\nCloud Storage with transformation by using Dataflow,\nsee [Stream messages from Pub/Sub by using Dataflow](/pubsub/docs/stream-messages-dataflow).\n\nBefore you begin\n\nBefore reading this document, ensure that you're familiar with the following:\n\n- How [Pub/Sub works](/pubsub/docs/overview) and the\n different Pub/Sub terms.\n\n- What are the different [kinds of subscriptions](/pubsub/docs/subscriber)\n and why you might want to use a Cloud Storage subscription.\n\n- How [Cloud Storage](/storage/docs) works.\n\nCloud Storage subscription workflow\n\nThe following image shows the workflow between a Cloud Storage\nsubscription and Cloud Storage.\n\n**Figure 1.** Workflow for a Cloud Storage subscription\n\nHere is a brief description of the workflow that references Figure 1:\n\n1. Pub/Sub uses the Cloud Storage API to send data\n to the Cloud Storage bucket. After a successful completion of a\n write operation, the API returns an `OK` response.\n\n2. The messages are sent in batches to the Cloud Storage bucket.\n A single batch corresponds to an [object](/storage/docs/objects) that is stored in the\n Cloud Storage bucket. You can configure the batch settings based on\n the object size and time elapsed since the object was created.\n\n3. The workflow to write an object to a Cloud Storage bucket requires\n two `OK` responses. The first `OK` response is sent when a message is\n successfully written to an object. The second `OK` response is sent when the\n object containing the message is finalized. A message only becomes visible\n in the bucket after the Cloud Storage object containing it has\n been successfully finalized.\n\n4. If there are any failures during the write operation, the\n Pub/Sub message itself is negatively acknowledged.\n The message is then re-sent. If the message write operation fails enough times and\n you have a dead letter topic configured on the subscription, then\n the message is moved to the dead letter topic.\n\nProperties of a Cloud Storage subscription\n\nWhen you create a Cloud Storage subscription, you must specify\nsome additional properties. These properties include common subscription\nproperties, filename and format requirements, storage requirements and more.\nTo learn more about these properties, see [Cloud Storage subscription properties](/pubsub/docs/create-cloudstorage-subscription#subscription_properties).\n\nHandle message failures\n\nWhen a Pub/Sub message cannot be written to a\nCloud Storage bucket, the message cannot be acknowledged.\nTo forward such undeliverable messages, configure a\n[dead-letter topic](/pubsub/docs/handling-failures#dead-letter_topic)\non the Cloud Storage subscription.\n\nIf Pub/Sub cannot write messages to Cloud Storage,\nthen Pub/Sub backs off delivery of messages in a way similar to\n[push backoff behavior](/pubsub/docs/push#push_backoff).\n\nQuotas\n\nQuota limitations apply to the Cloud Storage subscriber throughput\nfor each region. For information about the quotas for Cloud Storage\nsubscriptions, see export subscriber quota limits in [Pub/Sub quotas and limits](/pubsub/quotas).\n\nPricing\n\nFor information about the pricing for Cloud Storage\nsubscriptions, see the [Pub/Sub pricing page](/pubsub/pricing#cloudstorage).\n\nWhat's next\n\n- Create a [Cloud Storage subscription](/pubsub/docs/create-cloudstorage-subscription).\n- Troubleshoot a [Cloud Storage subscription](/pubsub/docs/cloudstorage-troubleshooting).\n\n- Explore Pub/Sub configuration tools:\n\n - [`gcloud` CLI commands](/sdk/gcloud/reference/pubsub/subscriptions)\n - [Pub/Sub APIs](/pubsub/docs/reference/service_apis_overview)\n - [Pub/Sub client libraries](/pubsub/docs/reference/libraries)"]]