EDA – Project Structure Best Practice

I would like to know the best practices you follow! Couple of my other team members are new as to this as well. We use Spring framework and Kafka.

My question is related to the project structure. I have my events / schema defined using protocol buffers. Lets say UserRegistrationEvent

This is my project structure as of now

  • config
    • Spring Kafka config to consume messages to pass it to service layer
  • adaptor
    • UserJpaRepository
  • entity
    • User
  • service
    • userRegistrationService
  • mapper

    • entity to event mapper or vice versa

    Is it good practice to pass the events directly to the service layer? Should i be using DTOs?

    DomainEvent --> DTOs --> Entity 

    Entity –> DTOs –> DomainEvent

submitted by /u/kitkarson
[link] [comments]

from Software Development – methodologies, techniques, and tools. Covering Agile, RUP, Waterfall + more! https://ift.tt/s1UXTgM

Leave a Reply

Create your own website, free on WordPress.com.Create your own website.
Start free
search previous next tag category expand menu location phone mail time cart zoom edit close