Re: [akka-user] How do we handel OversizedPayloadException in Akka

2016-08-16 Thread prakash chinnaswamy
Viktor. Tuning is not a possible solution in our case . we need to inform
the clint that the size is large and try with pagination. So we need to
handel this exception.


On Tuesday 16 August 2016, Viktor Klang  wrote:

> Prakash,
>
> I think a possible solution is two-fold: start using a more efficient
> means of serialization (which reduces payload sizes), and don't rely on
> exception throwing to track lost messages (Akka is at-most-once delivery).
>
> On Tue, Aug 16, 2016 at 1:40 PM, prakash chinnaswamy <
> prakash.chinnaswamy...@gmail.com> wrote:
>
>> Viktor
>>
>> Could on get in what contest you are asking. Just add more information we
>> use Scala and it is a rest application where this application will talk to
>> a play server (having a remote actor). When trying to send a large record
>> we get this error. We would like to handle this error and send a warning
>> message to the client.
>>
>> On Tue, Aug 16, 2016 at 5:00 PM, Viktor Klang 
>> wrote:
>>
>>> Hi Prakash,
>>>
>>> Do you use Java Serialization?
>>>
>>> On Tue, Aug 16, 2016 at 12:21 PM, prakash chinnaswamy <
>>> prakash.chinnaswamy...@gmail.com> wrote:
>>>
 We have a distributed application on akka cluster. Actor “A” sends
 message of large size to a remote actor. And we get the following Warning.


 2016-08-10 23:08:29,737 [EndpointWriter] ERROR - Transient association
 error (association remains live) akka.remote.OversizedPayloadException:
 Discarding oversized payload sent to Actor[akka.tcp://abcd@127.0.0.
 1:51665/temp/$b]: max allowed size 128000 bytes, actual size of
 encoded class common.data.model.configuration.UserList was 571444
 bytes.


 We are aware that we can increase the value in the configuration(
 http://doc.akka.io/docs/akka/2.2.3/scala/remot
 ing.html#Remote_Configuration).


 But we wanted to handel this OversizedPayloadException and send the
 message to the client.


 Regards,

 Prakash

 --
 >> 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/grou
 p/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.

>>>
>>>
>>>
>>> --
>>> Cheers,
>>> √
>>>
>>> --
>>> >> 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/grou
>>> p/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/oj4YsZpGYGs/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/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.
>>
>
>
>
> --
> Cheers,
> √
>
> --
> >> 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/oj4YsZpGYGs/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, 

[akka-user] How materialized value is defined?

2016-08-16 Thread Guofeng Zhang
Hi,

The methods like toMat() can expose a value when materialize a stream.

How could a materialized value defined in a processor or flow? A example or
link to the akka-stream source will be very helpful.

Thanks,

Guofeng

-- 
>>  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-streams] Accessing the dispatcher used for a mapAsync stage

2016-08-16 Thread Itamar Ravid
Thanks Endre!

-- 
>>  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-streams] Accessing the dispatcher used for a mapAsync stage

2016-08-16 Thread Endre Varga
Hi,

There is no way to get the execution context inside such a simple operator,
unfortunately. Inside a GraphStage you can access the materializer from the
logic:
http://doc.akka.io/api/akka/2.4/index.html#akka.stream.stage.GraphStageLogic@materializer:akka.stream.Materializer

Unfortunately mapAsync is tricky to implement so I would probably go with
option 1

-Endre

On Thu, Aug 11, 2016 at 3:47 PM, Itamar Ravid  wrote:

> Hello everyone,
>
> Is there a canonical way of accessing the dispatcher/ExecutionContext used
> for a mapAsync stage? I would like to use the monadic combinators on a
> future within my mapAsync stage, and these require an implicit
> ExecutionContext.
>
> Contrived example:
> ```
> def myFlow = Flow[Int].mapAsync(1) { n =>
>   Future(n).map(_.toString) // requires an implicit EC
> }
> ```
>
> I'm worried about this because
>
> I've come up with two solutions:
> 1. Simply pass an implicit ExecutionContext to the factory function, which
> is OK but can be somewhat hard to keep track of
> 2. Do the following:
>
> ```
> def myFlow = Flow[Int].flatMapConcat { n =>
>   Source.single(n)
> .mapAsync(1)(Future(_))
> .map(_.toString)
> }
> ```
> ... which is OK too, but seems boilerplate-y.
>
> Any thoughts? Some of my stages are doing blocking I/O (using Kafka), so
> I'd like to make sure they stay on their respective dispatchers.
>
> --
> >> 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] [akka-persistence] Design question, account with transactions

