RabbitMQ Exchange to Exchange Bindings [AMPQ]

Overview

The exchange-exchange binding  allows for messages to be sent/routed from one exchange to another exchange. Exchange-exchange binding works more or less the same  way as exchange-to-queue binding, the only significant difference from the surface is that both exchanges(source and destination) have to be specified.

Two major advantages of using exchange-exhhange bindings based on experience   and what I have found after doing some research are:

  •  Exchange-to-exchange bindings are much more flexible in terms of the topology  that you can design, promotes decoupling  & reduce binding churn
  • Exchange-to-exchange bindings are said to be very light weight and as a result help to increase performance *

Exchange-To-Exchange Topology

 Messaging Topology

Continue reading…

Introducing Ark Agent: Current & Historical Stock Market EOD Data Application

Ark Agent is an application used To Collect Current and Historical End Of Day Stock Data leverages Celery and MongoDB to provide end of day and historical market data for stocks.  It also uses finsymbols that I wrote a while back Finsymbols

Please see the nicely formatted documentation on GitHub for more details  Ark Agent Wiki  

Intro : Celery and MongoDB

This post serves as more of a tutorial to get a  Hello World up and running while using Celery and MongoDB as the broker . Celery has great documentation but they are  in snippets  across multiple pages and nothing that shows a full working example of  using Celery  with MongoDB which might be helpful for new users .

Install All Required Packages

Packages related to Celery.

pip install celery
pip install -U celery-with-mongodb

Ensure that you have MongoDB installed and running. 10gen have great documentation to get you up and running with MongoDB in  no time.

In this tutorial we will only use a single module  for both the celery application and the tasks.

 

1. Create celeryconfig.py

Lets start by first creating a celeryconfig.py that will store  configuration details that will be used to configure Celery to use MongoDb as the results backend and other settings.

2.Create tasks.py(Celery Application and Worker)

 3. Now that we have our application and configs created lets  start it up!

celery -A tasks worker --loglevel=info

Screen Shot 2013-06-15 at 2.46.53 PM

 

4. Now lets create some work items/tasks to be processed.  You can easily create a script , but we used the CLI  in this example.

Celery Tasks

 5. Lets look on the console of the worker to see the jobs submitted.

As you can see tasks were obtained and processed

Screen Shot 2013-06-15 at 2.51.33 PM

 

6. If you are curious about your MongoDB backend . Lets take a look at the collections that will be used to store the results.

Screen Shot 2013-06-15 at 3.02.30 PM

 

Screen Shot 2013-06-15 at 3.03.01 PM

Thats how you get a simple Hello World up and running with MongoDB.  Will be doing a advance blog post where we use Celery and MongoDB with proper production configurations.

 

 

 

Obtain Finance Symbols for S&P 500,NASDAQ,AMEX,NYSE via Python

I recently completed  Computational Investing Part 1 which further tickled my curiosity. Before completing the course I  had started to play around with a few ideas.  To do any kind of analytics with finance relating to the stock market  you require symbols.

Created a simple module that uses BeatifulSoup  to parse the list of S & P 500 symbols from Wikipedia and nicely formats the data to be use programmatically an application.

You can grab the code here http://skillachie.github.io/finsymbols/

Gist of it. Will return to you a list of all the symbols and related information

 

Stay tuned to see how we then use the list of symbols to obtain prices for each symbol