Skip to main content

Node.js, Web API, and RabbitMQ. Part 3

· 5 min read

Desiring to learn about both Node.js (particularly as an API server) and ASP.Net Web API, I decided to throw one more technology in the mix and see which one is faster at relaying messages to a service bus, namely, RabbitMQ.

And now, I finally get back to blogging about the ASP.Net Web API code that I wrote for this head-to-head comparison of REST service and message bus integration. The official tutorials were my guide for Web API, and as with the test runner in part 1, I used MassTransit as a convenient library for publishing from .Net code to RabbitMQ. Owin was my solution for self-hosting the web application.

Sam Houston Trail Park - Shorebirds!

· One min read

shorebirds at Sam Houston park

Thanks to recent mowing, I was able to access the west-side of the pond at Sam Houston Trail Park in Irving, TX this morning. The pond is drying up — creating a wonderful concentration of aquatic creatures for the the shorebirds to eat. These photos are as good as I can do. Positively identified:

  • American Avocet
  • Snowy Egret
  • Least Sandpiper
  • Stilt Sandpiper (pretty sure, not absolutely sure)
  • Greater Yellowlegs
  • Northern Shoveler
  • Killdeer

I encountered a few more common birds, and just as I was leaving ran into a group of three Lark Sparrows to cap off the muddy morning.

Discourses of Society: Climate Change

· 4 min read

aqueduct

Aqueduct-as-garden outside the Mansion of Mazra'eh in Israel. November 2010.

A small group gathered at the Bahá'í­ Center of Irving last night in our second meeting on the discourses of society, reflecting on climate change. The first meeting in the series was too much of a slide-based lecture, so for this second one we chose two videos and facilitated an open discussion. The conversation was robust, heartfelt, and meaningful — yet in reflection, it raises some key questions about how to have a productive, spiritually-oriented conversation.

Server Side Push Notifications With SignalR

· 6 min read

Many social websites, and web-based applications, have a notification process where the server sends a signal back to the browser, informing that particular user that there is a message. "You've got mail," as America On-Line used to say it. Consider the picture below, from Twitter, which shows that I have one new notification. That number increments automatically when a new notification arrives, without having to reload the full page. How does that work? Well, this blog post doesn't try to answer that directly. In fact, it is simply a collection of notes pointing out how to use Microsoft's SignalR technology to achieve this.

example from Twitter

Contributing to the Discourses of Society

· One min read

The Bahá'ís of Irving are trying out a concept: on the last Friday of each month, we'll talk about a theme related to the "discourses of society," motivated by passages such as this one, from the Universal House of Justice's 2010 Ridván Letter to the Bahá'í­s of the world (p10):

"... involvement in public discourse can range from an act as simple as introducing Bahá'í ideas into everyday conversation to more formal activities such as the preparation of articles and attendance at gatherings, dedicated to themes of social concern - climate change and the environment, governance and human rights, to mention a few. It entails, as well, meaningful interactions with civic groups and local organizations in villages and neighbourhoods."

The August event was the first in the series, and the concept itself was the subject of the evening's presentation...

Unit Test Isolation for Legacy .Net Code

· 3 min read

Isolating code from dependencies is crucial for developing small, well-defined, easy-to-understand tests. And it is an absolute must when those dependencies call external resources, such as a database, filesystem, or heavy-duty component (e.g. for interacting with office docs). But how do you introduce isolation in new unit tests for legacy .Net code? Well, that depends... and I have a flow chart and brief notes to help you figure it out.

Test toolkit flow chart

Node.js, Web API, and RabbitMQ. Part 2

· 5 min read

Desiring to learn about both Node.js (particularly as an API server) and ASP.Net Web API, I decided to throw one more technology in the mix and see which one is faster at relaying messages to a service bus, namely, RabbitMQ.

This is part two in a series. Part 1.

Let's start with Node.js. I already let you in on the fact that formatting a message for .Net to pick it up is tricky, and I won't get into the detail of that yet. For now, let's concentrate on setting up node.js and communicating with RabbitMQ. We'll get the finer points of interacting with .Net later.

Node.js, Web API, and RabbitMQ. Part 1

· 4 min read

Desiring to learn about both Node.js (particularly as an API server) and ASP.Net Web API, I decided to throw one more technology in the mix and see which one is faster at relaying messages to a service bus, namely, RabbitMQ. Naturally, such a test does nothing to prove that one framework is generally faster than the other, but it is a fun exercise nonetheless.

Thus the challenge is this: accept a string message via POST, forward it to the service bus, and return HTTP Status Code 202 (Accepted) along with an acknowledgment that repeats the original message. Both REST services should be self-hosted; free from additional cruft like error-handling*; and should utilize an url like http://localhost:port/Message/mymessage, where "mymessage" is the string to be sent across the bus.

On Religious Leadership, and the GreenFaith Fellowship

· 6 min read

An essay submitted as part of my application to the GreenFaith Fellowship Program. Hopefully I put my best foot forward ;-).

There are no clergy in the Bahá'í­ Faith. There is no seminary, and none can seek a position of leadership based on education, attainment, or station. Its governance is egalitarian and progressively inclusive. And yet it is inaccurate to say there are no leaders.

Using QUnit and SinonJS for JavaScript Testing

· 6 min read

QUnit + SinonJS logos

Basic was the first language I learned. Well, partially, in 8th grade. On Apple IIe at school and a Packard Bell 386 PC at home. A few years later, JavaScript came out and it became the first "modern" language I used. As an undergraduate physics major, I found it useful for quickly generating sample data or running some numerical approximations (simpler than Mathematica). Then I wrote a few web minor pages with DOM manipulation, before any of the modern frameworks had come out. I went to work, used it occasionally, but never had any excuses in work or home life to do more than dabble. The revolution was passing me by.

safnet logo