2016-08-16 Thread Evgeny Shepelyuk
I am trying to design a system where an AKKA actor represents smth similar 
to simple banking account or counter
Each account has a list of transactions that are events generated by 
incoming commands change its state (basically add/remove funds).
One of my requirement is that system should track if incoming transaction 
was already processed by certain account.

It that case account actor 
1. should not change state again
2. should warn some external system about duplicated transaction.

We expect fairly large number of transactions per account. e.g 1 per 
day.

My first intention was to use akka-persistence to implement event sourcing 
pattern

On incoming command 
 - check if command was already processed, (by querying journal or checking 
in memory list)
 - if command was not processed - creating transaction and store it to 
account journal
 - additional put transaction into in-memory list
 - if command with such ID was already processed, then do not generate new 
transaction, and notify someone

But after reading about journals and possible backends (kafka or cassandra, 
since we need it distributed) I consider that maybe akka-persistence is not 
applicable at all for my goals.
One of assumption is to use event-sourcing only for balance update and 
create snapshots from time to time and use direct DB access outside 
akka-persistence to check for duplicated transactions.

What do you suggest ?

-- 
>>  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] How do we handel OversizedPayloadException in Akka

2016-08-16 Thread Viktor Klang
Prakash,

I think a possible solution is two-fold: start using a more efficient means
of serialization (which reduces payload sizes), and don't rely on exception
throwing to track lost messages (Akka is at-most-once delivery).

On Tue, Aug 16, 2016 at 1:40 PM, prakash chinnaswamy <
prakash.chinnaswamy...@gmail.com> wrote:

> Viktor
>
> Could on get in what contest you are asking. Just add more information we
> use Scala and it is a rest application where this application will talk to
> a play server (having a remote actor). When trying to send a large record
> we get this error. We would like to handle this error and send a warning
> message to the client.
>
> On Tue, Aug 16, 2016 at 5:00 PM, Viktor Klang 
> wrote:
>
>> Hi Prakash,
>>
>> Do you use Java Serialization?
>>
>> On Tue, Aug 16, 2016 at 12:21 PM, prakash chinnaswamy <
>> prakash.chinnaswamy...@gmail.com> wrote:
>>
>>> We have a distributed application on akka cluster. Actor “A” sends
>>> message of large size to a remote actor. And we get the following Warning.
>>>
>>>
>>> 2016-08-10 23:08:29,737 [EndpointWriter] ERROR - Transient association
>>> error (association remains live) akka.remote.OversizedPayloadException:
>>> Discarding oversized payload sent to Actor[akka.tcp://abcd@127.0.0.
>>> 1:51665/temp/$b]: max allowed size 128000 bytes, actual size of encoded
>>> class common.data.model.configuration.UserList was 571444 bytes.
>>>
>>>
>>> We are aware that we can increase the value in the configuration(
>>> http://doc.akka.io/docs/akka/2.2.3/scala/remot
>>> ing.html#Remote_Configuration).
>>>
>>>
>>> But we wanted to handel this OversizedPayloadException and send the
>>> message to the client.
>>>
>>>
>>> Regards,
>>>
>>> Prakash
>>>
>>> --
>>> >> 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/grou
>>> p/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.
>>>
>>
>>
>>
>> --
>> Cheers,
>> √
>>
>> --
>> >> 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/oj4YsZpGYGs/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 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.
>



-- 
Cheers,
√

-- 
>>  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] How do we handel OversizedPayloadException in Akka

2016-08-16 Thread prakash chinnaswamy
Viktor

Could on get in what contest you are asking. Just add more information we
use Scala and it is a rest application where this application will talk to
a play server (having a remote actor). When trying to send a large record
we get this error. We would like to handle this error and send a warning
message to the client.

On Tue, Aug 16, 2016 at 5:00 PM, Viktor Klang 
wrote:

