Hi! A small question about a CRUD-like application...
# vertx
g
Hi! A small question about a CRUD-like application in vertx using the eventbus. If I have CRUD, should I aim for creating 4 addresses, e.g. BOOK_CREATE, BOOK_UPDATE, BOOK_READ, BOOK_DELETE or should I just have a BOOK address and then write some kind of router when receiving messages on the BOOK address?
i
Vert.x has support for routers so that would make sense. You should have 4 handlers of course. But the handlers could even be lambdas if you want.
d
Maybe a sealed class on one channel with json serialization/deserialization might also do.. but i might seperate the reads from the writes to avoid concurrency problems...
g
I read up a bit more on it and I think I will use the action header on the messages
oh I never finished my sentence 😄 I’ll add the action-header on the messages and then have one address with a router which determines wether the intentions of the message was C R U or D