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.
Each project can create up to 10 subscriptions. (View Pub/Sub quota)
- Go to KakaoCloud Console > Analytics > Pub/Sub.
- In the Subscription menu, click the [Create subscription] button.
- In the Create subscription form, enter the required information and click the [Create] button.
Basic settings
| Item | Description |
|---|---|
| Name | Set subscription name |
| Select topic | Select topic to associate with the subscription |
| Type | See 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 period | Set 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
| Item | Description |
|---|---|
| Max delivery attempts | Number of times to retry delivery if no response within wait time - Specify attempts: 1–100 - Unlimited retries: retry indefinitely |
| Acknowledgment wait time | Time to wait for message acknowledgment - Range: 10–600 seconds (10 minutes) |
Push type
| Item | Description |
|---|---|
| Endpoint URL | Enter the URL to receive published messages - Protocol: HTTP/HTTPS - Security group inbound rules must be configured |
| Message delivery format | Configure 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 attempts | Number of times to retry delivery if no response within wait time - Specify attempts: 1–100 - Unlimited retries: retry indefinitely |
| Acknowledgment wait time | Time to wait for message acknowledgment - Range: 10–600 seconds (10 minutes) |
Object Storage type
| Item | Description |
|---|---|
| Bucket | Select Object Storage bucket to receive messages ⚠️ Bucket must be pre-created in Object Storage |
| File format | Output 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 duration | Time 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 count | Number 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 |
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.
- 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
| Category | Function/operator | Syntax | Description |
|---|---|---|---|
| Equality | hasKey | hasKey("key") | Process only messages containing the specified key |
| hasValue | hasValue("key", "value") | Process only messages where the specified key has the matching value | |
| Inequality | NOT hasKey | NOT hasKey("key") | Process only messages without the specified key |
| NOT hasValue | NOT hasValue("key", "value") | Process only messages where the specified key does not have the matching value | |
| Logical operations | AND, OR, NOT | hasKey("a") AND (hasValue("b", "c") OR hasValue("b", "d")) | Combine functions with logical operators ⚠️ Use parentheses to specify precedence when combining AND and OR |
| Prefix | hasPrefix | hasPrefix("key", "prefixName") | Process only messages where the specified key's value starts with a specific prefix |
Filter restrictions
| Item | Restriction |
|---|---|
| Scope | attributes.* (message attributes only) |
| Supported type | string |
| Length | Maximum 256 bytes for the entire filter expression |
| Case sensitivity | Operators (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
| Intent | Filter expression | Message attributes | Result |
|---|---|---|---|
| Deliver only messages with a name key | hasKey("name") | {"name": "Alice", "age": "30"} | Delivered (name key exists) |
| Deliver only messages without a name key | NOT hasKey("name") | {"name": "Alice", "age": "30"} | Not delivered (name key exists) |
Filter by matching value
| Intent | Filter expression | Message attributes | Result |
|---|---|---|---|
| Deliver only messages where age is 30 | hasValue("age", "30") | {"name": "Alice", "age": "30"} | Delivered (age is 30) |
| Deliver only messages where age is not 20 | NOT hasValue("age", "20") | {"name": "Alice", "age": "30"} | Delivered (age is 30) |
| Deliver only messages where age is not 20 | NOT hasValue("age", "20") | {"name": "Alice", "age": "20"} | Not delivered (age is 20) |
Filter by matching prefix
| Intent | Filter expression | Message attributes | Result |
|---|---|---|---|
| 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
| Intent | Filter expression | Message attributes | Result |
|---|---|---|---|
| Deliver only messages where name is Alice and age is 30 or 40 | hasValue("name", "Alice") AND (hasValue("age", "30") OR hasValue("age", "40")) | {"name": "Alice", "age": "30"} | Delivered (name=Alice, age=30) |
| Same as above | Same 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.
-
Go to KakaoCloud Console > Analytics > Pub/Sub.
-
In the Subscription menu, check the subscription list.
Item Description Name Name of the subscription set by user Status Subscription status Type Type of subscription
- Pull: User requests message delivery
- Push: Pub/Sub sends messages to endpoint
- Object Storage: Messages sent to bucketTopic name Name of topic associated with the subscription Message retention Subscription message retention period Acknowledgment wait time Time to wait for message acknowledgment Export status Export channel status (Object Storage only) Creator User 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.
-
Go to KakaoCloud Console > Analytics > Pub/Sub.
-
In the Subscription menu, select the subscription to view.
-
Review information on the subscription detail page.
Basic information
Item Description Summary - Type: Subscription type
- Status: Subscription status
- Export status: Whether export channel is active
- Retention: Message retention periodSubscription name Name of the subscription Subscription ID Unique ID of the subscription Message retention Message retention period Attribute filter Configured filter expression, or - if none is configured
⚠️ Cannot be changed after creationUnprocessed messages Count of unprocessed messages
*Aggregation may take time; messages that exceed the max delivery attempts are excluded.Creator User who created the subscription Created at Timestamp 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.
Currently, subscription retention period can only be extended. Reducing the period will be supported in a future update.
-
Go to KakaoCloud Console > Analytics > Pub/Sub.
-
In the Subscription menu, click [More options] > Edit.
-
In the Edit subscription form, update settings and click [Save].
Common
Item Description Message retention Period to retain subscription messages
- Range: 10 minutes to 7 days
* Must be shorter than the topic’s retention periodPull-type settings
Item Description Acknowledgment wait time Time to wait for message acknowledgment
- Range: 10–600 secondsMax delivery attempts Number of retry attempts if no acknowledgment
- Specify: 1–100
- Unlimited: Retry indefinitelyPush-type settings
Item Description Endpoint URL Endpoint URL set when creating Push subscription
- Protocol: HTTP/HTTPSMessage delivery format Configure 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 selectedAcknowledgment wait time Time to wait for message acknowledgment
- Range: 10–600 secondsMax delivery attempts Number of retry attempts if no acknowledgment
- Specify: 1–100
- Unlimited: Retry indefinitelyObject Storage-type settings
Item Description Bucket Select Object Storage bucket for message delivery File format Output file format
- Currently only Text is supportedFile prefix (optional) Adds prefix to output files
- Invalid: \ : * ? ” < > |, leading/,//
⚠️ Total of prefix + suffix must not exceed 200 bytesFile suffix (optional) Adds suffix to output files
- Invalid: \ : * ? ” < > |,//Max batch duration Interval to store files to bucket
- Min:1min
- Max:10min
- Default:5min
⚠️ May not apply immediately if unprocessed messages exist. Recommend modifying after queue is clear.Export channel count Number 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.
Rewind time cannot be set to a time before the associated topic was created.
- Go to KakaoCloud Console > Analytics > Pub/Sub.
- In the Subscription menu, click [More options] > Rewind.
- In the Rewind subscription popup, set the timestamp and click [Rewind].
Delete subscription
Delete a subscription that is no longer needed.
Deleted subscriptions cannot be recovered.
- Go to KakaoCloud Console > Analytics > Pub/Sub.
- In the Subscription menu, click [More options] > Delete on the target subscription.
- In the Delete subscription popup, enter the subscription name and click [Delete].
Monitor subscription
Monitor the selected subscription’s metrics.
During subscription monitoring, aggregation of unprocessed messages may take time. Messages that exceed the maximum number of processing attempts are excluded.
-
Go to KakaoCloud Console > Analytics > Pub/Sub.
-
In the Subscription menu, select the subscription to monitor.
-
Click the Monitoring tab.
Item Description Data range Time range displayed in monitoring graph
- Options: 1 hour (default) / 3 hours / 12 hours / 1 day / 7 daysView mode Layout options for graph view
- 1-column, 2-column, 3-columnAuto-refresh interval Set auto-refresh rate
- Options: No auto-refresh (default) / 10s / 30s / 1min / 5minManual refresh Click to manually refresh monitoring data PULL subscription metrics
Metric name Unit Description Processed messages per second count/s Separate per-second counts for pulled messages, acknowledged messages, and messages that do not match the filter Unprocessed messages count Number of unprocessed messages
*When a filter is configured, only messages selected for delivery are includedRewind requests (5 min) count Number of rewind requests within 5 minutes Ack requests per second count/s Acknowledgment request rate Streaming pull responses per second count/s Streaming pull response rate Retained data bytes Total size of retained data in subscription PUSH subscription metrics
Metric name Unit Description Processed messages per second count/s Separate per-second counts for pushed messages, acknowledged messages, and messages that do not match the filter Unprocessed messages count Number of unprocessed messages
*When a filter is configured, only messages selected for delivery are includedRewind requests (5 min) count Number of rewind requests within 5 minutes Ack requests per second count/s Acknowledgment request rate Push requests per second count/s Push request rate Retained data bytes Total size of retained data in subscription Object Storage subscription metrics
Metric name Unit Description Processed messages per second count/s Separate per-second counts for exported messages and messages that do not match the filter Unprocessed messages count Number of unprocessed messages
*When a filter is configured, only messages selected for delivery are includedRewind requests (5 min) count Number of rewind requests within 5 minutes Export requests per minute count/m Number of export API requests per minute Retained data bytes Total size of retained data in subscription