Re: [akka-user] how to enable secure tcp socket connection on server side in Akka

2016-09-29 Thread Gaurav Kumar Jayswal
Thanks for you reply. I'm new in akka. I didn't get how to enable secure 
tcp chat server, while binding. Can you plz give some example code...

Tcp.get(getContext().system()).manager().tell(TcpMessage.bind(getSelf(), 
inetSocketAddress, 100), getSelf());


On Thursday, 29 September 2016 17:01:47 UTC+5:30, Konrad Malawski wrote:
>
> Please refer to the documentation: 
>
> http://doc.akka.io/docs/akka/2.4.10/java/http/server-side-https-support.html#ssl-config-java
>
> It has a nice search box which you can use to search for "SSL".
>
> -- 
> Konrad `ktoso` Malawski
> Akka  @ Lightbend 
>
> On 29 September 2016 at 13:28:51, Gaurav Kumar Jayswal (me.ga...@gmail.com 
> ) wrote:
>
> In Mina Simply I have added by this. 
>
>
> private static void addSSLSupport(DefaultIoFilterChainBuilder chain) throws 
> Exception {
>SslFilter sslFilter = new SslFilter(new 
> SSLContextGenerator().getSslContext());
>chain.addFirst("sslFilter", sslFilter);
> }
>
>
> Can anyone let me know how to add sslcontext in Akka tcp 
>
> --
> >> 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 akka-user+...@googlegroups.com .
> To post to this group, send email to akka...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: What's the replacement for Akka Actor Publisher and Subscriber?

2016-09-29 Thread Justin du coeur
I think you're missing the important word here: they can't be used with
*remote* actors.  As I understand it, the point is that you can't just
connect it to any old Actor, which might be on some other node -- you can
only do it with *local* Actors...

On Wed, Sep 28, 2016 at 11:50 PM, Dagny T  wrote:

>  I have a JS Websocket streaming into an Akka Http Server; but I want to
> keep in-memory the latest aggregate state in an Akka Actor.
>
> i.e. Is that just using CQRS on the datastore, so I wouldn't be connecting
> the Akka Actor (Query Read Response-side) directly to the Akka Http Server
> (Command) writer.
> Rather, the writer writes events; and the Akka Actor reads events to
> 'rollup' to the aggregate state?
>
> I looked up Actor Publisher and Actor Subscriber, but their use with
> Streams is deprecated in the latest docs -- 'deadlock' risk (see my prior
> message).
>
> THANKS!
> Dagny
>
> On Monday, September 26, 2016 at 12:07:55 AM UTC-7, Dagny T wrote:
>>
>> Hi there,
>>
>> The latest info I have from a prior Akka Team response was that the Akka
>> Actor Publisher/Subscriber APIs are now deprecated;
>> and one should be looking at the Graph DSL instead.
>>
>> i.e. Latest Akka Docs state:
>> ActorPublisher and ActorSubscriber
>>  cannot be used with remote actors,
>> because if signals of the Reactive Streams protocol (e.g. request) are
>> lost the the stream may deadlock.
>>
>> So, now I'm not clear on what the replacement APIs we're supposed to be
>> using; as far as connecting State-Holding Akka Actors to Graph DSL
>> Event-Streams.
>>
>> Is there an Akka Team Blog with a GitHub link to a small focused example
>> which demonstrates this?
>>
>> THANKS in advance for any help with finding the latest APIs to use for
>> this!
>> Dagny
>>
>>
>> --
> >> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Successor Technology to Microkernal

2016-09-29 Thread Joseph Mansigian

I read that the Microkernal was going away.  Would you tell me, if you can:

- The name of the successor technology.
- A link to doc on it
- Will new technology be able to put anything found in Akka with Scala in 
one package?
- Any idea when it will roll out?
- When will Microkernal be removed?

Thanks

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Understanding akka.http.server.max-connections

2016-09-29 Thread Federico Nusymowicz
My websocket server will maintain many (mostly idle) connections.

Does `akka.http.server.max-connections` place a limit on the number of open 
websockets?

Or is  `akka.http.server.max-connections` a limit on the number of 
websockets that can be opened concurrently?

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: [akka-stream] How to implement Spark's cogroup/join operation

