Project

tochtli

0.0
No commit activity in last 3 years
No release in over 3 years
Lightweight framework for service oriented applications based on bunny (RabbitMQ)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

~> 2.6.4
~> 2.0.1
>= 4.7.5
~> 0.8

Runtime

~> 1.7.0
>= 0
>= 0
>= 0
>= 0
 Project Readme

Build Status Gem Version

What's Tochtli?

Tochtli is a set of conventions and tools that simplifies the implementation of components communicating over the RabbitMQ broker. Internally it depends on bunny gem.

Idea

Tochtli Diagram

The communication between application and service looks like on the above picture. The application calls the client (regular object) methods which expose the service API. The request (a message) is created and sent by the client to the service queue (dedicated queue per service controller). RabbitMQ is used as a message broker and delivers the request to the service controller. The controller implements the actions that are performed on the request and may result in the response. The response message is published on the reply queue (private for a client connection). The client receives the response and returns the expected result to the application. The client methods can be implemented in the blocking and non-blocking (asynchronous) way.

Layers

Tochtli Layers

The stable service interface really helps to reduce costs of a inevitable change that should only affect the internal implementation. In the proposed above layered structure the application interacts only with the public client class methods. It's not very hard to implement client methods in a such way that they will allow for future changes which won't cause compatibility issues. The expected resistance on the service API changes is a reason way application has no access to the messages definition. Only clients and service controllers operate on the message layer (the common layer). The bottom layer contains tools that allow for communication between the client and the server. There is an option for the message broker agnosticism in the future, because client and service implementation should not directly depend on the particular tool (ex. bunny).

What's next?

Read more about Tochtli and go through the tutorial on Tochtli homepage.

Tests

Run rabbitmq using foreman (copy Procfile.example to Procfile before if needed):

bundle exec foreman start

In another shell run tests:

bundle exec rake test

Contributing

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Send me a pull request.

License

Released under the MIT license.