Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add supervised API #4

Open
4 of 5 tasks
oubiwann opened this issue Feb 6, 2017 · 5 comments
Open
4 of 5 tasks

Add supervised API #4

oubiwann opened this issue Feb 6, 2017 · 5 comments
Assignees
Labels
Milestone

Comments

@oubiwann
Copy link
Member

oubiwann commented Feb 6, 2017

One of the things I've noticed when working with the Erlang RabbitMQ library is how easy it is to crash a process (usually through a fault of my own, e.g., by calling a function improperly -- wrong types or wrong number of parameters). Regardless, abuse like this results in a bad user/developer experience and makes writing applications that much more finicky.

What I propose we do is provide a unifying API in the kanin module that, when started, creates a supervised kanin server that maintains connection options, connection(s), and channel(s) as state and when child processes die, new connections, channels, etc., are created automatically.

Furthermore, we could provide a default channel that is used implicitly making the API even easier to use.

Features/tasks:

Part of release v0.7.0

@oubiwann
Copy link
Member Author

oubiwann commented Feb 6, 2017

I'll set this task as an epic and create features/tasks

@oubiwann
Copy link
Member Author

oubiwann commented Feb 6, 2017

@arpunk: Would this sort of thing be of interest/help to you?

@oubiwann oubiwann added the epic label Feb 6, 2017
@oubiwann oubiwann added this to the 0.7.0 milestone Feb 6, 2017
@oubiwann oubiwann changed the title Add supervised wrapper Add supervised API Feb 6, 2017
@arpunk
Copy link

arpunk commented Feb 6, 2017

@oubiwann Yes, I use this sort of strategy all the time (I work with RabbitMQ on a daily basis). In my experience all the pooling strategies are very opinionated. However these are my ideas:

  • Use sbroker based pools. Writing pooling strategies is very hard and it ends up being opinionated and not flexible for various use cases.
  • Provide backpressure mechanisms. Being able to rate-limit producers/consumers is very convenient. I've suffered a lot from these on very high throughputs. As above you will want to go with a standard solution (pobox, fuse, sbroker, etc.)

I currently use GenStage based consumers at work using wabbit and/or custom AMQP wrappers.

I tend to wrap very lighly on the standard RabbitMQ Erlang clients. Sometimes I use turtle for simplicity when working on small PoC/MVP in Erlang.

@oubiwann
Copy link
Member Author

oubiwann commented Feb 6, 2017

@arpunk This is great feedback -- thanks!

@oubiwann
Copy link
Member Author

oubiwann commented Feb 9, 2017

@arpunk I'm much happier using this new API in the kanin module that the old one (which mirrors the native Erlang client). Still WIP, but making good progress. Default supervision tree is up next.

Compare examples:

After this release, one tedious (to implement) improvement that could be made would be to convert calls like this:

    (kanin:call
      (make-queue.bind
        queue example-queue
        exchange example-exchange
        routing_key example-key))

into this:

    (kanin:bind-queue
      queue example-queue
      exchange example-exchange
      routing-key example-key)

Much better developer experience ... but that's more than I want to tackle right now ;-)

@oubiwann oubiwann mentioned this issue Feb 10, 2017
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants