Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Ray Ch
    @iraycd
    We use Mali for 90% of our microservices.
    Great work.
    Bojan
    @bojand
    hey thanks!
    Bojan
    @bojand
    How do you use and what for specifically. What kind of services and work. It would be interesting to know.
    Ray Ch
    @iraycd
    Check PM
    Ray Ch
    @iraycd
    Hey, Do you have any recommandation for load testing?
    Bojan
    @bojand
    hmm not really sure besides writing something yourself… quick search
    https://nghttp2.org/blog/2015/03/27/nghttp2-v0-7-9/
    supposedly locust can be extended to support grpc. they have an example for xml-roc
    https://docs.locust.io/en/latest/testing-other-systems.html
    there is this https://github.com/emicklei/hazana which one could use to write test against any server i think
    Ray Ch
    @iraycd
    Yeah, I thought there was something based on JS
    :smile:
    Bojan
    @bojand
    yea dont think so heh
    might be able to do something using benchmark js but tbh i havent had the best of luck with that lib when I had tried it before a couple of times, i wasn’t quite sure i was getting completely correct results compared to my own custom written benchmarking / timing. but maybe i was mistaken.
    and that was only really to benchmark actual code / functions
    Bojan
    @bojand
    Forgot about this lib but could probably be pretty useful to just roll your own test
    Ray Ch
    @iraycd
    :smile: This is great.
    Ray Ch
    @iraycd
    Thank you for ctx.res = new Error(“Boom!”)
    Ferrellio
    @_ferrellio_twitter
    Good morning. Is there any guidance, or recommended patterns on how to test services written using Mali?
    Bojan
    @bojand
    hello, depends on the context. strictly speaking normally in your setup you can just create your app and start it on OS assign 0 port, and then do your calls to the service in the tests. on teardown close the service. i am ignoring other dependenices like db’s or other services.
    this is more like functional / integration testing.
    Ferrellio
    @_ferrellio_twitter
    Got it, thanks for the guidance.
    Bojan
    @bojand
    ideally your handler implementation would just be a function that returns / emits whatever is the payload(s), so then you can just unit test them individually w/o relying on specifics of the transport
    Ferrellio
    @_ferrellio_twitter
    Yeah, that's what I've done so far. Just testing the handlers within unit testing, and services, repositories, etc.
    It's still nice to get the end to end assurance. :)
    Ferrellio
    @_ferrellio_twitter
    Hi again - what is the preferred way to catch if app.start cannot bind to the provided port (such as is the case when it is already in use.)?
    Bojan
    @bojand
    hmm that’s a good a good question… the core server doesn’t seem to throw or anything.. just logs it
    i’ll have to look into it some more when I have some more time
    Ferrellio
    @_ferrellio_twitter
    Thanks, created as malijs/mali#39
    Greg Keys
    @gregkeys
    Can malijs be used with grpc-web?
    Bojan
    @bojand
    probably possible, but you would need to add gRPC-Web compatibility to the server using grpcwebproxy, and then use grpc-web-client from the browser to talk to the backend via the proxy.
    https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy
    not something I’ve personally experimented with. I’ll have to try and find some time to do an example or a demo
    Greg Keys
    @gregkeys

    That would be really helpful, Im trying to find a very simple demo in order to do a presentation on why we should switch from crossbar.io (websockets) to gRPC, so far its not as simple as it seems at firlst look. Mali looks really clean and simple, but it appears to be focused primarily towards the backend of things.

    our ultimate goal is to use web components (front end micro services) which talk to our backend server micro services using gRPC

    Bojan
    @bojand
    Yea in general grpc story is not very good for client side (from browser) interaction right now out of the box. It usually involves some kind of proxy at the moment. There is an official project here too: https://github.com/grpc/grpc-web that's in beta now and requires a proxy as well. But in future they are planning to improve things. Mobile and server to server is more the main usage now, but I imagine web based will improve.
    Stephen Dahl
    @stephen-dahl
    is there a way to unit test mali?
    Bojan
    @bojand
    Yes. Depends what you mean by unit test exactly and what you want to test specifically. Some of it may be more of an independant functional or integration tests. But regardless your service implementation should just be functional components that you can independenantly test.
    Ferrellio
    @_ferrellio_twitter
    :point_up: That's what we've been doing. Unit testing the handler methods, stubbing out the context. @stephen-dahl
    Mina Luke
    @menocomp
    I had this warning when using new Mali(PROTO_PATH, 'UserService')
    grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead
    Mina Luke
    @menocomp
    ah my mistake. I was using old version of Mali. It is running now correctly with no warnings in the latest version.
    Bojan
    @bojand
    :thumbsup:
    Mina Luke
    @menocomp
    I am trying to create a date from/to timestamp transformation for my rpc services. Is there a Mali middleware that do that for me?
    Bojan
    @bojand
    hi, can you elaborate some more on what exactly do you mean?
    Mina Luke
    @menocomp
    @bojand I am defining all date fields in proto files as google.proto.timestamp which worked correctly by using (seconds/nanos) however I have to write a JS function to convert every single date field in the response object to be timestamp.
    Also, in the calling service, I have to reverse all those timestamps to their original JS dates.
    I am curious if there is a middleware or something that can achieve this automatically for me.
    Bojan
    @bojand
    Hmm the only thing that I can think of that may help is https://github.com/malijs/param
    That's on the incoming request