Skip to main content

Create and manage subscription

This guide explains how to create and manage subscriptions.

Create subscription​

Messages published to a topic can be received via subscriptions. Subscriptions support three message delivery types: Pull, Push, and Object Storage. The following describes how to create a subscription in the Pub/Sub service.

info

Each project can create up to 10 subscriptions. (View Pub/Sub quota)

  1. Go to KakaoCloud Console > Analytics > Pub/Sub.
  2. In the Subscription menu, click the [Create subscription] button.
  3. In the Create subscription form, enter the required information and click the [Create] button.
Basic settings​
ItemDescription
NameSet subscription name
Select topicSelect topic to associate with the subscription
TypeSee detailed settings by type
Pull: User requests message delivery
Push: Pub/Sub sends messages to user-defined endpoint
Object Storage: Messages are sent to a storage bucket
Subscription message retention periodSet retention period for messages
- Range: 10 minutes to 7 days
- Must be equal to or less than the topic’s retention period
Attribute filter (optional)Configure a filter expression to select messages by attribute values
⚠️ Available only when creating a subscription; cannot be changed after creation
Detailed settings by type​

Pull type

ItemDescription
Max delivery attemptsNumber of times to retry delivery if no response within wait time
- Specify attempts: 1–100
- Unlimited retries: retry indefinitely
Acknowledgment wait timeTime to wait for message acknowledgment
- Range: 10–600 seconds (10 minutes)

Push type

ItemDescription
Endpoint URLEnter the URL to receive published messages
 - Protocol: HTTP/HTTPS
 - Security group inbound rules must be configured
Message delivery formatConfigure JSON wrapping and metadata handling
- Default delivery: JSON format containing message data and metadata
- Unwrapped payload: Only the decoded message data is sent in the body; metadata inclusion can be configured additionally
   - Include metadata: Can be configured when the unwrapped payload option is selected
Max delivery attemptsNumber of times to retry delivery if no response within wait time
- Specify attempts: 1–100
- Unlimited retries: retry indefinitely
Acknowledgment wait timeTime to wait for message acknowledgment
- Range: 10–600 seconds (10 minutes)

Object Storage type