2016-09-29 Thread Jakub Liska
I'm trying to figure out why this is hanging/idling indefinitely : 

Source.fromIterator(() => Iterator.from(0).take(500).map(_ -> 1))
  .groupBy(Int.MaxValue, _._1)
  .mergeSubstreamsWithParallelism(256)
  .runWith(Sink.seq)

This is the only way how to avoid instantiating ridiculous amounts of sub 
streams.

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Beginner questions

2016-09-29 Thread Massim0
I think for "*2\ Can actors have states ?*" the documentation is clear 
enough :

> One actor, which is to oversee a certain function in the program might 
> want to split up its task into smaller, more manageable pieces. For this 
> purpose it starts child actors which it supervises 

...  

The quintessential feature of actor systems is that tasks are split up and 
> delegated until they become small enough to be handled in one piece

 I have not yet seen how a parent can create child but I think it will be 
clear soon.


On Thursday, 29 September 2016 15:30:43 UTC+2, Massim0 wrote:
>
> Hi There,
>
> I have a (Java) application that collect information form various sources 
> (SCM, Execution envs, Issues tracker, ..) with the goal of identifying "
> *violations*" on our *products* (New component found, New dependency 
> found, No sources for project, Wrong name, ..) and publish them as events.
> It work and start to gain attention from colleagues but some tasks are 
> really long and while the code seems clear, it will become hard to reason 
> in term of responsibilities. That's why I would like to evolve to Akka but 
> I don't have any experience with Akka and would have a clear view on the 
> "how to" before starting.
>
>
> *1\ Is it a good use case for Akka ?*
> I would like to make the whole system as much asynchronous as I can 
> because some inspections are really slow. But also because I rely mainly on 
> conventions and that when they are not followed I got exceptions and the 
> system crash. While with Akka I can publish the error as violation and 
> continue.
>
> *2\ Can actors have states ?*
> I'm not speaking of finite state machine but more about "context". In the 
> hello world tutorial, the Greeter actor has one `*var *message`. That 
> means that If I send it three different `WhoToGreet(name)` before `Greet` 
> then it is only the latest name that will be used. That seems a little 
> weird so I think an usual pattern will be to create multiple instances of 
> the same actor. In my case I should have one `Actor` per *Product* that 
> will spawn one actor per kind of *violation*.
>
> If that is the correct way of working, is it the role of the parent actor 
> to create the child `ActorRef` of should I use another mechanism (which 
> one ?)
>
> *3\ Where to put the business code ?*
> I have the notion of *inspector* that detect one kind of violation. And 
> some services to obtains raw information. May I merge them within my actors 
> or just call them from the actors ?
>
> Thanks a lot for your replies.
>

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Problem detecting Websocket failure

2016-09-29 Thread 'Alexej Haak' via Akka User List


source
  .viaMat(
Http().webSocketClientFlow(
  WebSocketRequest(
host + "/console")
)
  )(Keep.both)
  .alsoTo(Sink.onComplete(_ => {
self ! RestartWebsocket
  }))
  .toMat(sink)(Keep.left)
  .run()

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Beginner questions

2016-09-29 Thread Massim0
Hi There,

I have a (Java) application that collect information form various sources 
(SCM, Execution envs, Issues tracker, ..) with the goal of identifying "
*violations*" on our *products* (New component found, New dependency found, 
No sources for project, Wrong name, ..) and publish them as events.
It work and start to gain attention from colleagues but some tasks are 
really long and while the code seems clear, it will become hard to reason 
in term of responsibilities. That's why I would like to evolve to Akka but 
I don't have any experience with Akka and would have a clear view on the 
"how to" before starting.


*1\ Is it a good use case for Akka ?*
I would like to make the whole system as much asynchronous as I can because 
some inspections are really slow. But also because I rely mainly on 
conventions and that when they are not followed I got exceptions and the 
system crash. While with Akka I can publish the error as violation and 
continue.

