Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ logs
results

node_modules
npm-debug.log
npm-debug.log

config.json

Empty file added Demo.md
Empty file.
6 changes: 6 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Copyright 2012 Microsoft

The **Demo-SBMessageReader-Nodejs** is licensed under the terms of the Apache License, Version 2.0.
You may use it according to the license as is most appropriate for your project on a case-by-case basis.

The terms of this license can be found in http://www.apache.org/licenses/LICENSE-2.0
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,35 @@
Demo-SBMessageReader-Nodejs
===========================
# Demo - Service Bus Message Reader (Node.js) #

Node.js Application which reads messages from a Service Bus Queue
## Tutorial ##

### Introduction ###

Tutorials are sets of step-by-step guides that are designed to help you learn how to use key Windows Azure services and features. Each tutorial provides instructions to guide you through the process of developing a complete application.

In this tutorial, you will explore the basic elements of a Windows Azure service by creating a simple GuestBook application that demonstrates many features of Windows Azure, including web and worker roles, blob storage, table storage, and queues.

> **Note:** You can download the latest build of the Windows Azure Training Kit which includes a tested version of this HOL from here: http://bit.ly/WindowsAzureTK.

### Repository Structure ###

In the **root** folder of this repository you will find the tutorial document, **TutorialScript.md**. Before beginning with the HOL exercises, make sure you have followed all the required steps indicated at the setup section of the HOL document.

In the **Source** folder you will find the source code of each of the exercises, as well as the assets and setup scripts. Throughout the HOL you will be instructed to open and explore the different solutions from the source folder. It is typically comprised of the following subfolders:

- **Assets:** This folder contains files that are used throughout the exercises.
- **_Exercise Name_:** Each exercise that requires a programming solution has its own code folder.
- **Begin:** The begin solution is the initial incomplete solution that you will finish by following the steps of the corresponding exercise.
- **End:** The end solution is the final result you will achieve at the end of an exercise.
- **Setup:** This folder contains the dependency files and the setup scripts necessary to initialize specific configurations of the tutorial, being its execution is required in the majority of the Tutorials.

### Get Started ###

In order to run the solutions of the exercises provided by this tutorial you will first need configure your environment and install any necessary prerequisites such as runtimes, components, or libraries. For your ease, you can download and run the dependency checker [here] (http://go.microsoft.com/fwlink/?LinkId=245702) to automatically check and install all the requirements. Each tutorial also includes setup instructions for getting started.

### Contributing to the Repository ###

If you find any issues or opportunities for improving this tutorial, fix them! Feel free to contribute to this project by [forking](http://help.github.com/fork-a-repo/) this repository and make changes to the content. Once you've made your changes, share them back with the community by sending a pull request. Please see [How to send pull requests](http://help.github.com/send-pull-requests/) for more information about contributing to Github projects.

### Reporting Issues ###

If you find any issues with this tutorial that you can't fix, feel free to report them in the [issues](https://github.com/WindowsAzure-TrainingKit/Tutorial-HelloWindowsAzure/issues) section of this repository.
18 changes: 18 additions & 0 deletions code/src/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env node

var program = require('commander');
var azure = require('azure');
var config = require('./config');

program.version('0.0.1')
.parse(process.argv);

var loop = setInterval(function() {
var serviceBus = azure.createServiceBusService(config.namespace, config.accessKey, config.issuer);
serviceBus.receiveQueueMessage(config.queue, function(error, serverMessage){
if(!error){
console.log(serverMessage.body);
}
});
}, 10);

6 changes: 6 additions & 0 deletions code/src/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"namespace": "[sb-namespace]",
"issuer": "[sb-issuer]",
"accessKey": "[sb-access-key]",
"queue": "[sb-queue-name]"
}
8 changes: 8 additions & 0 deletions code/src/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "demo-sbreadmessages",
"version": "0.0.1",
"dependencies": {
"azure": ">= 0.6.0",
"commander": ">= 0.6.1"
}
}