Giter Site home page Giter Site logo

nameko-examples's Introduction

Nameko

[nah-meh-koh]

A microservices framework for Python that lets service developers concentrate on application logic and encourages testability.

A nameko service is just a class:

# helloworld.py

from nameko.rpc import rpc

class GreetingService:
    name = "greeting_service"

    @rpc
    def hello(self, name):
        return "Hello, {}!".format(name)

You can run it in a shell:

$ nameko run helloworld
starting services: greeting_service
...

And play with it from another:

$ nameko shell
>>> n.rpc.greeting_service.hello(name="ナメコ")
'Hello, ナメコ!'

Features

  • AMQP RPC and Events (pub-sub)
  • HTTP GET, POST & websockets
  • CLI for easy and rapid development
  • Utilities for unit and integration testing

Getting Started

Support

For help, comments or questions, please go to https://discourse.nameko.io/.

For enterprise

Available as part of the Tidelift Subscription.

The maintainers of Nameko and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

Contribute

  • Fork the repository
  • Raise an issue or make a feature request

License

Apache 2.0. See LICENSE for details.

nameko-examples's People

Contributors

iky avatar kooba avatar mattbennett avatar timbu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nameko-examples's Issues

Getting error for Default Connection

I'm getting the following error when i'm trying to run the nameko service

Traceback (most recent call last): File "C:\Users\Asus\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 193, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Asus\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\Asus\PycharmProjects\Sahyog\venvWin\Scripts\nameko.exe\__main__.py", line 9, in <module> File "c:\users\asus\pycharmprojects\sahyog\venvwin\lib\site-packages\nameko\cli\main.py", line 119, in main args.main(args) File "c:\users\asus\pycharmprojects\sahyog\venvwin\lib\site-packages\nameko\cli\commands.py", line 110, in main main(args) File "c:\users\asus\pycharmprojects\sahyog\venvwin\lib\site-packages\nameko\cli\run.py", line 181, in main import_service(path) File "c:\users\asus\pycharmprojects\sahyog\venvwin\lib\site-packages\nameko\cli\run.py", line 71, in import_service if inspect.getmembers(potential_service, is_entrypoint): File "C:\Users\Asus\AppData\Local\Programs\Python\Python38-32\lib\inspect.py", line 350, in getmembers value = getattr(object, key) File "c:\users\asus\pycharmprojects\sahyog\venvwin\lib\site-packages\mongoengine\queryset\manager.py", line 37, in __get__ queryset = queryset_class(owner, owner._get_collection()) File "c:\users\asus\pycharmprojects\sahyog\venvwin\lib\site-packages\mongoengine\document.py", line 207, in _get_collection db = cls._get_db() File "c:\users\asus\pycharmprojects\sahyog\venvwin\lib\site-packages\mongoengine\document.py", line 185, in _get_db return get_db(cls._meta.get("db_alias", DEFAULT_CONNECTION_NAME)) File "c:\users\asus\pycharmprojects\sahyog\venvwin\lib\site-packages\mongoengine\connection.py", line 356, in get_db conn = get_connection(alias) File "c:\users\asus\pycharmprojects\sahyog\venvwin\lib\site-packages\mongoengine\connection.py", line 268, in get_connection raise ConnectionFailure(msg) mongoengine.connection.ConnectionFailure: You have not defined a default connection

my configuration file:

`
AMQP_URI: 'amqp://localhost:5672'
rpc_exchange: 'nameko-rpc'
max_workers: 10
parent_calls_tracked: 10
MONGODB_URI: 'mongodb://localhost:27017/Sahyog'

LOGGING:
version: 1
handlers:
console:
class: logging.StreamHandler
root:
level: DEBUG
handlers: [console]
`

Naming mismatch between Postgres Helm Chart and orders/chart

Hi,

I was following your guide for running nameko examples on Kubernetes. Everything worked well until I tried to deploy orders service.
Based on the logs that got printed during Postgres Helm Chart deployment, postgres password can be extracted using the following command:
export POSTGRES_PASSWORD=$(kubectl get secret --namespace examples db-postgresql -o jsonpath="{.data.postgresql-password}" | base64 --decode)

On charts/orders/templates/deployment.yaml file, environment value DB_PASSWORD is being set by looking at deployed postgres instance using the key: postgres-password. Having said that I think that value needs to be updated into postgersql-password to match Postgres Helm Chart naming convention.

What do you think?

Unable to access the service running in Kubernetes from command line, getting curl: (52) Empty reply from server

Hi, this might not be a bug i am not sure and i am naive on kubernetes, docker. i was trying to run the services running in kubernetes pods from command line and it is always giving me "curl: (52) Empty reply from server"

I have followed all the instructions from below link i.e. from fix-postgresql-pass-key branch, Please find the screenshot and check the error highlighted, and also see the services running in pods, wondering what I am missing here
https://github.com/nameko/nameko-examples/tree/fix-postgresql-pass-key/k8s
image

Schema dump error

Line 23, orders service:

return OrderSchema().dump(order).data

results in

nameko.exceptions.RemoteError: AttributeError 'dict' object has no attribute 'data'

..and removing data fixes it:

return OrderSchema().dump(order)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.