*2\ Can actors have states ?*
I'm not speaking of finite state machine but more about "context". In the 
hello world tutorial, the Greeter actor has one `*var *message`. That means 
that If I send it three different `WhoToGreet(name)` before `Greet` then it 
is only the latest name that will be used. That seems a little weird so I 
think an usual pattern will be to create multiple instances of the same 
actor. In my case I should have one `Actor` per *Product* that will spawn 
one actor per kind of *violation*.

If that is the correct way of working, is it the role of the parent actor 
to create the child `ActorRef` of should I use another mechanism (which one 
?)

*3\ Where to put the business code ?*
I have the notion of *inspector* that detect one kind of violation. And 
some services to obtains raw information. May I merge them within my actors 
or just call them from the actors ?

Thanks a lot for your replies.

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Akka streams in web application

2016-09-29 Thread Madabhattula Rajesh Kumar
Hi,

I am planning to use Akka Streams in web application. Below is my use case.

Whenever the request come to web server, I will do some operations like 
stg01, stg02 ...

*I have a below questions :- *

   - Do we need to close the streams after each request processed ?
   - If N multiple requests come, below invoke method will execute in N 
   times with parallel. In this case, how the actors will create and close ?
   

Below is the example code snippet :- 

  implicit val actorSystem = ActorSystem("Example")
  implicit val materializer = ActorMaterializer()
  implicit val executor = actorSystem.dispatcher
  val ll = scala.collection.mutable.ListBuffer[String]()
  ll += "123"; ll += "456"; ll += "789"
  invoke(ll.toList)
  
  def invoke(customerId: List[String]) {
val source = Source(customerId)
val sink = Sink.foreach[String] { x => display(x) }
val stg01 = Flow[String].map { x => getStg01(x) }
val stg02 = Flow[Int].map { x => getStg02(x) }

*val runnable = source via stg01 via stg02 to sink*

  *  runnable.run*

  }
  def getStg01(request: String) = request.toInt
  def getStg02(request: Int) = request.toString
  def display(request: String) = println(" EVENT ===> " + request)
}

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] how to enable secure tcp socket connection on server side in Akka

2016-09-29 Thread Gaurav Kumar Jayswal


In Mina Simply I have added by this. 


private static void addSSLSupport(DefaultIoFilterChainBuilder chain) throws 
Exception {
   SslFilter sslFilter = new SslFilter(new 
SSLContextGenerator().getSslContext());
   chain.addFirst("sslFilter", sslFilter);
}


Can anyone let me know how to add sslcontext in Akka tcp 

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Memory Bounding Akka Streams

2016-09-29 Thread Endre Varga
On Thu, Sep 29, 2016 at 1:41 AM, Dagny Taggart 
wrote:

>
>
> LATEST updated understanding I have then is the following; and if someone
> could PLEASE correct my (Newbie) understanding with a link to a clear Blog
> Post or GitHub repo illustrating the concept!
>
> 1) The Akka Stream Graph DSL API's abstraction-level hides the details of
> handling Backpressure between Source to Sink.
>
> i.e. A Developer never has to call the Publisher or Subscriber APIs to
> initially request or signal Sink capacity for bytes of data; nor to call
> 'onNext' to get the next batch of data after processing the first batch.
> Akka Streams handles this 'under-the-covers'.
>

Yes.


>
> 2) Buffers (of specified Byte size) and with various drop strategies (e.g.
> drop oldest event, etc) can be specified on each Graph DSL API's Flow
> Stage.  This would delay the signal back to prior Stage to Source to 'slow
> down' when the (default-sized) Akka Byte memory buffer is pressured.
>

Yes.


>
> 3) At the moment; I understand that a backpressured Source will just
> appear to 'slow down'.  In which case, I suspect memory on the Source would
> be pressured with the backpressure signal if Sink is slower in processing
> Source data.
>

This is not necessarily true...


>
> SUMMARY QUESTION:
> I just don't know how to pickup that backpressure signal on an Http
> Websocket Javascript client;
> so that I can show some kind of Error-Message to the mobile or webapp User
> that they have to slow down on their event activity due to system overload.
> i.e. What's an example of using a high-level Akka API method would o do
> this!
>