> Hi Prakash,
>
> Do you use Java Serialization?
>
> On Tue, Aug 16, 2016 at 12:21 PM, prakash chinnaswamy <
> prakash.chinnaswamy...@gmail.com> wrote:
>
>> We have a distributed application on akka cluster. Actor “A” sends
>> message of large size to a remote actor. And we get the following Warning.
>>
>>
>> 2016-08-10 23:08:29,737 [EndpointWriter] ERROR - Transient association
>> error (association remains live) akka.remote.OversizedPayloadException:
>> Discarding oversized payload sent to Actor[akka.tcp://abcd@127.0.0.
>> 1:51665/temp/$b]: max allowed size 128000 bytes, actual size of encoded
>> class common.data.model.configuration.UserList was 571444 bytes.
>>
>>
>> We are aware that we can increase the value in the configuration(
>> http://doc.akka.io/docs/akka/2.2.3/scala/remot
>> ing.html#Remote_Configuration).
>>
>>
>> But we wanted to handel this OversizedPayloadException and send the
>> message to the client.
>>
>>
>> Regards,
>>
>> Prakash
>>
>> --
>> >> 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.
>>
>
>
>
> --
> Cheers,
> √
>
> --
> >> 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/oj4YsZpGYGs/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 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] How do we handel OversizedPayloadException in Akka

2016-08-16 Thread Viktor Klang
Hi Prakash,

Do you use Java Serialization?

On Tue, Aug 16, 2016 at 12:21 PM, prakash chinnaswamy <
prakash.chinnaswamy...@gmail.com> wrote:

> We have a distributed application on akka cluster. Actor “A” sends message
> of large size to a remote actor. And we get the following Warning.
>
>
> 2016-08-10 23:08:29,737 [EndpointWriter] ERROR - Transient association
> error (association remains live) akka.remote.OversizedPayloadException:
> Discarding oversized payload sent to Actor[akka.tcp://abcd@127.0.0.
> 1:51665/temp/$b]: max allowed size 128000 bytes, actual size of encoded
> class common.data.model.configuration.UserList was 571444 bytes.
>
>
> We are aware that we can increase the value in the configuration(
> http://doc.akka.io/docs/akka/2.2.3/scala/remoting.html#Remote_
> Configuration).
>
>
> But we wanted to handel this OversizedPayloadException and send the
> message to the client.
>
>
> Regards,
>
> Prakash
>
> --
> >> 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.
>



-- 
Cheers,
√

-- 
>>  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 do we handel OversizedPayloadException in Akka

2016-08-16 Thread prakash chinnaswamy


We have a distributed application on akka cluster. Actor “A” sends message 
of large size to a remote actor. And we get the following Warning.


2016-08-10 23:08:29,737 [EndpointWriter] ERROR - Transient association 
error (association remains live) akka.remote.OversizedPayloadException: 
Discarding oversized payload sent to 
Actor[akka.tcp://abcd@127.0.0.1:51665/temp/$b]: max allowed size 128000 
bytes, actual size of encoded class 
common.data.model.configuration.UserList was 571444 bytes.


We are aware that we can increase the value in the configuration(
http://doc.akka.io/docs/akka/2.2.3/scala/remoting.html#Remote_Configuration
). 


But we wanted to handel this OversizedPayloadException and send the message 
to the client. 


Regards,

Prakash

-- 
>>  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] Hot Standby Persistent Actor - https://github.com/akka/akka/issues/13938

2016-08-16 Thread Patrik Nordwall
By the way, we can continue design discussion in the ticket
https://github.com/akka/akka/issues/13938

On Tue, Aug 16, 2016 at 9:51 AM, Patrik Nordwall 
wrote:

> Here is a link to the recovery logic: https://github.com/
> akka/akka/blob/master/akka-persistence/src/main/scala/
> akka/persistence/Eventsourced.scala#L467
>
> When looking at this now I think we should not use persistent query for
> this, since the ordinary replay has its own protocol (set of messages) to
> the journal. The hot standby should use the same protocol to ensure that it
> ends up in the same state.
>
> On Mon, Aug 15, 2016 at 2:44 PM, Muthukumaran Kothandaraman <
> muthu.kmk2...@gmail.com> wrote:
>
>> Thanks Patrik. I would like to follow this. I assume that the design
>> discussions are confined to the issues link.
>>
>> Are there any pointers in code for understanding how recovery is
>> currently triggered for persistent actors so that I can get warmed up ? I
>> guess that would be a good point for me to start with
>>
>> Regards
>> Muthu
>>
>>
>> On Thursday, 11 August 2016 23:27:59 UTC+5:30, Patrik Nordwall wrote:
>>>
>>> The milestone of an issue is no guarantee that it will be released in
>>> that version, until the issue is closed. We can't do that kind of planning.
>>>
>>> This would be a great feature for community contibution. Queries are
>>> there now.
>>>
>>> /Patrik
>>> ons 10 aug. 2016 kl. 07:04 skrev Muthukumaran Kothandaraman <
>>> muthu@gmail.com>:
>>>
 Hi,

 Is this still targeted for 2.5 or it has moved further ? As I
 understand, this required some query-side improvements before this could be
 addressed.

 Regards
 Muthu

 --
 >> 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/grou
 p/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/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
