Re: [akka-user] expectNoMessage keeps unexpected message in the queue

2018-01-08 Thread Christophe Pache
Thanks, Konrad! I think it make sense! 

Cheers,
Christophe

Le mardi 9 janvier 2018 04:27:32 UTC+1, Konrad Malawski a écrit :
>
> I see! Thanks for digging that up. 
> I think that was an un-intended change so I’ll fix that right away.
>
> Issue here https://github.com/akka/akka/issues/24270 PR soon.
>
> -- 
> Cheers,
> Konrad 'ktoso ' Malawski
> Akka  @ Lightbend 
>
> On January 8, 2018 at 19:22:08, Christophe Pache (chp...@gmail.com 
> ) wrote:
>
> Hello Conrad, thanks for answering!
>
> I was speaking about the internal queue of the TestActor.
>
> I upgraded from 2.5.3 to 2.5.8, in 2.5.3, the behavior was not the same:
>
>
>
>
> 
> private def expectNoMsg_internal(max: FiniteDuration) { 
>
>val o = receiveOne(max) 
>assert(o eq null, s"received unexpected message $") 
>lastWasNoMsg = true 
>
>  }
>
>
>
> Le lundi 8 janvier 2018 11:14:17 UTC+1, Konrad Malawski a écrit : 
>>
>> What do you mean?
>> What queue?
>>
>> They are both implemented using the exact same internal method:
>>
>> @deprecated(message = "Use expectNoMessage instead", since = "2.5.5")
>> def expectNoMsg(max: FiniteDuration) {
>>   expectNoMsg_internal(max.dilated)
>> }
>>
>> /**
>>  * Assert that no message is received for the specified time.
>>  * Supplied value is not dilated.
>>  */
>> def expectNoMessage(max: FiniteDuration) = {
>>   expectNoMsg_internal(max)
>> }
>>
>>
>>
>> Do you mean some other API? If yes, which one? 
>>
>> -- 
>> Cheers,
>> Konrad 'ktoso ' Malawski
>> Akka  @ Lightbend 
>>
>> On January 8, 2018 at 19:11:30, Christophe Pache (chp...@gmail.com) 
>> wrote:
>>
>> Hello everyone,
>>
>> I would be interested to understand why `expectNoMessage`, in case there 
>> is unexpected message, keeps it on the queue (compared to expectNoMsg). 
>> It's all fine but from API point of view, my feelings would not expect such 
>> behavior (maybe because of other API). Maybe more doc on that would be an 
>> idea.
>>
>> Thanks and have a nice day.
>>
>> Christophe
>> --
>> >> 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+...@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.


[akka-user] Akka-streams: Increase processing rate:

2018-01-08 Thread kor
Hello all. I have a requirement where I need to stream records from a 
couchbase database, do some json transformations and post the result to a 
rest endpoint (implemented with Akka-Http). I've tested that endpoint in 
isolation using gatling, and it can handle at least 200 requests/sec. The 
problem I am having when I run it, I cannot get the speed to go past 10 
requests/sec. I've tested the speed that records are being pulled out of 
couchbase and got a rate of about 2700 records/sec so something is causing 
backpressure to be applied to the source. I've also tried posting to a 
different public endpoint (probably not implemented with akka-http) and the 
speed increases to about 80 requests/sec. I've posted the code below. How 
can I make things go faster? Disclaimer: I am new to akka-streams.

code: https://gist.github.com/khalidr/1a392680c0ed744b2d3e5cec1e1f193a

Any help would be appreciated.

-- 
>>  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] expectNoMessage keeps unexpected message in the queue

2018-01-08 Thread Konrad “ktoso” Malawski
I see! Thanks for digging that up.
I think that was an un-intended change so I’ll fix that right away.

Issue here https://github.com/akka/akka/issues/24270 PR soon.

-- 
Cheers,
Konrad 'ktoso ' Malawski
Akka  @ Lightbend 

On January 8, 2018 at 19:22:08, Christophe Pache (chpa...@gmail.com) wrote:

Hello Conrad, thanks for answering!

I was speaking about the internal queue of the TestActor.

I upgraded from 2.5.3 to 2.5.8, in 2.5.3, the behavior was not the same:



