Skip to content

reclaro/apimes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apimes

This is a simple RestAPI application used to create a Sub/Pub system. Users can register to topics and they receive all the messages sent to them.
A message get delivered to a client when the client explicitly checks for new messages. Every time a client checks for a new message just a new message is delivered, if there are N message in order to get all the messages the user needs to check N times for consuming all the messages.
If a message is sent to a topic but there are no subscribers the message get lost.
A client gets the messages which are published after his registration.
Messages survive to a server restart and they get deleted once all the subscribers have consumed them.
A topic is created in two ways:

  1. A user subscribe to the topic, if the topic doesn't exist it will be created.
  2. A message is sent to a topic, please note that in this case if the topic doesn't exist it will be created but the message will get lost as there won't be any subscribers

If a user tries to get messages from a topic when he has not a valid subscription the application will return an error code.

Requirements

This version of the code is based on RabbitMQ server as backend.
The code has been tested with RabbitMQ 3.4.3. To install rabbitmq on a Debiain/Ubuntu box run:
sudo apt-get install rabbitmq-server
The application is develped in python 2.7.

Installation and tests

We recommend to use virtualenv to install and test apimes.
Below we report a step by step installation process, please note we consider that the rabbitmq server is already installed on the machine.

  1. Creation of a virtual env using virtualevwrapper:
    mkvirtualenv apimes
  2. Clone the repository:
    git clone https://github.com/reclaro/apimes.git
  3. Installation of the python code:
    cd apimes
    python setup.py install
  4. Run the API: python apimes/api.py
    NOTE the application will run on a webserver which is not suitable for a production environment, it is good for testing the code.
  5. Run the tests: The tests include unit and functional tests, to get the functional tests working rabbitmq server must run, please start it with
    sudo service rabbtimq-server start
    py.test apimes/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages