Meego Wiki
Views

Release Infrastructure/BOSS/AIR

From MeeGo wiki
< Release Infrastructure | BOSS(Difference between revisions)
Jump to: navigation, search
m (moved Infrastructure/BOSS/AIR to Release Infrastructure/BOSS/AIR: Original title was broader than intended)
 

Latest revision as of 14:25, 23 July 2010

Contents

AIR : AMQP Interoperable RPC

AIR is a library developed for BOSS to provide simple RPC semantics over AMQP for multiple languages.

AIR currently supports:

  • Python amqplib
  • Ruby amqp

Perl is planned.

There are many similar RPC/AMQP solutions but they tend to be language specific; AIR is focused on simplicity and interoperability.

How it works

Boss7.png

The basic premise is to define the message format and to ensure correct use of the AMQP reply_to header. See the AMQP Specification (pdf) page 17, section 2.1.5.2

Python Client

from AIR.Client import Client, Timeout

air_server = Client(amqp_host = "amqpvm", amqp_user = "air",
               amqp_pass = "air", amqp_vhost = "AIR")

print air_server.call("service1", timeout=None, count=5)

Ruby Client

require 'AIR/Client'

air_server = AIR::Client.new(:host => "amqpvm", :user => "air",
                       :pass => "air", :vhost => "AIR")

puts air_server.call("service1", :timeout => nil, :count => 5)

Python Server

from AIR.Server import Server
srv = Server(amqp_host = "amqpvm", amqp_user = "air",
                 amqp_pass = "air", amqp_vhost = "AIR")

srv.register("service1", instanceA.method1)
srv.register("service2", other.method2)

srv.run()
Personal tools