Hi Daniel,

I made my anwser below. Your opinion is valuable for me and I would like
you get code review from you.

Best Regards,
MK

2014-10-29 10:18 GMT+01:00 Daniel Armak:

> Hi Michal,
>
> I'm interested in why you rolled your own RS implementation: was it
> because you didn't want a dependency on akka, or because akka-streams isn't
> stable enough yet, or for some other reason?
>


It's actually very good question. Simple anwser is: by just providing
implementation of *Publisher*/*Subscriber* everyone can use it: Akka
Streams, RxJava, vert.x, Reactor, ratpack, etc.

Longer anwser:

1) Exposing AMQP interface requires just *Publisher* & *Subscriber* (and
maybe *Processor* if you want to issue acknowledgements manually)

I don't need to provide or use any of Akka Streams/other features like
Source/Sink, combinators, AST flatteners etc

2) RabbitMQ Java library uses it own thread pool that keeps track of
connection/channel state and is capable of running client callbacks in order

Adding Akka on top of that means:
  a) more resources used (additional ForkJoin pool to RabbitMQ thread pool)
  b) more message passing without added value (I discuss potential value
later),
  c) more complex configuration.

Most of the hard stuff is already implemented in Java RabbitMQ client.

3) Using Akka Streams would still require me to do almost same amount of
work

AMQP flow control can be made using these protocol features:
  a) basicGet
  b) channel QOS
  c) flow blocking (consumer asks broker to stop sending messages or broker
asks publisher to stop producing)
  d) recover (consumer asks broker to redeliver unacknowledged messages
with or without requeing)

I still have to play with them by myself.


>
> If there was a different library, smaller/more lightweight than akka
> actors, that provided a generic implementation of RS, would you have used
> it? What would you want from such a library?
>

Using Akka Actor would be beneficial for few reasons:
  a) state - for buffering (now: ScalaSTM),
  b) synchronization - increaseing and decreasing demand (now: ScalaSTM),
  c) distribution - offloading *onNext(t: T)* calls inside *request(n:
Long)* to avoid unbounded recursion (now: Scala Global *ExecutionContext* but
I'm considering switching to RabbitMQ thread pool)


>
> Thanks,
>
> --
> Daniel Armak
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to