private def expectNoMsg_internal(max: FiniteDuration) {
   val o = receiveOne(max)
   assert(o eq null, s"received unexpected message $")
   lastWasNoMsg = true
 }



Le lundi 8 janvier 2018 11:14:17 UTC+1, Konrad Malawski a écrit :
>
> What do you mean?
> What queue?
>
> They are both implemented using the exact same internal method:
>
> @deprecated(message = "Use expectNoMessage instead", since = "2.5.5")
> def expectNoMsg(max: FiniteDuration) {
>   expectNoMsg_internal(max.dilated)
> }
>
> /**
>  * Assert that no message is received for the specified time.
>  * Supplied value is not dilated.
>  */
> def expectNoMessage(max: FiniteDuration) = {
>   expectNoMsg_internal(max)
> }
>
>
>
> Do you mean some other API? If yes, which one?
>
> --
> Cheers,
> Konrad 'ktoso ' Malawski
> Akka  @ Lightbend 
>
> On January 8, 2018 at 19:11:30, Christophe Pache (chp...@gmail.com) wrote:
>
> Hello everyone,
>
> I would be interested to understand why `expectNoMessage`, in case there
> is unexpected message, keeps it on the queue (compared to expectNoMsg).
> It's all fine but from API point of view, my feelings would not expect such
> behavior (maybe because of other API). Maybe more doc on that would be an
> idea.
>
> Thanks and have a nice day.
>
> Christophe
> --
> >> 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.

-- 
>>  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] Akka 2.5.8 (Java Edition) Error initializing: java.lang.IllegalStateException: not yet initialized

2018-01-08 Thread Eduardo Fernandes
 
Fixed. As you've said there was a mix in initialization. I was using 
persistence jdbc version 3.0.0 which loaded an old version of the stream 
jar. After changing to 3.1.0 the problem was fixed. 

Many thanks for you time Patrik.

Regards.

-- 
>>  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: Processing `If-None-Match`

2018-01-08 Thread Colin Bester
Hell, if it was a snake it would have bit me :-)


On Monday, January 8, 2018 at 11:04:27 AM UTC-6, Colin Bester wrote:
>
> On server side using scala, akka-http (10.x) I am using 
> *optionalHeaderValueByType[`If-None-Match`]() 
> { reqETag => ... } *to extract `If-None-Match` header where reqETag is of 
> type *Option[If-None-Match].*
>
> On client side, the If-None-Match is created using
>
>   val entityTag = EntityTag(SomeSecurishString, weak = true)
>   val ifNone = `If-None-Match`(entityTag)
>
> On the server side I am looking to extract SomeSecureString, ie. the tag 
> value minus the prepended W/. I realize this can be done by 
> parsing/splitting value string but this feels real cumbersome and was 
> expecting an unapply function to come to the rescue.
>
>
> *`If-None-Match`.unapply* returns EntityTagRange which doesn't help me 
> much.
>
> Any suggestions on how to extract the EntityTag's tag string from 
> `If-None-Match`
>
> Much appreciated
>

-- 
>>  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] Processing `If-None-Match`

2018-01-08 Thread Colin Bester
I just knew I was running in circles, thanks!