ItemDescription
BucketSelect Object Storage bucket to receive messages
⚠️ Bucket must be pre-created in Object Storage
File formatOutput file format stored in bucket
- Text: Currently only Text format is supported
File prefix (optional)Adds a prefix to all output files
- Certain characters (\ : * ? ” < > |) and leading / are not allowed
- Consecutive slashes (//) are not allowed
⚠️ Total length of prefix and suffix must not exceed 200 bytes
File suffix (optional)Adds a suffix to all output files
- Certain characters (\ : * ? ” < > |) are not allowed
- Consecutive slashes (//) are not allowed
Max batch durationTime interval for saving files to bucket
- Min: 1 min
- Max: 10 min
- Default: 5 min

⚠️ At least one file is generated per interval. Files may be generated before interval ends.
Export channel countNumber of channels to export messages to Object Storage
- Adjust based on message volume
- Min: 1
- Max: 16
- Default: 1

⚠️ Number of channels may differ from the number of output files
info

When creating an Object Storage subscription, an export channel is automatically activated.
Use the [Start export] / [Stop export] options in the subscription detail page to resume or stop export to the bucket.

Message filter​

Select messages to receive based on their attribute values. Filters are supported for all three subscription types: Pull, Push, and Object Storage.

caution
  • A filter expression can be configured only when creating a subscription. It cannot be changed or deleted afterward.
  • To change a filter expression, create a new subscription.
  • Messages that do not match the filter are not delivered and are not included in the unprocessed message count.
Filter syntax​
CategoryFunction/operatorSyntaxDescription
EqualityhasKeyhasKey("key")Process only messages containing the specified key
hasValuehasValue("key", "value")Process only messages where the specified key has the matching value
InequalityNOT hasKeyNOT hasKey("key")Process only messages without the specified key
NOT hasValueNOT hasValue("key", "value")Process only messages where the specified key does not have the matching value
Logical operationsAND, OR, NOThasKey("a") AND (hasValue("b", "c") OR hasValue("b", "d"))Combine functions with logical operators
⚠️ Use parentheses to specify precedence when combining AND and OR
PrefixhasPrefixhasPrefix("key", "prefixName")Process only messages where the specified key's value starts with a specific prefix
Filter restrictions​
ItemRestriction
Scopeattributes.* (message attributes only)
Supported typestring
LengthMaximum 256 bytes for the entire filter expression
Case sensitivityOperators (AND, OR, NOT) must be uppercase; keys and values are case-sensitive
Filter syntax examples​

Write filter expressions based on message attributes as shown below.

Filter by key existence​
IntentFilter expressionMessage attributesResult
Deliver only messages with a name keyhasKey("name"){"name": "Alice", "age": "30"}Delivered (name key exists)
Deliver only messages without a name keyNOT hasKey("name"){"name": "Alice", "age": "30"}Not delivered (name key exists)
Filter by matching value​
IntentFilter expressionMessage attributesResult
Deliver only messages where age is 30hasValue("age", "30"){"name": "Alice", "age": "30"}Delivered (age is 30)
Deliver only messages where age is not 20NOT hasValue("age", "20"){"name": "Alice", "age": "30"}Delivered (age is 30)
Deliver only messages where age is not 20NOT hasValue("age", "20"){"name": "Alice", "age": "20"}Not delivered (age is 20)
Filter by matching prefix​
IntentFilter expressionMessage attributesResult
Deliver only messages where address starts with Seoul-hasPrefix("address", "Seoul-"){"address": "Seoul-Gangnam"}Delivered (starts with Seoul-)
Deliver only messages where address does not start with Seoul-NOT hasPrefix("address", "Seoul-"){"address": "Busan-Haeundae"}Delivered (does not start with Seoul-)
Deliver only messages where address does not start with Seoul-NOT hasPrefix("address", "Seoul-"){"address": "Seoul-Gangnam"}Not delivered (starts with Seoul-)
Filter by combined conditions​
IntentFilter expressionMessage attributesResult
Deliver only messages where name is Alice and age is 30 or 40hasValue("name", "Alice") AND (hasValue("age", "30") OR hasValue("age", "40")){"name": "Alice", "age": "30"}Delivered (name=Alice, age=30)
Same as aboveSame as above{"name": "Alice", "age": "20"}Not delivered (age=20 does not match)

Manage subscription​

Describes how to manage subscriptions in the Pub/Sub service.

View subscription list​

Check the list of existing subscriptions and their basic information.

  1. Go to KakaoCloud Console > Analytics > Pub/Sub.

  2. In the Subscription menu, check the subscription list.

    ItemDescription
    NameName of the subscription set by user
    StatusSubscription status
    TypeType of subscription
    - Pull: User requests message delivery
    - Push: Pub/Sub sends messages to endpoint
    - Object Storage: Messages sent to bucket
    Topic nameName of topic associated with the subscription
    Message retentionSubscription message retention period
    Acknowledgment wait timeTime to wait for message acknowledgment
    Export statusExport channel status (Object Storage only)
    CreatorUser who created the subscription
    [More options][Edit]: Modify subscription settings
    [Delete]: Delete subscription
    [Rewind]: Rewind subscription
    [Start export]: Activate the message export channel for Object Storage subscriptions
    [Stop export]: Deactivate the message export channel for Object Storage subscriptions

View subscription details​

Check detailed information for a subscription.

  1. Go to KakaoCloud Console > Analytics > Pub/Sub.

  2. In the Subscription menu, select the subscription to view.

  3. Review information on the subscription detail page.

    Basic information

    ItemDescription
    Summary- Type: Subscription type
    - Status: Subscription status
    - Export status: Whether export channel is active
    - Retention: Message retention period
    Subscription nameName of the subscription
    Subscription IDUnique ID of the subscription
    Message retentionMessage retention period
    Attribute filterConfigured filter expression, or - if none is configured
    ⚠️ Cannot be changed after creation
    Unprocessed messagesCount of unprocessed messages
    *Aggregation may take time; messages that exceed the max delivery attempts are excluded.
    CreatorUser who created the subscription
    Created atTimestamp when the subscription was created
    [Button info][Edit], [Delete], [Rewind], [Start export], [Stop export]
Type-specific settings​

Settings vary by subscription type. See Detailed settings by type.

Modify subscription​

Modify detailed subscription settings.

info

Currently, subscription retention period can only be extended. Reducing the period will be supported in a future update.

  1. Go to KakaoCloud Console > Analytics > Pub/Sub.

  2. In the Subscription menu, click [More options] > Edit.

  3. In the Edit subscription form, update settings and click [Save].

    Common

    ItemDescription
    Message retentionPeriod to retain subscription messages
    - Range: 10 minutes to 7 days
    * Must be shorter than the topic’s retention period

    Pull-type settings

    ItemDescription
    Acknowledgment wait timeTime to wait for message acknowledgment
    - Range: 10–600 seconds
    Max delivery attemptsNumber of retry attempts if no acknowledgment
    - Specify: 1–100
    - Unlimited: Retry indefinitely

    Push-type settings

    ItemDescription
    Endpoint URLEndpoint URL set when creating Push subscription
     - Protocol: HTTP/HTTPS
    Message delivery formatConfigure JSON wrapping and metadata handling
    - Default delivery: JSON format containing message data and metadata
    - Unwrapped payload: Only the decoded message data is sent in the body; metadata inclusion can be configured additionally
       - Include metadata: Can be configured when the unwrapped payload option is selected
    Acknowledgment wait timeTime to wait for message acknowledgment
    - Range: 10–600 seconds
    Max delivery attemptsNumber of retry attempts if no acknowledgment
    - Specify: 1–100
    - Unlimited: Retry indefinitely

    Object Storage-type settings

    ItemDescription
    BucketSelect Object Storage bucket for message delivery
    File formatOutput file format
    - Currently only Text is supported
    File prefix (optional)Adds prefix to output files
    - Invalid: \ : * ? ” < > |, leading /, //
    ⚠️ Total of prefix + suffix must not exceed 200 bytes
    File suffix (optional)Adds suffix to output files
    - Invalid: \ : * ? ” < > |, //
    Max batch durationInterval to store files to bucket
    - Min: 1 min
    - Max: 10 min
    - Default: 5 min
      ⚠️ May not apply immediately if unprocessed messages exist. Recommend modifying after queue is clear.
    Export channel countNumber of export channels
    - Min: 1, Max: 16, Default: 1

Rewind timestamp​

Rewinds the subscription to a specific point in time, allowing replay of all messages from that time onward.
Messages that expired due to topic retention settings cannot be recovered.

info

Rewind time cannot be set to a time before the associated topic was created.

  1. Go to KakaoCloud Console > Analytics > Pub/Sub.
  2. In the Subscription menu, click [More options] > Rewind.
  3. In the Rewind subscription popup, set the timestamp and click [Rewind].

Delete subscription​

Delete a subscription that is no longer needed.

info

Deleted subscriptions cannot be recovered.

  1. Go to KakaoCloud Console > Analytics > Pub/Sub.
  2. In the Subscription menu, click [More options] > Delete on the target subscription.
  3. In the Delete subscription popup, enter the subscription name and click [Delete].

Monitor subscription​

Monitor the selected subscription’s metrics.

info

During subscription monitoring, aggregation of unprocessed messages may take time. Messages that exceed the maximum number of processing attempts are excluded.

  1. Go to KakaoCloud Console > Analytics > Pub/Sub.

  2. In the Subscription menu, select the subscription to monitor.

  3. Click the Monitoring tab.

    ItemDescription
    Data rangeTime range displayed in monitoring graph
    - Options: 1 hour (default) / 3 hours / 12 hours / 1 day / 7 days
    View modeLayout options for graph view
    - 1-column, 2-column, 3-column
    Auto-refresh intervalSet auto-refresh rate
    - Options: No auto-refresh (default) / 10s / 30s / 1min / 5min
    Manual refreshClick to manually refresh monitoring data

    PULL subscription metrics

    Metric nameUnitDescription
    Processed messages per secondcount/sSeparate per-second counts for pulled messages, acknowledged messages, and messages that do not match the filter
    Unprocessed messagescountNumber of unprocessed messages
    *When a filter is configured, only messages selected for delivery are included
    Rewind requests (5 min)countNumber of rewind requests within 5 minutes
    Ack requests per secondcount/sAcknowledgment request rate
    Streaming pull responses per secondcount/sStreaming pull response rate
    Retained databytesTotal size of retained data in subscription

    PUSH subscription metrics

    Metric nameUnitDescription
    Processed messages per secondcount/sSeparate per-second counts for pushed messages, acknowledged messages, and messages that do not match the filter
    Unprocessed messagescountNumber of unprocessed messages
    *When a filter is configured, only messages selected for delivery are included
    Rewind requests (5 min)countNumber of rewind requests within 5 minutes
    Ack requests per secondcount/sAcknowledgment request rate
    Push requests per secondcount/sPush request rate
    Retained databytesTotal size of retained data in subscription

    Object Storage subscription metrics

    Metric nameUnitDescription
    Processed messages per secondcount/sSeparate per-second counts for exported messages and messages that do not match the filter
    Unprocessed messagescountNumber of unprocessed messages
    *When a filter is configured, only messages selected for delivery are included
    Rewind requests (5 min)countNumber of rewind requests within 5 minutes
    Export requests per minutecount/mNumber of export API requests per minute
    Retained databytesTotal size of retained data in subscription