It is actually very simple. HTTP uses as its underlying protocol. TCP has
backpressure built-in. When an Akka Stream on the consumer side of an HTTP
connection backpressures, then TCP slows down automatically, propagating
the backpressure to the client.

On the Javascript side then various things can happen as the local TCP
buffer gets full (due to not sending new packets because of backpressure):
 - if the Javascript code called a blocking call, then simply the call will
not return until buffer space frees up locally so that it can enqueue the
packet
 - if the Javascript code calls a non-blocking call that calls a callback
once finished with send, then the callback won't be called until local
buffer-space frees up and it can enqueue the packet.

-Endre


>
> THANKS in advance!
> D
>
>
>
>
>
> On Wed, Sep 21, 2016 at 11:01 AM, Dagny T  wrote:
>
>>
>> Just wanted to check with folks if I had the correct implementation for
>> how to protect from blowing up memory when working with Akka Streams.
>>
>> I've merged a Lightbend Blog post's code, with the latest API changes for
>> Akka v2.4.9, and the latest documentation about buffered streams in the
>> v2.4.9 API Docs.
>>
>> However, none of those explain these questions I have.  Please see
>> question comments, regarding the code snippet below it!  THANKS in advance
>> for any insights!
>>
>> // TODO 3:  MODIFIED to calling buffered API within Graph mapping -- check 
>> assumptions!
>> //  - where INTERNAL Akka implementation calls onNext() to get next 
>> BUFFERED batch,
>> //so you don't have to worry about it as a DEV?
>> //  - NUMERIC bound of 10 refers to NUMBER of elements (of possibly 
>> complex types) on a
>> //UNIFORM-ELEMENT-TYPED stream, rather than Bytes, right?
>> //  - if source produces N < BUFFER_MAX elements; then those are 
>> simply passed through the pipeline without
>> //waiting to accumulate BUFFER_MAX elements
>> //
>>
>>
>> inputSource.buffer(10, OverflowStrategy.dropHead) ~> f1 ~> ...
>>
>> --
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: http://doc.akka.io/docs/akka/c
>> urrent/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Akka User List" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/akka-user/bolqHjF_dvc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> akka-user+unsubscr...@googlegroups.com.
>> To post to this group, send email to akka-user@googlegroups.com.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> >> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to 

Re: [akka-user] Memory Bounding Akka Streams

2016-09-29 Thread Gonzalo Ortiz Jaureguizar
2016-09-29 1:41 GMT+02:00 Dagny Taggart :

>
>
> LATEST updated understanding I have then is the following; and if someone
> could PLEASE correct my (Newbie) understanding with a link to a clear Blog
> Post or GitHub repo illustrating the concept!
>
> 1) The Akka Stream Graph DSL API's abstraction-level hides the details of
> handling Backpressure between Source to Sink.
>
> i.e. A Developer never has to call the Publisher or Subscriber APIs to
> initially request or signal Sink capacity for bytes of data; nor to call
> 'onNext' to get the next batch of data after processing the first batch.
> Akka Streams handles this 'under-the-covers'.
>

That is correct (except the bytes part).


>
> 2) Buffers (of specified Byte size) and with various drop strategies (e.g.
> drop oldest event, etc) can be specified on each Graph DSL API's Flow
> Stage.  This would delay the signal back to prior Stage to Source to 'slow
> down' when the (default-sized) Akka Byte memory buffer is pressured.
>

That is, again, correct except the bytes part. As I said before, each stage
has its own policy that decides when it backpreassures the upstream, but
there are no build in stage that blocks by a number of bytes. There is a
specific stage called buffer that backpreassures when a specified number of
elements have been recived form upstream but not consumed by downstream. An
element is an object and therefore it contains more than one byte. In some
contexts, when there is a function that defines the number of bytes your
elements have, you could use other builtin stages like batchWeight to
simmulate what you are saying. For example, you coud use it to batch
elements that are a buffer of bytes. It may be the case that, on Akka HTTP
context, some specialyzed stage is backpreassuring using a condition
relative to bytes, but I have no experience with Akka HTTP, so I cannot
help you there.


>
> 3) At the moment; I understand that a backpressured Source will just
> appear to 'slow down'.  In which case, I suspect memory on the Source would
> be pressured with the backpressure signal if Sink is slower in processing
> Source data.
>