On Monday, January 8, 2018 at 11:15:18 AM UTC-6, Konrad Malawski wrote:
>
> You can deconstruct the data structure on your own like this:
>
> val tag = EntityTag("kappa", weak = true)
> val ifNoneMatch = `If-None-Match`(tag)
>
> ifNoneMatch.m match {
>   case EntityTagRange.Default(tags) if tags.nonEmpty ⇒ tags.head.tag 
>   case EntityTagRange.Default(tags) ⇒ "" 
>   case EntityTagRange.`*` ⇒ ""
> }
>
>
> ifNoneMatch match {
>   case `If-None-Match`(EntityTagRange.Default(tags)) if tags.nonEmpty ⇒ 
> tags.head.tag
>   case `If-None-Match`(EntityTagRange.Default(tags)) ⇒ ""
>   case `If-None-Match`(EntityTagRange.`*`) ⇒ ""
> }
>
>
> Happy hakking
> -- 
> Cheers,
> Konrad 'ktoso ' Malawski
> Akka  @ Lightbend 
>
> On January 9, 2018 at 2:04:33, Colin Bester (bester...@gmail.com 
> ) wrote:
>
> On server side using scala, akka-http (10.x) I am using 
> *optionalHeaderValueByType[`If-None-Match`]() 
> { reqETag => ... }* to extract `If-None-Match` header where reqETag is of 
> type *Option[If-None-Match].* 
>
> On client side, the If-None-Match is created using
>
>   val entityTag = EntityTag(SomeSecurishString, weak = true)
>   val ifNone = `If-None-Match`(entityTag)
>
> On the server side I am looking to extract SomeSecureString, ie. the tag 
> value minus the prepended W/. I realize this can be done by 
> parsing/splitting value string but this feels real cumbersome and was 
> expecting an unapply function to come to the rescue.
>
>
> *`If-None-Match`.unapply* returns EntityTagRange which doesn't help me 
> much.
>
> Any suggestions on how to extract the EntityTag's tag string from 
> `If-None-Match`
>
> Much appreciated
> --
> >> 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] Processing `If-None-Match`

2018-01-08 Thread Konrad “ktoso” Malawski
You can deconstruct the data structure on your own like this:

val tag = EntityTag("kappa", weak = true)
val ifNoneMatch = `If-None-Match`(tag)

ifNoneMatch.m match {
  case EntityTagRange.Default(tags) if tags.nonEmpty ⇒ tags.head.tag
  case EntityTagRange.Default(tags) ⇒ ""
  case EntityTagRange.`*` ⇒ ""
}


ifNoneMatch match {
  case `If-None-Match`(EntityTagRange.Default(tags)) if tags.nonEmpty
⇒ tags.head.tag
  case `If-None-Match`(EntityTagRange.Default(tags)) ⇒ ""
  case `If-None-Match`(EntityTagRange.`*`) ⇒ ""
}


Happy hakking
-- 
Cheers,
Konrad 'ktoso ' Malawski
Akka  @ Lightbend 

On January 9, 2018 at 2:04:33, Colin Bester (bester.co...@gmail.com) wrote:

On server side using scala, akka-http (10.x) I am using
*optionalHeaderValueByType[`If-None-Match`]()
{ reqETag => ... }* to extract `If-None-Match` header where reqETag is of
type *Option[If-None-Match].*

On client side, the If-None-Match is created using

  val entityTag = EntityTag(SomeSecurishString, weak = true)
  val ifNone = `If-None-Match`(entityTag)

On the server side I am looking to extract SomeSecureString, ie. the tag
value minus the prepended W/. I realize this can be done by
parsing/splitting value string but this feels real cumbersome and was
expecting an unapply function to come to the rescue.


*`If-None-Match`.unapply* returns EntityTagRange which doesn't help me much.

Any suggestions on how to extract the EntityTag's tag string from
`If-None-Match`

Much appreciated
--
>> 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] Processing `If-None-Match`

2018-01-08 Thread Colin Bester
On server side using scala, akka-http (10.x) I am using 
*optionalHeaderValueByType[`If-None-Match`]() 
{ reqETag => ... } *to extract `If-None-Match` header where reqETag is of 
type *Option[If-None-Match].*

On client side, the If-None-Match is created using

  val entityTag = EntityTag(SomeSecurishString, weak = true)
  val ifNone = `If-None-Match`(entityTag)

On the server side I am looking to extract SomeSecureString, ie. the tag 
value minus the prepended W/. I realize this can be done by 
parsing/splitting value string but this feels real cumbersome and was 
expecting an unapply function to come to the rescue.


*`If-None-Match`.unapply* returns EntityTagRange which doesn't help me much.

Any suggestions on how to extract the EntityTag's tag string from 
`If-None-Match`

Much appreciated

-- 
>>  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] alpakka version of "Producer" or "Consumer" object?

2018-01-08 Thread Konrad “ktoso” Malawski
1. alpakka kinesis connector works well with KPL as well as KCL

It uses import com.amazonaws.services.kinesis.AmazonKinesisAsync

