First I created a project for the node.js worker. The first steps for this are identical to that of creating the Hapi.js site that publishes messages to the queue. Go through these three steps for the worker and then I’ll continue from there.
First I created a project for the node.js web application.
$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sane defaults.
See `npm help json` for definitive documentation on these fields
and exactly what they do.
Use `npm install &pkg& --save` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
version: (0.0.0) 0.0.1
description: This project that will feed data to the queue for the AWS SQS sample.
entry point: (index.js) server.js
test command: mocha
git repository: (https://github.com/Adron/testing-aws-sqs-site.git)
keywords: aws, sqs, elastic, elastic beanstalk, queue, worker
author: Adron Hall
license: (ISC) Apache 2.0
Before diving straight in, I’m going to outline the specific goals and what I am using to accomplish these goals. The goal is to have a simple web application, that will get some element of data posted to a queue. The queue will then have data that a worker service needs to then process. As I step through each of these requirements I’ll determine the actual push and pull mechanisms that will get the job done.
I know I know, the marketers say it’s all about the single articles now. Nobody reads blogs. Nobody subscribes to blogs. Ya know, except of course for that small percentage of people that do.
…marketing, it’ll make you insane if you’re not careful.
But seriously, here’s a few blogs that are actually worth reading. They’re worth subscribing to and surprisingly, they’re blogs that businesses organize and write. Yes, I have and might be writing for some of them in the future. But I’m honestly basing this list on a few specific criteria:
The blog has to include some technical content that is important to getting kick started with their product and getting kick started with other tooling around their space.
The blog has to include articles that have industry information that is relevant to conferences, meetups, and other community related activities.
I use git. I’m honestly shocked when someone doesn’t use git (or at least some DVCS) these days. It just seems somewhat draconian to use any of the legacy source control systems (albeit there are some rare exceptions, like game development graphics collateral). I was reminded of something by the great hands on session that Pamela Ocampo @pmocampo and Rachel @raychatter gave at OS Bridge titled “NerdCred++; How to Customize your Bash Prompt“.
After the session I dug into customizing my bash prompt. After doing a lot of manual editing I ended up just forking and implementing Michael Gonderman’s (@magicmonty) bash-git-prompt. The way to get this installed is pretty simple, albeit it does include a few steps (and yes, the README.md basically has the instructions, but I’ve copied them here just to discuss and for ease of readability). Another key points of reference include Sebastian Celis’s (@scelis) “A zsh prompt for git users” on his blog.
The first thing we did was figure out what we could use for enforcement of the coding style. Milan (@milanloveless) quickly discovered node-jscs per suggestion from Adam Ulvi (@s5fs). He implemented that code as follows.