Joining the “I Wrote a Microservice” Club
Seven chapters into this book, and this is the moment you’ve been waiting for—your first Component! Here’s to hoping you aren’t underwhelmed.
We have two things to do with this Component. We need it to subscribe to where its commands will be, and we need it to handle those commands. Let’s start with the top-level function this Component defines:
1: | function build ({ messageStore }) { |
- | const identityCommandHandlers = |
- | createIdentityCommandHandlers({ messageStore }) |
- | const identityCommandSubscription = messageStore.createSubscription({ |
5: | streamName: 'identity:command', |
- | handlers: identityCommandHandlers, |
- | subscriberId: 'components:identity:command' ... |
Get Practical Microservices now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.