KPL seems to be the “kinesis data streams” api? That seems to use the same
PutRecord etc logic as we do though.


2. KinesisSources and KinesisSinks both work as "Producer" and "Consumer"
in the kafka sense.

Yes, pretty much.

— Konrad

-- 
>>  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] alpakka version of "Producer" or "Consumer" object?

2018-01-08 Thread Soichi Ishida
 Thanks for your answer.  I believe I am gettin' it.

Please correct me if I am wrong.

1. alpakka kinesis connector works well with KPL as well as KCL
2. KinesisSources and KinesisSinks both work as "Producer" and "Consumer" 
in the kafka sense.

2018年1月8日月曜日 11時03分22秒 UTC+9 Konrad Malawski:
>
> Hi Soichi,
> “Producer” and “Consumer” are words used in Kafka, as such Alpakka’s Kafka 
> integration uses them as well.
> (Note that Akka-Steam-Kafka is part of Alpakka, even if in an separate 
> repository)
>
> The prime idea in all Alpakka things is that there are Sources (i.e. the 
> Consumer (consumes from kafka)) and Sinks.
> These are types from Akka Streams, and mean sources and sinks of data.
>
> If you think about them in those terms, it’s easier to map what you need 
> to the apropriate API.
>
> For example in Kinesis, there’s KinesisSource and KinesisSink:
> https://developer.lightbend.com/docs/alpakka/current/kinesis.html
>
> Hope this helps!
> // And happy holidays (today) ;-)
>
> -- 
> Cheers,
> Konrad 'ktoso ' Malawski
> Akka  @ Lightbend 
>
> On January 7, 2018 at 13:57:29, Soichi Ishida (souji...@gmail.com 
> ) wrote:
>
> I am new to alpakka, trying to shift from kafka to aws kinesis. 
>
> When using akka stream kafka, there was an object, Producer, 
> https://doc.akka.io/docs/akka-stream-kafka/current/producer.html (or 
> similarly "Consumer")
> alpakka kinesis connector design philosophy is totally different from that 
> of "akka stream kafka"?, since there is no equivalent.
>
>
> --
> >> 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] expectNoMessage keeps unexpected message in the queue

2018-01-08 Thread Christophe Pache
Speaking about the functionnality, I wonder about people trying to test 
unmanaged backend shutdown for example, with previous version, checking a 
backend stop sending message was easily done with 
eventually(expectNoMsg)

which would not work anymore. But that's not my case and I think it's still 
possible (even if not nice).

Le lundi 8 janvier 2018 11:22:04 UTC+1, Christophe Pache a écrit :
>
> Hello Conrad, thanks for answering! 
>
> I was speaking about the internal queue of the TestActor.
>
> I upgraded from 2.5.3 to 2.5.8, in 2.5.3, the behavior was not the same: 
>
>
>
> 
> private def expectNoMsg_internal(max: FiniteDuration) {
>val o = receiveOne(max)
>assert(o eq null, s"received unexpected message $")
>lastWasNoMsg = true
>  }
>
>
>
> Le lundi 8 janvier 2018 11:14:17 UTC+1, Konrad Malawski a écrit :
>>
>> What do you mean?
>> What queue?
>>
>> They are both implemented using the exact same internal method:
>>
>> @deprecated(message = "Use expectNoMessage instead", since = "2.5.5")
>> def expectNoMsg(max: FiniteDuration) {
>>   expectNoMsg_internal(max.dilated)
>> }
>>
>> /**
>>  * Assert that no message is received for the specified time.
>>  * Supplied value is not dilated.
>>  */
>> def expectNoMessage(max: FiniteDuration) = {
>>   expectNoMsg_internal(max)
>> }
>>
>>
>>
>> Do you mean some other API? If yes, which one?
>>
>> -- 
>> Cheers,
>> Konrad 'ktoso ' Malawski
>> Akka  @ Lightbend 
>>
>> On January 8, 2018 at 19:11:30, Christophe Pache (chp...@gmail.com) 
>> wrote:
>>
>> Hello everyone,
>>
>> I would be interested to understand why `expectNoMessage`, in case there 
>> is unexpected message, keeps it on the queue (compared to expectNoMsg). 
>> It's all fine but from API point of view, my feelings would not expect such 
>> behavior (maybe because of other API). Maybe more doc on that would be an 
>> idea.
>>
>> Thanks and have a nice day.
>>
>> Christophe
>> --
>> >> 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] expectNoMessage keeps unexpected message in the queue

2018-01-08 Thread Christophe Pache
Hello Conrad, thanks for answering! 

I was speaking about the internal queue of the TestActor.

I upgraded from 2.5.3 to 2.5.8, in 2.5.3, the behavior was not the same: 



private def expectNoMsg_internal(max: FiniteDuration) {
   val o = receiveOne(max)
   assert(o eq null, s"received unexpected message $")
   lastWasNoMsg = true
 }



Le lundi 8 janvier 2018 11:14:17 UTC+1, Konrad Malawski a écrit :
>
> What do you mean?
> What queue?
>
> They are both implemented using the exact same internal method:
>
> @deprecated(message = "Use expectNoMessage instead", since = "2.5.5")
> def expectNoMsg(max: FiniteDuration) {
>   expectNoMsg_internal(max.dilated)
> }
>
> /**
>  * Assert that no message is received for the specified time.
>  * Supplied value is not dilated.
>  */
> def expectNoMessage(max: FiniteDuration) = {
>   expectNoMsg_internal(max)
> }
>
>
>
> Do you mean some other API? If yes, which one?
>
> -- 
> Cheers,
> Konrad 'ktoso ' Malawski
> Akka  @ Lightbend 
>
> On January 8, 2018 at 19:11:30, Christophe Pache (chp...@gmail.com 
> ) wrote:
>
> Hello everyone,
>
> I would be interested to understand why `expectNoMessage`, in case there 
> is unexpected message, keeps it on the queue (compared to expectNoMsg). 
> It's all fine but from API point of view, my feelings would not expect such 
> behavior (maybe because of other API). Maybe more doc on that would be an 
> idea.
>
> Thanks and have a nice day.
>
> Christophe
> --
> >> 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] expectNoMessage keeps unexpected message in the queue

2018-01-08 Thread Konrad “ktoso” Malawski
What do you mean?
What queue?

They are both implemented using the exact same internal method:

@deprecated(message = "Use expectNoMessage instead", since = "2.5.5")
def expectNoMsg(max: FiniteDuration) {
  expectNoMsg_internal(max.dilated)
}

/**
 * Assert that no message is received for the specified time.
 * Supplied value is not dilated.
 */
def expectNoMessage(max: FiniteDuration) = {
  expectNoMsg_internal(max)
}



Do you mean some other API? If yes, which one?

-- 
Cheers,
Konrad 'ktoso ' Malawski
Akka  @ Lightbend 

On January 8, 2018 at 19:11:30, Christophe Pache (chpa...@gmail.com) wrote:

Hello everyone,

I would be interested to understand why `expectNoMessage`, in case there is
unexpected message, keeps it on the queue (compared to expectNoMsg). It's
all fine but from API point of view, my feelings would not expect such
behavior (maybe because of other API). Maybe more doc on that would be an
idea.

Thanks and have a nice day.

Christophe
--
>> 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] expectNoMessage keeps unexpected message in the queue

2018-01-08 Thread Christophe Pache
Hello everyone,

I would be interested to understand why `expectNoMessage`, in case there is 
unexpected message, keeps it on the queue (compared to expectNoMsg). It's 
all fine but from API point of view, my feelings would not expect such 
behavior (maybe because of other API). Maybe more doc on that would be an 
idea.

Thanks and have a nice day.

Christophe

-- 
>>  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] Serial processing of messages by actor with Futures

2018-01-08 Thread Daniel Stoner
Akka Persistence may very well provide you some helpful ideas and insights. 
>From a pure perspective - it sounds as though you very much do want things 
to be blocking and serial. Are you aware that you can specify the execution 
context that actors run in and can in fact limit these so that many threads 
do not get used?
https://doc.akka.io/docs/akka/current/dispatchers.html
And:
https://doc.akka.io/docs/akka/current/futures.html

The above urls may give you some quick ways to achieve what you want.

