feat: Introduce MessageBus for Event Driven architecture#23839
feat: Introduce MessageBus for Event Driven architecture#23839hariombalhara wants to merge 2 commits intohariom/pri-305-bookingcreateservice-rename-handlers-to-servicesfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests
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. Comment |
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
3c78374 to
82d6e28
Compare
2f4cec7 to
87db55a
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
87db55a to
378690d
Compare
82d6e28 to
033ea95
Compare
378690d to
45e2c23
Compare
033ea95 to
90e3547
Compare
45e2c23 to
08b5162
Compare
|
hey @hariombalhara, I have some points of improvement that I'd love to us to take in account. This is not regarding the implementation, which is good, but more related to resilience and performance. I really value the event mechanism and I think we should go forward with it, but maybe we should rethink it to get all benefits. What's not that good:
What I think is better for this case:
|
08b5162 to
b16024a
Compare
90e3547 to
dee6f2d
Compare
dee6f2d to
155ad02
Compare
b16024a to
02c537d
Compare
There was a problem hiding this comment.
A handler for trigger.dev would be defined here.
| import type { Logger } from "tslog"; | ||
|
|
||
| import { safeStringify } from "@calcom/lib/safeStringify"; | ||
| import { HashedLinkService } from "@calcom/lib/server/service/hashedLinkService"; |
There was a problem hiding this comment.
This service should probably move to the privateLink feature also.
There was a problem hiding this comment.
Yeah certainly.But I didn't want to do any other refactor as part of this PR.
155ad02 to
e0ce121
Compare
02c537d to
998d322
Compare
998d322 to
6b969e7
Compare
e0ce121 to
4689858
Compare
6b969e7 to
b15618e
Compare
- Add react-awesome-query-builder and clone to serverExternalPackages - Fixes module resolution errors in booking flow caused by client-side dependencies being bundled server-side through import chain: RegularBookingService → getRoutedUsers → findTeamMembersMatchingAttributeLogic Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
|
Closing it as per internal discussion. We don'tt want to pursue it further for now, will be re-evaluated if we really need it. |

What does this PR do?
Introducing MessageBus
Note: The name is chosen to be MessageBus, and not EventBus, so that it is not confused with Cal.com Events.
Overview
Every feature in
@calcom/featuresshould define the actions it takes for a specific lifecycle event during a request. This ensures that the logic is organized, modular, and easily testable.Example
For instance, the message
messages/booking.created/handlerdefines what happens when abooking.createdevent occurs.Extending MessageBus
For more complex request flows, developers can extend the
MessageBusto define their own Buses and use those Buses.Example:
A
BookingMessageBuscould define messages such as:booking.createdbooking.rescheduledbooking.requestRescheduledBenefits
This approach streamlines event handling, reduces coupling, and makes the system more maintainable.
Visual Demo (For contributors especially)
A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).
Video Demo (if applicable):
Image Demo (if applicable):
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist