Skip to main content

Kafka

Topics found in the repository

TopicProducerConsumer
order-createdorder-servicenotification-service, analytics-service
payment-successpayment-serviceorder-service
payment-failedpayment-serviceanalytics-service
payment-completednone in current codeanalytics-service

Event schemas

order-created

  • orderId
  • userId
  • email
  • totalAmount
  • items[]
  • firstName
  • phoneNumber
  • status

payment-success

  • paymentId
  • checkoutId
  • userId
  • transactionId
  • amount
  • items[]
  • email
  • firstName
  • phoneNumber

payment-failed

  • paymentId
  • checkoutId
  • userId
  • transactionId
  • amount

Checkout/event flow

Retry / delivery notes

  • Producers use Spring Kafka KafkaTemplate
  • payment-service waits on .get() for publish success/failure
  • order-service publishes after transaction commit using TransactionSynchronizationManager
  • analytics-service adds an application-level deduplication table via processed_events

Known inconsistency

analytics-service listens for payment-completed, but payment-service publishes payment-success. Documentation intentionally keeps this mismatch visible because it exists in the repository today.