I won't suggest it sounds like a great idea to have such a blocking 
situation and it could be that rethinking the way you do something else 
could remove the need for you to have such a piece in your application, but 
I certainly won't preclude the possibility that this pattern is required.

Thanks,
Dan

On Friday, 5 January 2018 09:46:21 UTC, Martin Major wrote:
>
> Thank you, I don't have much experience with Akka Persistence, but I'll 
> definitely give it a shot. I always used Akka streams for true streaming 
> things like HTTP stream of Kafka client but it is interesting idea to use 
> it for things like this. I will sure try that.
>
> Thank you very much!
> Martin
>
>
> Dne čtvrtek 4. ledna 2018 15:31:12 UTC+1 Brian Maso napsal(a):
>>
>> I would consider Akka Persistence or using Akka Streams with the 
>> Flow.mapAsync function. Either one provides a way to handle your situation 
>> without unlimited threads. Using raw Actors only it will be just a lot of 
>> work and cleverness and wheel re-invention.
>>
>> Brian Maso
>>
>> On Thu, Jan 4, 2018 at 2:30 AM, Martin Major  wrote:
>>
>>> Hello,
>>>
>>> I have application in Akka Typed where I have instance of StateActor for 
>>> each id (around 1000 instances). Each StateActor accepts 2 messages: 
>>> GetState() and SetState(state).
>>>
>>> SetState saves its state to db and if that was successful, saves a copy 
>>> to local actor cache.
>>> GetState responds with state from local cache if it is already loaded or 
>>> loads the state from database, stores it locally and responds to caller.
>>>
>>> My DB api offers asynchronous access:
>>>
>>> val stateFuture: Future[State] = db.load(id)
>>> val storeFuture: Future[Boolean] = db.save(id, state) // boolean whether 
>>> store was successful
>>>
>>> My problem is that I need to ensure that messages within one actor will 
>>> be processed in serial. Thus GetState() can answer only after Future in 
>>> previous SetState() is completed.
>>>
>>> Easy solution is to use Await.result() to each Future and change 
>>> asynchronous code to blocking. This has big disadvantage that it would use 
>>> many threads (up to number of actors).
>>>
>>> Another solution is to stash messages that comes while I'm doing 
>>> asynchronous calls. When asynchronous call ends I'll first process messages 
>>> from my stash. Disadvantage of this solution is that I'd lose mailbox on 
>>> actor restart.
>>>
>>> Last solution I came up with is to create chained list of Futures that 
>>> will do all the work. So every incoming message is simply append to chain 
>>> and when everything is ready it is processed. Disadvantage of this solution 
>>> is that I'm escaping from actor world to Futures world. And in case of 
>>> restart or termination of actor chain of Futures can still run.
>>>
>>> It would be great if I have opportunity to signal from actor whether I 
>>> want to process next message or not but IMHO it is not possible.
>>>
>>> What is the recommended way how to achieve serial processing of messages 
>>> when the code contains Futures?
>>>
>>> Thank you very much,
>>> Martin
>>>
>>> -- 
>>> >> 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.
>>>
>>
>>
-- 


Notice:  This email is confidential and may contain copyright material of 
members of the Ocado Group. Opinions and views expressed in this message 
may not necessarily reflect the opinions and views of the members of the 
Ocado Group. 

 

If you are not the intended recipient, please notify us immediately and 
delete all copies of this message. Please note that it is your 
responsibility to scan this message for viruses. 

 

Fetch and Sizzle are trading names of Speciality Stores Limited and Fabled 
is a trading name of Marie Claire Beauty Limited, both members of the Ocado 
Group.

 

