Tip:
Highlight text to annotate it
X
[ MUSIC ]
Hi, this is Kevin Williams with IBM.
I've recently been working with the team exploring various technologies that we might use
to construct a next generation of continuous delivery pipeline.
And as part of this effort, I developed a notification service that we could use
to coordinate or help orchestrate the behavior of these various loosely coupled pieces
that we were trying to plug together, the idea being that components in the system can register
for events; when those events occur, they can take action.
So, a concrete example might be some upstream component might generate a key artifact;
downstream components that have registered for those occurrences
of events can receive notifications and then take action, maybe consuming that artifact.
So, that's basically the extent of the service provided to the system.
This went together very quickly.
I used some nice technologies.
I used Node.js along with some add-on frameworks that kind of bolstered Node.js.
And then for the back end I used a NoSQL database.
I used MongoDB for the persistent back end store, and that also works very well
with Node.js and came together quickly.
We've got the system deployed to a BlueMix cloud.
It's been running for a while now.
We've also plugged in our build system,
so our build system is now signaling the availability of all new builds.
So, with that, I'd like to take you through a few sections of code.
So, if you'd like to dig into the code a little bit, this is the best place to start.
This is the server.js file, and in particular,
this section here that I'm highlighting takes care of all the routing for the entire API.
This first one, if the application receives a request, a get request on /events,
that is handled by "find all" in the event.js file.
And this pattern's repeated, it's pretty straightforward and it's all laid out here.
It makes it pretty easy for you to trace a particular thread all the way through the code.
So, that's it.
I hope you enjoy the article and find something useful.
Thank you.