Comments (2)
When consuming a stream, you can enrich the stream by joining it with tables using ctx.Join
or ctx.Lookup
, for example, an event "user-logged-in" arrives; you lookup a device-table using the device id in the user-logged-in event and combine the device information with the event. The result can be emitted downstream or stored in a group table. So this is a Stream-Table join. The callbacks will be triggered by the stream and you'll see all events from the stream. The joined tables are passive, they will be kept up-to-date, but you typically don't get triggered for their updates (unless you use UpdateCallback
).
In your case, you want to count how many bookings a user has performed. I would do something similar to your approaches, but I would not pack user and booking in the same processor. I'd have one processor for the booking-table and one processor for the user-table. The booking processor would emit into a topic "user-booked-stream" using the user as key. The user processor would consume (with multiple callbacks) from the user streams plus this "user-booked-stream".
The at least once issue would have to be solved by keeping a set of bookings of the user instead of simply counting them. Does that help you further?
from goka.
To do exactly once counting, that's exactly what I was thinking about (keeping set of ids instead of a counter, at least during some limited timeframe/window).
Thanks a lot for your recommendations, it helped a lot!
from goka.
Related Issues (20)
- Wiki references ZKTopicManagerBuilder but it doesn't exist HOT 1
- Goka set debug mode to custom logger HOT 3
- ctx.Value() changes initial message HOT 5
- RedisIterator skips first key when it.Next() is called HOT 5
- Failing to run examples HOT 6
- Question: Goka compatibility with Kafka 3.3.1 (KRaft) HOT 1
- Bug: `PartitionProcessor.VisitValues` does not clean up `Signal.waiters`, causing a memory leak
- Question: Regarding Emitters Connection HOT 2
- Pause and Resume Functionality in Processor HOT 4
- Link to blog post is dead HOT 1
- Processor calls wrong decode codec on message receipt HOT 1
- Any way allow to customize key of KTable HOT 1
- bug error setting up for partition HOT 3
- how to use Goka to move data from group table state to different storage system HOT 4
- EmitSync stuck in channel HOT 3
- Cannot connect to broker if the program is on docker container HOT 3
- Kafka server: Message was too large, server rejected it to avoid allocation error HOT 3
- How to modify value in Group table? HOT 4
- What storage I should use for processor and view? HOT 4
- How to fill up local cache with messages from a custom offset on start up? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goka.