References to the “Ocado Group” are to Ocado Group plc (registered in 

Re: [akka-user] Scalability of Akka Distributed Data

2018-01-08 Thread steffen . gebert
Thanks for your response, Patrik, and sorry for the late reply (was on 
holidays).

> I’m slightly uncertain but I think LwwMap doesn’t support delta-CRDT at 
all (ORMap.put) so it’s important to split up in many top level instead.
Akka docs says [1]:
> ORMap, ORMultiMap, PNCounterMap and LWWMap have support for delta-CRDT 
and they require causal delivery of deltas.
and in the log output we saw some information about delta replication. But 
it really didn't feel like it's going smooth.

There are IMHO contradictory statements regarding the limitations of the 
ORMap: Ryan Knight's presentation [2] states that one cannot add an entry 
that has been removed before. The documentation doesn't state such 
limitation. Could you comment on the current state in Akka 2.5? (okay.. 
could try implement it on my own, but maybe you have it in mind).

> I suggest that you create a simplified prototype for your use case. Then 
we could also try it, profile it and see if something could be improved. 
Doesn’t sound impossible to handle this amount.
Yes, I plan to do that the next days. I just have to think a bit about 
which part of the huge parameter space makes sense. We e.g. noticed that it 
helps a lot to have some pause between putting new entires into the map at 
a high rate.

Best
Steffen

[1] https://doc.akka.io/docs/akka/2.5.5/scala/distributed-data.html
[2] https://www.jfokus.se/jfokus17/preso/Akka-Distributed-Data-Deep-Dive.pdf

On Thursday, December 21, 2017 at 8:17:24 PM UTC+1, Patrik Nordwall wrote:
>
> Hi Steffen,
>
> As documented Distribute Data has limitations with regards to data size. 
> Crucial is to split it up to many top level entries. I’d suggest you try 
> with 1000-1 top level entries.
>
> Even with delta-CRDTs it must sometimes transfer the full state, meaning 
> that the message size for that mustn’t be too big (<200 kB). E.g. when that 
> is done is when adding a new node to the cluster.
>
> I’m slightly uncertain but I think LwwMap doesn’t support delta-CRDT at 
> all (ORMap.put) so it’s important to split up in many top level instead.
>
> I suggest that you create a simplified prototype for your use case. Then 
> we could also try it, profile it and see if something could be improved. 
> Doesn’t sound impossible to handle this amount.
>
> Yes, you should use Artery.
>
> /Patrik
>
>
>
> tors 21 dec. 2017 kl. 09:40 skrev :
>
>> Hi,
>>
>> we are investigating Akka Distributed Data for storing some (Long -> 
>> Long) mapping in a LWWMap.
>>
>> We plan for up to ~1mio entries for this and expect a write load of few 
>> hundreds/thousands entries per day, in contrast we expect a read load of 
>> some hundred requests per second. Therefore, we plan to use readLocal 
>> together with writeMajority.
>> Roughly calculating the size of the map, we should end up with some 
>> 20-30MB, which feels okay'ish when delta-CRDTs work.
>>
>> While testing with only some thousand entries, we see huge propagation 
>> delays from one node to another in the order of tens of seconds (both 
>> running on the same PC). This raises our concern, if Akka Distributed Data 
>> is really a valid option for our use case (I will explain it a bit in 
>> detail below). What concerns us is what happens when we need to do a full 
>> cluster restart, when this map will fill up at a rate of like 100 entries 
>> per second. We currently do not feel too confident that this can work.
>>
>> I already asked in the Akka-User chat and got the feedback that artery 
>> could help a bit to overcome the head-of-line blocking (we see the Phi 
>> value detector logging about higher delays). We tried that and got even 
>> slower updates IIRC. And the usual suspect to manually shard it into 
>> multiple top-level maps, which we could go for, but we would still have 100 
>> maps at 10k entries each.
>>
>> Our use case is as follows and I will describe it using an example of a 
>> CarActor, which is addressed by its ID with Cluster Sharding (so that we 
>> have one actor per imaginary car in the whole cluster). However, we need to 
>> send messages to that actor also via 3 other identifiers, let's say the IDs 
>> of the engine, gear, and the exhaust pipe (that these parts are 
>> occasionally replaced and even transferred to a different car pretty well 
>> reflects our scenario; reads would be like every time we pass a toll 
>> bridge.. damn.. I think we could earn way more money if we would really 
>> build that very system :-)). So these three mappings (engine ID -> car ID, 
>> gear ID -> car ID, exhaust ID -> car ID) are what additionally needs to 
>> disseminated among the nodes participating in cluster sharding. The 
>> characteristics of CRDTs sound very appealing here -  an engine wouldn't be 
>> in another car in the very next second, leaving enough time for convergence 
>> via gossip. Having the whole data structure in memory feels like nothing to 
>> how we run our system currently (all nodes store all data, 

Re: [akka-user] Akka 2.5.8 (Java Edition) Error initializing: java.lang.IllegalStateException: not yet initialized

2018-01-08 Thread Eduardo Fernandes
Thank you very much Patrik.

I'll check.

Best regards.


On Mon, Jan 8, 2018 at 8:53 AM, Patrik Nordwall 
wrote:

> Konrad is right. That is not the correct line numbers for GraphStage.scala
> in akka-stream 2.5.8 and not 2.5.6 either, so check what akka-stream
> dependency you actually have on the classpath.
>
> On Mon, Jan 8, 2018 at 7:50 AM, Konrad “ktoso” Malawski <
> konrad.malaw...@lightbend.com> wrote:
>
>> Are you not accidentally mixing Akka versions?
>> What does your dependency file look like with regards to Akka
>> dependencies.
>>
>> Akka Streams and Actor etc should all be on the same version.
>>
>> --
>> Cheers,
>> Konrad 'ktoso ' Malawski
>> Akka  @ Lightbend 
>>
>> On January 7, 2018 at 20:28:58, Eduardo Fernandes (edu...@gmail.com)
>> wrote:
>>
>> Hi all.
>>
>> First of all: have all a happy new year.
>>
>> I just jumped out from Akka 2.5.6 to 2.5.8. From that I'm getting the
>> following error when starting Akka:
>>
>> java.lang.IllegalStateException: not yet initialized: only setHandler is
>> allowed in GraphStageLogic constructor
>> at akka.stream.stage.GraphStageLogic.interpreter(GraphStage.scala:295)
>> at akka.stream.stage.GraphStageLogic$$anon$1.invoke(GraphStage.scala:960)
>> at akka.remote.artery.InboundControlJunction$$anon$2.attach(
>> Control.scala:129)
>> at akka.remote.artery.ArteryTransport.runInboundControlStream(A
>> rteryTransport.scala:704)
>> at akka.remote.artery.ArteryTransport.runInboundStreams(ArteryT
>> ransport.scala:686)
>> at akka.remote.artery.ArteryTransport.start(ArteryTransport.scala:455)
>> at akka.remote.RemoteActorRefProvider.init(RemoteActorRefProvid
>> er.scala:212)
>> at akka.cluster.ClusterActorRefProvider.init(ClusterActorRefPro
>> vider.scala:31)
>> at akka.actor.ActorSystemImpl.liftedTree2$1(ActorSystem.scala:797)
>> at akka.actor.ActorSystemImpl._start$lzycompute(ActorSystem.scala:794)
>> at akka.actor.ActorSystemImpl._start(ActorSystem.scala:794)
>> at akka.actor.ActorSystemImpl.start(ActorSystem.scala:810)
>> at akka.actor.ActorSystem$.apply(ActorSystem.scala:244)
>> at akka.actor.ActorSystem$.apply(ActorSystem.scala:287)
>> at akka.actor.ActorSystem$.apply(ActorSystem.scala:262)
>> at akka.actor.ActorSystem$.create(ActorSystem.scala:190)
>> at akka.actor.ActorSystem.create(ActorSystem.scala)
>>
>>
>> If I switch back to 2.5.6 or 2.5.5 and the error disappears.  I've tried
>> with 2.5.7 and the error is still there. Looks like some new behavior in
>> 2.5.7.
>>
>> I'm using Artery:
>>
>>   remote {
>> log-remote-lifecycle-events = off
>> artery {
>>   enabled = on
>>   canonical.hostname = 127.0.0.1
>>   canonical.port = 0
>> }
>>   }
>>
>> Many thanks in advance for your help!
>>
>>
>>
>>
>>
>>
>>
>> --
>> >> 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 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/c
>> urrent/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.
>>
>
>
>
> --
>
> Patrik Nordwall
> Akka Tech Lead
> Lightbend  -  Reactive apps on the JVM
> Twitter: @patriknw
>
> --
> >> 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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/akka-user/xy-Hn2BhE1E/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