Skip to content

feat(policy): add Kafka event publishing for policy changes#34

Merged
poyrazK merged 8 commits intomainfrom
feat/content-updated-event
Apr 26, 2026
Merged

feat(policy): add Kafka event publishing for policy changes#34
poyrazK merged 8 commits intomainfrom
feat/content-updated-event

Conversation

@poyrazK
Copy link
Copy Markdown
Owner

@poyrazK poyrazK commented Apr 26, 2026

Summary

  • Add Kafka event publishing to policy-service with policy.changed event
  • Publish events on updateContentPolicy and updateModerationState
  • Standard event envelope with contentId, ageRestricted, geoAllowList, geoBlockList, moderationState
  • Topic: cloudmedia.policy.changed
  • Noop fallback when Kafka is disabled

Test plan

  • All policy-service tests passing
  • Unit tests for KafkaPolicyEventPublisher
  • Integration tests for event publishing in ContentPolicyService

poyrazK added 7 commits April 26, 2026 19:29
Add PolicyChangedPayload and PolicyEventEnvelope for structured
policy change events with contentId, ageRestricted, geo lists,
moderation state, and standard envelope fields.
…ublisher

Add PolicyEventPublisher interface with publishPolicyChanged method
and NoopPolicyEventPublisher as a fallback when Kafka is disabled.
Add KafkaPolicyEventPublisher for publishing policy.changed events,
PolicyEventsProperties for topic configuration, and
PolicyEventsConfiguration for conditional bean wiring.
Enable spring-kafka dependency in pom.xml.
Inject PolicyEventPublisher into ContentPolicyService and publish
PolicyChanged events after updateContentPolicy and updateModerationState.
…ication

Add integration test verifying publishPolicyChanged is called
after updateContentPolicy and updateModerationState.
Add KafkaPolicyEventPublisherTest verifying envelope structure,
topic routing, key, traceId handling. Add NoopPolicyEventPublisherTest
verifying publish is a no-op.
- Update kafka-event-catalog.md with actual policy.changed payload schema
- Mark PR-005 Phases A-D as complete in modular-implementation-roadmap.md
- Add ADR 014 documenting policy-service Kafka event publishing
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 26, 2026

Warning

Rate limit exceeded

@poyrazK has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 58 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 29 minutes and 58 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8f644201-6d12-4f63-b084-e4d78d7a5264

📥 Commits

Reviewing files that changed from the base of the PR and between 63f1654 and 8247acb.

📒 Files selected for processing (15)
  • docs/adr/0014-policy-event-publishing.md
  • docs/contracts/kafka-event-catalog.md
  • docs/modular-implementation-roadmap.md
  • services/java/policy-service/pom.xml
  • services/java/policy-service/src/main/java/com/cloudmedia/policy/application/ContentPolicyService.java
  • services/java/policy-service/src/main/java/com/cloudmedia/policy/events/KafkaPolicyEventPublisher.java
  • services/java/policy-service/src/main/java/com/cloudmedia/policy/events/NoopPolicyEventPublisher.java
  • services/java/policy-service/src/main/java/com/cloudmedia/policy/events/PolicyChangedPayload.java
  • services/java/policy-service/src/main/java/com/cloudmedia/policy/events/PolicyEventEnvelope.java
  • services/java/policy-service/src/main/java/com/cloudmedia/policy/events/PolicyEventPublisher.java
  • services/java/policy-service/src/main/java/com/cloudmedia/policy/events/PolicyEventsConfiguration.java
  • services/java/policy-service/src/main/java/com/cloudmedia/policy/events/PolicyEventsProperties.java
  • services/java/policy-service/src/test/java/com/cloudmedia/policy/application/PolicyEventPublisherTest.java
  • services/java/policy-service/src/test/java/com/cloudmedia/policy/events/KafkaPolicyEventPublisherTest.java
  • services/java/policy-service/src/test/java/com/cloudmedia/policy/events/NoopPolicyEventPublisherTest.java
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/content-updated-event

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Owner Author

@poyrazK poyrazK left a comment

Choose a reason for hiding this comment

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

It's okay to merge

@poyrazK poyrazK merged commit f5d3a89 into main Apr 26, 2026
6 checks passed
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.

1 participant