Menu Search

abstract_server.py

from proton_server import Server


class Application(Server):
    def __init__(self, host, address):
        super(Application, self).__init__(host, address)

    def on_request(self, request, reply_to):
        response = request.upper()
        self.send(response, reply_to)
        print("Request from: %s" % reply_to)


try:
    Application("localhost:5672", "examples").run()
except KeyboardInterrupt:
    pass

Download this file