Skip to content

feat: add shared subscription routing utilities - #119

Merged
lethanhdat762003 merged 1 commit into
devfrom
feat/common-subscription-routing
Aug 7, 2026
Merged

lethanhdat762003 merged 1 commit into
devfrom
feat/common-subscription-routing

Conversation

@lethanhdat762003

Copy link
Copy Markdown
Member

What?

Why?

How?

Testing?

  • Functional Testing
  • Security
  • Performance
  • Error Handling
  • Code Quality
  • Documentation
  • Database
  • Deployment
  • Final Review

Anything Else?

Comment on lines +22 to +39
def send_subscription_task(service, lifecycle, task_name, message, **kwargs):
celery_app = import_string(settings.CELERY_APP)
exchange = SUBSCRIPTION_LIFECYCLE_EXCHANGES.get(lifecycle)
if exchange is None:
raise ValueError(f"unsupported subscription lifecycle: {lifecycle}")

routing_key = f"{service}.{lifecycle}"
return celery_app.send_task(
name=f"spacedf.tasks.{task_name}",
exchange=exchange,
routing_key=routing_key,
retry=True,
retry_policy=dict(
max_retries=3, interval_start=3, interval_step=1, interval_max=6
),
kwargs=message,
**kwargs,
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this code into the console service and use send_task to send

@lethanhdat762003
lethanhdat762003 merged commit 72585b3 into dev Aug 7, 2026
1 check passed
@ngovinh2k2
ngovinh2k2 deleted the feat/common-subscription-routing branch August 18, 2026 09:18
@lethanhdat762003
lethanhdat762003 restored the feat/common-subscription-routing branch August 26, 2026 06:45
@ngovinh2k2
ngovinh2k2 deleted the feat/common-subscription-routing branch September 22, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants