Clarification #193
-
Does this library continually check the Outbox table, probably after every 10 ms or so ?
I have an app that is writing domain events (internal.. not exposed to other microservices and Kafka) to PostgreSQL db. In order to use this library, I need to create an Outbox table and the app will save the integration events (external.. whose ultimate destination is Kafka) in the Outbox table in the same transaction i.e. write both domain and integration events in a single transaction. Now this library will read the event(s) from the Outbox table as soon as they are written to it and push them to Kafka. Is this how the flow like? Getting used in production? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 9 replies
-
Yes, your understanding is correct. The interval that the outbox table is checked is configured/specified via the parameter The interaction of your application with the library is only writing to the outbox table via the And yes, it's used in production. Does this answer your questions? |
Beta Was this translation helpful? Give feedback.
-
I will try to implement |
Beta Was this translation helpful? Give feedback.
-
Okay .. Thank you for the quick responses. I am wondering how does this Usage fit in the scenario that I mentioned above? My app that is writing domain events is Node/TypeScript based and I Also, does it impose any constraint on the schema of the Outbox table? |
Beta Was this translation helpful? Give feedback.
-
Yes, I need to go through the code as well in order to understand it properly. Initially, I assumed it is a standalone process. But.. probably, this library was written with an intention that the users can |
Beta Was this translation helpful? Give feedback.
-
As of now, I am not using any. I came across several and the ones I have liked are: As a side note.. event sourcing is very hard and expensive to implement.
Very true. After looking at this library of yours, I have reached to the same conclusion. In case, I decide to use NodeJS/TypeScript for writing events to the database, I need to find (or write myself) the code what your library is doing right now. I want to use NodeJS because it really shines in I/O.
I think we can add a section named "Purpose" at the very beginning of Readme
You may Copy/Paste the text and diagram from here:
A single process should do all this Then at the very We do not recommend using this library as a standalone process. Instead, embed it in your application. The points (b) and (c) are taken care by this library. You need to code the point (a) yourself depending on your domain logic. Regards |
Beta Was this translation helpful? Give feedback.
-
Okay
I agree. I read a lot about Event Sourcing and also went through the code of several open source libraries. As of now, my viewpoint is that we should begin with a small open-source ES library (instead of using a huge Axon-like framework) and keep adding features on top of it depending upon our requirements. For example, I'd consider this feature as either intermediate or advanced: They have something called Event Groups. Is this really needed especially if we are writing a simple application.. I doubt. |
Beta Was this translation helpful? Give feedback.
-
I agree. |
Beta Was this translation helpful? Give feedback.
Yes, your understanding is correct. The interval that the outbox table is checked is configured/specified via the parameter
processingInterval
.The interaction of your application with the library is only writing to the outbox table via the
OutboxService
(apart from the setup of theOutboxProcessor
).And yes, it's used in production.
Does this answer your questions?