Akka Stream backpreassure system is, in fact, very simple. A stage cannot
emit new elements to the downstream until the downstream ask for more
elements. Then, if you have a slow consumer at the end of your stream, a
fast producer at the beginning and no special backpreassure stage in the
middle (for example, one that drops elements), then your producer will be
eventually backpreassured. How your source reacts to backpreassure totally
depends on you. In my company project, for example, the producer is an open
cursor to a database and we don't fetch new elements until our downstream
ask for more elements. Ideally, it is fine. On practice, if the consumer is
very slow, the database cursor can be closed by the remote database, so we
have to react to that (in our case it is usually enough to reopen the
cursor, but in some cases we need to relay to other more expensive fallback
mechanics)


>
> SUMMARY QUESTION:
> I just don't know how to pickup that backpressure signal on an Http
> Websocket Javascript client;
> so that I can show some kind of Error-Message to the mobile or webapp User
> that they have to slow down on their event activity due to system overload.
> i.e. What's an example of using a high-level Akka API method would o do
> this!
>

As I said, I have no experience with Akka HTTP, so I don't know what is
going to happen when the server is backpreassured.



>
> THANKS in advance!
> D
>
>
>
>
>
> On Wed, Sep 21, 2016 at 11:01 AM, Dagny T  wrote:
>
>>
>> Just wanted to check with folks if I had the correct implementation for
>> how to protect from blowing up memory when working with Akka Streams.
>>
>> I've merged a Lightbend Blog post's code, with the latest API changes for
>> Akka v2.4.9, and the latest documentation about buffered streams in the
>> v2.4.9 API Docs.
>>
>> However, none of those explain these questions I have.  Please see
>> question comments, regarding the code snippet below it!  THANKS in advance
>> for any insights!
>>
>> // TODO 3:  MODIFIED to calling buffered API within Graph mapping -- check 
>> assumptions!
>> //  - where INTERNAL Akka implementation calls onNext() to get next 
>> BUFFERED batch,
>> //so you don't have to worry about it as a DEV?
>> //  - NUMERIC bound of 10 refers to NUMBER of elements (of possibly 
>> complex types) on a
>> //UNIFORM-ELEMENT-TYPED stream, rather than Bytes, right?
>> //  - if source produces N < BUFFER_MAX elements; then those are 
>> simply passed through the pipeline without
>> //waiting to accumulate BUFFER_MAX elements
>> //
>>
>>
>> inputSource.buffer(10, OverflowStrategy.dropHead) ~> f1 ~> ...
>>
>> --
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: http://doc.akka.io/docs/akka/c
>> 

[akka-user] Re: DDD/CQRS - Modifying write model solely to support read model projection

2016-09-29 Thread Renato Cavalcanti
Yes, indeed. I think this question is more suited to the DDD/CQRS group. 

I posted a reaction there. 

Cheers

On Tuesday, 27 September 2016 22:31:37 UTC+2, rrodseth wrote:
>
> I asked this over on the DDD/CQRS list, but didn't get a reply, so I 
> thought I'd try here.
>
> Imagine a system to notify users about alarms. I'm using Akka Persistence 
> which supports streaming projections from the event store to the read side.
>
> I'm considering three aggregates, (alarm)Definition, Site and User.
> Definitions and Users each have a site path which associates them with 
> sites. When a user is opted in we can connect it to accessible sites. When 
> a definition is created or updated, we can connect it to applicable sites.
>
> The definition aggregate may in fact not be needed for notifications, 
> since when an alarm occurs, the occurrence already knows about the site, so 
> navigation could start with that aggregate and dispatch to the opted-in 
> users.
>
> However, the read model may need to support "get users(subscribers) by 
> definition". I could extend the write path so that when a user is opted in 
> it is associated not only with accessible sites, but also with definitions 
> applicable to those sites. Or perhaps the site aggregate coud make the 
> association internally between users and definitions. Either way, that 
> logic would most likely be there solely to support the read model 
> projection. Is that unusual or a red flag of any sort?  
>
> Thoughts?
>

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.