Skip to content

Instantly share code, notes, and snippets.

arobson /
Last active October 14, 2021 06:46
Rabbit.MQ + Node.js Notes

Abstraction Suggestions

Summary: use good/established messaging patterns like Enterprise Integration Patterns. Don't make up your own. Don't expose transport implementation details to your application.


As much as possible, I prefer to hide Rabbit's implementation details from my application. In .Net we have a Broker abstraction that can communicate through a lot of different transports (rabbit just happens to be our preferred one). The broker allows us to expose a very simple API which is basically:

  • publish
  • request
  • start/stop subscription
arobson / elasticsearch.toml
Created March 18, 2018 04:23
name = "elasticsearch.infra"
image = "elasticsearch:5.5.1-alpine"
stateful = true
containers = 1
ram = "> 256 Mi < 1024 Mi"
cpu = "> 1% < 100%"
arobson / es-service.yml
Last active March 18, 2018 03:22
An Elastic Search Stateful Set and Service Manifest
- apiVersion: v1
kind: Service
namespace: infra
name: es
app: es
name: es
namespace: infra
arobson / nginx.conf
Created June 27, 2017 19:50
npme nginx + varnish
# -----------------------------------------------------------------------------
# 1. replace `` with your public-facing domain
# 2. replace `` with your primary server's IP
# 3. replace worker_processes with 1 if host only has 1 core
# 4. add `fs.file-max = 4096` to `/etc/sysctl.conf`
# 5. copy your SSL pem file to `/etc/nginx/wildcard.pem`
# -----------------------------------------------------------------------------
user root;
worker_processes 2;
arobson / npme-cloudformation.yaml
Last active June 16, 2017 17:15
npme CloudFormation starter template
AWSTemplateFormatVersion: 2010-09-09
Description: AWS CloudFormation Template for npm enterprise instance.
Description: Name of existing EC2 KeyPair to enable SSH access.
Type: 'AWS::EC2::KeyPair::KeyName'
ConstraintDescription: must be the name of an existing EC2 KeyPair.
Description: The IP address range that can be used to SSH to the EC2 instances
Type: String

Keybase proof

I hereby claim:

  • I am arobson on github.
  • I am arob ( on keybase.
  • I have a public key ASCE83LKQpAo2zdVrOWtZbmaqOXOo9S2cqUXWRVdyDTgiwo

To claim this, I am signing this object:

arobson / Topic Matching
Created May 24, 2012 23:00
Fun with applied FP
Subscribers subscribe to topics.
A topic is expressed as a period delimited namespace: "a.b.c.d"
A topic subscription may be an exact match or use wild card characters:
* - match 1 namespace segment at a specific location
# - match any number of namespace segments
When a message comes in, it will always have a fully specified topic.
The list of subscriptions with topics that would match the message's topic is the desired outcome.
arobson / forkjoin-mockjax-defs.js
Created March 22, 2012 08:58
Mockjax Definitions for my Fork Join Blog post
$.mockjax( {
url: "",
type: "GET",
status: 200,
data: {
"name": "Alex Robson",
"company": "appendTo",
"public_repos": 31,
"followers": 18,
"following": 4,
arobson / Dependency URLs
Created March 8, 2012 10:02
A Cartographer Starter HTML Page
These URLs should be to the actual script files and can be used for to populate tools like JS Fiddle.
zlib = require 'zlib'
module.exports = (robot) ->
robot.respond /(stack|ss) ?(find:.*) ?(tags:.*)/i, (msg)->
query = msg.match[2]
query2 = msg.match[3]
query = query.replace /find:/i, ""
query2 = query2.replace /tags:/i, ""