Repository navigation
refactor(kafka): consolidate configuration and centralize topic registry - #342
Conversation
- Created `com.xtraction.api.core.kafka` package for core infrastructure concerns. - Implemented `SharedKafkaConsumerConfig` to manage consumer factories, standard/batch container factories, and exponential backoff error routing. - Implemented `SharedKafkaProducerConfig` for centralized KafkaTemplate. - Added `KafkaTopicRegistry` to standardize all topic names (e.g., `xtraction-*` prefixes) and rename legacy promo/notification topics. - Declared all topic beans centrally via `SharedKafkaTopicConfig`. - Removed duplicate and legacy configurations: `KafkaConsumerConfig`, `KafkaProducerConfig`, `PaymentKafkaConsumerConfig`, `KafkaTopicConfig`, and `PaymentTopicConfig`. - Refactored all listeners, consumers, producers, and publishers to use the consolidated module. - Implemented google Oauth authentication. Signed-off-by: aniebietafia <aniebietafia87@gmail.com>
|
Warning Review limit reached
Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR centralizes Kafka topic configuration into a new ChangesKafka Topic Centralization
Google OAuth2 Login
Miscellaneous
Estimated code review effort: 4 (Complex) | ~75 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant SecurityConfig
participant CustomOAuth2UserService
participant OAuth2UserProvisioningImpl
participant OAuth2AuthenticationSuccessHandler
Client->>SecurityConfig: initiate Google OAuth2 login
SecurityConfig->>CustomOAuth2UserService: loadUser(OAuth2UserRequest)
CustomOAuth2UserService->>OAuth2UserProvisioningImpl: provisionOAuth2User(GoogleOAuth2UserInfo)
OAuth2UserProvisioningImpl-->>CustomOAuth2UserService: User (provisioned/linked)
CustomOAuth2UserService-->>SecurityConfig: OAuth2User
SecurityConfig->>OAuth2AuthenticationSuccessHandler: onAuthenticationSuccess
OAuth2AuthenticationSuccessHandler-->>Client: redirect with access token and refresh cookie
sequenceDiagram
participant Publisher
participant KafkaTopicRegistry
participant Kafka
participant Consumer
Publisher->>KafkaTopicRegistry: resolve topic constant
Publisher->>Kafka: send message to resolved topic
Consumer->>KafkaTopicRegistry: resolve topic constant for `@KafkaListener`
Kafka->>Consumer: deliver message
Related issues: None referenced in the provided diff. Related PRs: None referenced in the provided diff. Suggested labels: kafka, oauth2, security, database-migration, ci Suggested reviewers: Backend maintainers familiar with Kafka messaging and Spring Security OAuth2 configuration. Poem Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
…o the end of test configuration file Signed-off-by: aniebietafia <aniebietafia87@gmail.com>
com.xtraction.api.core.kafkapackage for core infrastructure concerns.SharedKafkaConsumerConfigto manage consumer factories, standard/batch container factories, and exponential backoff error routing.SharedKafkaProducerConfigfor centralized KafkaTemplate.KafkaTopicRegistryto standardize all topic names (e.g.,xtraction-*prefixes) and rename legacy promo/notification topics.SharedKafkaTopicConfig.KafkaConsumerConfig,KafkaProducerConfig,PaymentKafkaConsumerConfig,KafkaTopicConfig, andPaymentTopicConfig.Description
Please include a summary of the changes and the related issue/feature request. List any dependencies that are required for this change.
Fixes # (issue)
Close #224
Type of Change
Please mark options that apply:
Verification Details
Automated Tests
Describe the tests that you ran to verify your changes (e.g.
mvn test).Manual Verification
Describe any manual testing performed (e.g. API requests tested via Postman/Bruno, console output logs, database verification).
Checklist
Summary by CodeRabbit
New Features
Bug Fixes