>
>


-- 

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 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] Hot Standby Persistent Actor - https://github.com/akka/akka/issues/13938

2016-08-16 Thread Patrik Nordwall
Here is a link to the recovery logic:
https://github.com/akka/akka/blob/master/akka-persistence/src/main/scala/akka/persistence/Eventsourced.scala#L467

When looking at this now I think we should not use persistent query for
this, since the ordinary replay has its own protocol (set of messages) to
the journal. The hot standby should use the same protocol to ensure that it
ends up in the same state.

On Mon, Aug 15, 2016 at 2:44 PM, Muthukumaran Kothandaraman <
muthu.kmk2...@gmail.com> wrote:

> Thanks Patrik. I would like to follow this. I assume that the design
> discussions are confined to the issues link.
>
> Are there any pointers in code for understanding how recovery is currently
> triggered for persistent actors so that I can get warmed up ? I guess that
> would be a good point for me to start with
>
> Regards
> Muthu
>
>
> On Thursday, 11 August 2016 23:27:59 UTC+5:30, Patrik Nordwall wrote:
>>
>> The milestone of an issue is no guarantee that it will be released in
>> that version, until the issue is closed. We can't do that kind of planning.
>>
>> This would be a great feature for community contibution. Queries are
>> there now.
>>
>> /Patrik
>> ons 10 aug. 2016 kl. 07:04 skrev Muthukumaran Kothandaraman <
>> muthu@gmail.com>:
>>
>>> Hi,
>>>
>>> Is this still targeted for 2.5 or it has moved further ? As I
>>> understand, this required some query-side improvements before this could be
>>> addressed.
>>>
>>> Regards
>>> Muthu
>>>
>>> --
>>> >> 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/grou
>>> p/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.
>



-- 

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 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] Unmarshalling failed for decode String from "text/html" HttpEntity From HttpResponse

2016-08-16 Thread Sarah Yin
Hi Akka User List,


I'm trying to get the text response from httpResponse as a string. Here's 
my http call.

> val responseFuture: Future[HttpResponse] = Http().singleRequest(
> HttpRequest(uri = uri))



However some how I did not have a lot luck in getting the body. Here are 
the methods I've tried.

responseFuture onComplete {
>   case Success(response) =>
> val timeout = 300.millis
> response.status match {
>   case StatusCodes.OK =>
> println("printing content")
> println(response.entity.dataBytes.runForeach(println))
>   case _ =>
> println("failed to get dynamic url")
> }
>   case Failure(error) =>
> println(error.toString)
> }

However this prints empty response

--


responseFuture onComplete {
>   case Success(response) =>
> val timeout = 300.millis
> response.status match {
>   case StatusCodes.OK =>
> println("printing content")
> println(response.entity.dataBytes.map(_.utf8String))
>   case _ =>
> println("failed to get dynamic url")
> }
>   case Failure(error) =>
> println(error.toString)
> }

However this returns the string of the object instead 
akka.stream.scaladsl.Source@2dae110b

--


responseFuture onComplete {
>   case Success(response) =>
> 
> val timeout = 300.millis
> response.status 
> response.status match {
>   
>   case StatusCodes.OK =>
> 
> println("printing content")
> response.entity.dataBytes.map(line => 
> response.entity.dataBytes.map(line => println(line))
>   
>   case _ =>
> 
> println("failed to get dynamic url")
> }
>   
> }
>   case Failure(error) =>
> 
> println(error.toString)
> }
> }

However this prints empty response

--


responseFuture onComplete {
> case Success(response) =>
>
> val timeout = 300.millis
> response.status 
> response.status match {
>
> case StatusCodes.OK =>
>
> println("printing content")
>
> println(response.entity.toStrict(5 seconds).map(_.data.decodeString(
> "UTF-8")))
>
> case _ =>
>
> println("failed to get dynamic url")
> }
>
> }
> case Failure(error) =>
>
> println(error.toString)
> }
> }

However this shows Error in stage [unknown-operation]: Promise already 
completed.


