Add topic module
mq_add_topicAdd a JMS topic helper module to a Ballerina project, creating a publish function and optional durable subscriber for pub/sub messaging.
Instructions
Add a topic (pub/sub) helper module to an existing project: creates modules//.bal with a publish() function that sends to "topic://". Subscribers are created as Listener services (use mq_add_listener with type=topic, optionally durable=true + subscriber_name). Does not overwrite unless overwrite=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| durable | No | Generate a DURABLE subscriber (survives disconnects). Requires subscriber_name. | |
| org_name | Yes | Ballerina package organisation name (e.g. "acme"). Used in Ballerina.toml and the Config.toml table header [org.project]. | |
| overwrite | No | Overwrite the module file if it already exists. | |
| topic_name | Yes | JMS topic name (pub/sub). Example: order.events | |
| project_name | Yes | Ballerina package / project name. Becomes the folder <bi_path>/<project_name> and the package name. | |
| project_path | Yes | Absolute or ~/%USERPROFILE%-relative path to an existing scaffolded project root (the folder containing Ballerina.toml). | |
| subscriber_name | No | Durable subscription name (required when durable=true). |