Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jakub Borys
    @kooba
    Oh that's nice
    Fergus Doyle
    @junkafarian
    no dancing parrot emoji on this one though... :unamused:
    Jakub Borys
    @kooba
    Maybe there is a way to add it 🤔
    I think I need 3rd monitor just for chats
    Antonio Di Mariano
    @antoniodimariano
    Hi all,
    is this the python nameko room?
    Matt Yule-Bennett
    @mattbennett
    It is. Although it doesn't get much use. Did you have a question about nameko?
    Antonio Di Mariano
    @antoniodimariano
    @mattbennett thanks. Well, I've started using nameko since a few weeks, so I am still in the learning mode. I was wondering to know about communities around nameko. I'll have a lot of questions, for sure. Thank for your reply
    Matt Yule-Bennett
    @mattbennett
    Cool. Feel free to ask questions in here, or on the mailing list at https://groups.google.com/forum/m/#!forum/nameko-dev
    Antonio Di Mariano
    @antoniodimariano
    Hi guys
    here I am with my first question about nameko. @mattbennett I hope you can give me some good advices
    Basically, I am looking to run some before_method check, in order to validate the body or just check if a POST request has a payload.

    Using Flask I can define something like

    @self.app.before_request
            def before_request():
                if 'Authorization' not in request.headers:
                    abort(401)
                if request.method == 'POST':
                    if not request.json:
                        abort(400)

    I was wondering how I can do it with nameko

    Matt Yule-Bennett
    @mattbennett
    Hey @antoniodimariano. The exact equivalent of this would be to create a custom entrypoint that inherited from the built-in HTTP one, and modified the handle_request logic (see https://github.com/nameko/nameko/blob/master/nameko/web/handlers.py#L40)
    However, you may want to be more granular and check these things for certain entrypoints only. For that I would use a decorator around the service method that inspected the request object before maybe calling the wrapped method. There's an example of that here: https://github.com/nameko/nameko-amqp-retry/blob/master/nameko_amqp_retry/decorators.py#L30
    Someshwar Dash
    @someshwardash
    Hello everyone! Is using nameko as an api server recommended? Or stick to NodeJS/Flask?
    Antonio Di Mariano
    @antoniodimariano
    hey @someshwardash . Here I am
    I moved to nameko after a few years with Node.js
    so, I would rather say I am still in the 'learning mode'
    but happy to know that we are in the same boat
    so AFAIK nameko is a good solution, but I ‘ve not testing it in production yet
    Someshwar Dash
    @someshwardash
    I'm not really using Nameko as my API server, mainly using it for running smaller services for computations etc. Still using NodeJS as my primary API server. Although I do have a few APIs being served from Nameko which are suddenly giving me issues (Although the errors might be because I am missing something)
    Antonio Di Mariano
    @antoniodimariano
    yes, I see your point. I am still trying to figure out if node.js is better in terms of API server or python can raise the voice
    if you wanna share your piece of code,
    FoxMaSk
    @foxmask
    o/
    FoxMaSk
    @foxmask
    is there a way to dynamically define a RpcProxy of a service ? Because I don't know which service will depeend on anotyher one in advance. I made a project like IFTTT.com where you can plug service with each other but of course, you don't know what service will depend on another one
    or show I just use nameko.event instead of rpc ?
    Antonio Di Mariano
    @antoniodimariano
    I think you can go with nameko.event but
    how dinamically would you like to define a rpc?
    as soon as you plug in a new service you define a new proxy to use?
    FoxMaSk
    @foxmask
    i dont know :) i'm a beginner with nameko I search my path :)
    Antonio Di Mariano
    @antoniodimariano
    welcome :) I am more than a begineer with nameko
    ffs, I would like to have more documentation and more examples
    real use example I mean
    not the common stuff
    FoxMaSk
    @foxmask
    I agree
    Antonio Di Mariano
    @antoniodimariano
    in the end, nothing is simple in a microservices architecture so
    ...
    for exampe, anyone know how I can disable the debug message in nameko
    I am using the logging module
    but I have the console full of msgs like
    2017-12-19 15:35:46,472 nameko.containers DEBUG    signalling result for <WorkerContext [proxy.register_action] at 0x105ce79b0>
    tore down worker <WorkerContext [proxy.register_action] at 0x105ce79b0> in 0.000s
    FoxMaSk
    @foxmask
    i tested wamp.ws earlier ; I think I could find my marks but it's not trivial ; need time to test
    Antonio Di Mariano
    @antoniodimariano
    what’s about?
    in order to dinamically assign a proxy?
    FoxMaSk
    @foxmask
    or event_handler
    Matt Yule-Bennett
    @mattbennett
    @antoniodimariano, add a logging configuration to your config.yaml and set the level of the root logger there. example: http://nameko.readthedocs.io/en/stable/cli.html?highlight=logging#running-a-service
    Antonio Di Mariano
    @antoniodimariano
    thanks a lot.
    Matt Yule-Bennett
    @mattbennett
    @foxmask there is a recent thread on the mailing list exactly about dynamic RPC proxies: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/nameko-dev/XE-uarCEV00
    FoxMaSk
    @foxmask
    @mattbennett thanks a lot