[default-akka.actor.default-dispatcher-47] 
[akka://default/user/StreamSupervisor-0/flow-40-0-unknown-operation] Error in 
stage [unknown-operation]: Promise already completed.
>
> java.lang.IllegalStateException: Promise already completed.
> java.lang.IllegalStateException: Promise already completed.
>
>   at scala.concurrent.Promise$class.complete(Promise.scala:55)
>   at scala.concurrent.Promise$class.complete(Promise.scala:55)
>
>   at 
> scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153)
>   at 
> scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153)
>
>   at scala.concurrent.Promise$class.failure(Promise.scala:104)
>   at scala.concurrent.Promise$class.failure(Promise.scala:104)
>
>   at 
> scala.concurrent.impl.Promise$DefaultPromise.failure(Promise.scala:153)
>   at 
> scala.concurrent.impl.Promise$DefaultPromise.failure(Promise.scala:153)
>
>   at 
> akka.http.impl.util.StreamUtils$$anon$2.onUpstreamFailure(StreamUtils.scala:76)
>   at 
> akka.http.impl.util.StreamUtils$$anon$2.onUpstreamFailure(StreamUtils.scala:76)
>
>   at 
> akka.http.impl.util.StreamUtils$$anon$2.onUpstreamFailure(StreamUtils.scala:69)
>   at 
> akka.http.impl.util.StreamUtils$$anon$2.onUpstreamFailure(StreamUtils.scala:69)
>
>   at 
> akka.stream.stage.AbstractStage$PushPullGraphLogic$$anon$1.onUpstreamFailure(Stage.scala:62)
>   at 
> akka.stream.stage.AbstractStage$PushPullGraphLogic$$anon$1.onUpstreamFailure(Stage.scala:62)
>
>   at 
> akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:621)
>   at 
> akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:621)
>
>   at 
> akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:535)
>   at 
> akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:535)
>
>   at 
> akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:443)
>   at 
> akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:443)
>
>   at 
> akka.stream.impl.fusing.GraphInterpreterShell.init(ActorGraphInterpreter.scala:364)
>   at 
> akka.stream.impl.fusing.GraphInterpreterShell.init(ActorGraphInterpreter.scala:364)
>
>   at 
> 

[akka-user] Re: Akks in Scala console

2016-08-16 Thread Sarah Yin
Awesome this works. Thanks a lot

On Friday, July 15, 2016 at 10:55:55 PM UTC-7, Sarah Yin wrote:
>
> Hi,
>
> I'm trying to run Akka in scala console
>
> Using
>
>   
> scala -cp akka-http-spray-json-experimental_2.11-2.4.8.jar 
>
>
> However when I'm trying to get the HTTP model
>
> import akka.http.scaladsl.Http
>
>
> I'm getting error msg saying
>
>
> :11: error: object Http is not a member of package 
> akka.http.scaladsl
>
>
>
>import akka.http.scaladsl.Http
>
>  
>
>   ^
>
>
> Is there any step that I'm missing? Thanks in ad!
>

-- 
>>  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] Unmarshaller not working for HttpEntity for text/html response for "Error in stage [unknown-operation]: Promise already completed"

2016-08-16 Thread Sarah Yin
Hi Akka User,

I've been trying to Unmarshall HttpResponse and decode it as a String. 
However All the method I've searched failed in "Error in stage 
[unknown-operation]: Promise already completed"

Has anyone come to this before? Thanks in ad!

Here are the Future I want to decode 

> val responseFuture: Future[HttpResponse] = 
> Http().singleRequest(HttpRequest(uri 
> = uri))

 

>
Here are some of the methods I've tried:

responseFuture onComplete {
> case Success(response) =>
> val timeout = 300.millis
> response.status match {
> case StatusCodes.OK =>
> println("printing content")
> // println(response.entity.dataBytes.runForeach(println))
> // println(response.entity.dataBytes.map(_.utf8String))
> // response.entity.dataBytes
> // .map(line => println(line))
> // println(response.entity.toStrict(5 
> seconds).map(_.data.decodeString("UTF-8")))
> // println(Unmarshal(response.entity).to[String])
> // val entity = Unmarshal(response.entity).to[String]
> // entity onComplete { entity =>
> // println(entity)
> // }
> // Unmarshaller.entityToString(response.entity)
> // 
> println(PredefinedFromEntityUnmarshallers.stringUnmarshaller(response.entity))
> // println(response.entity.toStrict(5 
> seconds).map(_.data.decodeString("UTF-8")) )
> val bs: Future[ByteString] = response.entity.toStrict(timeout).map { 
> _.data }
> // val s: Future[String] = bs.map(_.utf8String)
> println(bs)
> case _ =>
> println("failed to get dynamic url")
> }
> case Failure(error) =>
> println(error.toString)
> }



 

-- 
>>  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.