Re: [akka-user] Re: ANNOUNCE: Akka HTTP 3.0.0-RC1

2016-10-19 Thread Konrad Malawski
Thanks for reporting.
We spotted this and have fixed the issue already:
https://github.com/akka/akka-http/pull/409
The fixed artifacts are right now on their way to maven-central.

Happy hakking.

-- 
Konrad 'ktoso’ Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>
<http://java.pl/>java.pl / geecon.org / krakowscala.pl / lambdakrk.pl /
sckrk.com

On 19 October 2016 at 11:04:21, Rafał Krzewski (rafal.krzew...@gmail.com)
wrote:

Hi,

I took a quick look at the new Akka HTTP artifacts published on Maven
Central, and I've noticed that artifact names don't have Scala version
suffix in them. Is this intentional?

Cheers,
Rafał

W dniu wtorek, 18 października 2016 00:22:17 UTC+2 użytkownik Konrad
'ktoso' Malawski napisał:
>
> Dear hakkers,
>
> We are proud to announce the first Release Candidate of the Akka HTTP's
> "fully stable" release–the only missing, bit was the Routing DSLs, which we
> now deem stable enough to support for an extended period of time.
>
>
> This release marks the first of the 3.0.0 series of this project and
> signifies a large step in terms of confidence in the library, as well as
> the move of Akka HTTP into its own repository. From now on Akka HTTP will
> be versioned separately from Akka “core”. This has been discussed at large
> with the community on akka-meta <http://github.com/akka/akka-meta>, and
> the akka-http <https://github.com/akka/akka-http/> repositories on
> github. Thank you very much for your input!
>
> For more background why this move, please read “Akka HTTP - stable,
> growing and tons of opportunity
> <https://github.com/akka/akka-meta/issues/27>” on akka-meta. While
> preparing In the meantime we have delivered a Proof-of-Concept of HTTP/2
> for Akka HTTP and plan to continue this work later this year–community help
> is very much welcome on this front as well.
>
> The documentation from now on will be available here:
>
> Some noteworthy changes in the *3.0.0-RC1* (since it's move out from
> 2.4.11) release are:
>
>
>-
>
>New lightbend/paradox powered documentation
>-
>   -
>
>   This will allow us to aggregate it together with Akka and other
>   documentation, as well as link more easily to ScalaDoc pages
>   -
>
>   Akka HTTP documentation will from now on live here:
>   http://doc.akka.io/docs/akka-http/current/index.html
>   <http://doc.akka.io/docs/akka-http/current/index.html>
>   -
>
>   We’ll work on a better theme for it very soon.
>   -
>
>Multipart is now correctly Binary MediaType (instead of
>WithOpenCharset) #398 <https://github.com/akka/akka-http/pull/398>
>-
>
>A new designated mailing-list and page for any critical security
>issues that might come up has been created:
>http://doc.akka.io/docs/akka-http/current/security.html
><http://doc.akka.io/docs/akka-http/current/security.html>
>-
>   -
>
>   Please follow the linked mailing list if you have production Akka
>   systems, so you’ll be the first to know in case a security issue is 
> found
>   and fixed in Akka.
>
>
> The plan regarding releasing a stable 3.0.0 is to wait a little bit for
> community feedback on the release candidates, and call a stable one no
> longer than a few weeks from now. We’re eagerly awaiting your feedback and
> can’t wait to ship the stable version of all of Akka HTTP’s modules!
>
> Credits
>
> A total 15 issues were closed since 2.4.11, most of the work was moving
> source code, documentation and issues to their new places.
>
> The complete list of closed issues can be found on the 3.0.0-RC1
> <https://github.com/akka/akka-http/milestone/1?closed=1> milestone on
> github.
>
> For this release we had the help of 14 committers – thank you!
>
> A special thanks to Jonas Fonseca <https://github.com/jonas> who did a
> tremendously awesome job at migrating all the docs from sphinx
> (restructuredtext) to paradox (markdown), contributing features that the
> Akka docs needed to upstream Paradox–thanks a lot!
>
> Credits:
>
> commits added removed
>
>   10   22489   24696 Jonas Fonseca
>
>   101927 256 Johannes Rudolph
>
>   10 849 412 Konrad Malawski
>
>4 448 136 Robert Budźko
>
>2  37  37 Bernard Leach
>
>2 107   7 Richard Imaoka
>
>2  26  24 Jakub Kozłowski
>
>1 145 101 Jan @gosubpl
>
>1 108 114 Derek Wyatt
>
>1  45  33 Wojciech Langiewicz
>
>1  49   0 @2beaucoup
>
>1   6   6 Markus Hauck
>
>1   1   1 Ian Forsey
&g

Re: [akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-19 Thread Konrad Malawski
Shapes don't need separate java or scala api, it's shared.

You can just subclass a shape and make a class that directly represents
your shape.
If you want AmorphousShape then sure, but please note that it's purpose is
to "forget about the types of those".

If you want a well typed one simply extend Shape and fill in the abstract
methods - see FlowShape etc for examples how to do this.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 19 October 2016 at 08:03:16, Sergey Sopin (sopin1...@gmail.com) wrote:

Hi,

Yes, but it seems that I need to create Java API for it, because my app is
in Java.
I used Inkscape app. to draw the diagram.

Cheers,
Sergey

среда, 19 октября 2016 г., 0:46:00 UTC+3 пользователь Rafał Krzewski
написал:
>
> A custom GraphStage [1] using AmorphousShape is probably the way to go in
> this case.
>
> That's a really neat diagram, BTW! What software did you us to create it?
>
> Cheers,
> Rafał
>
> [1] http://doc.akka.io/docs/akka/2.4/scala/stream/stream-
> customize.html#Custom_processing_with_GraphStage
>
> W dniu wtorek, 18 października 2016 22:12:07 UTC+2 użytkownik Sergey Sopin
> napisał:
>>
>> Hi again,
>>
>> I have a very specific case. My flow looks like this one:
>>
>>
>> 
>>
>> The idea of multi input/output shape was to redirect messages to a right
>> output based on the message data.
>>
>> I just learn streams, so maybe you can suggest a better solution?
>>
>> Thanks!
>>
>>
>> Cheers,
>>
>> Sergey
>>
>>
>>
>> вторник, 18 октября 2016 г., 18:34:22 UTC+3 пользователь Rafał Krzewski
>> написал:
>>>
>>> It's not clear to me, what are you trying to accomplish. It looks like
>>> you are trying to implement AmorphousShape (ie. arbitrary number of open
>>> inlets and outlets) on your own, and then a specific variant of it, that
>>> has all inlets sharing the same type, and all outlets sharing another type.
>>> The "Fan" fragment in the names you used is a bit misleading, since in Akka
>>> Stream's own usage of it names like FanIn / FanOut shape mean that such
>>> grap has many inlets and single outlet / single inlet many outlets. The
>>> analogy is to a Chinese-style hand held fan, rather than ceiling fan with
>>> many blades :) I am wondering what use case you have in mind for your
>>> AmorphousShape because the graphs that can be materialized and executed
>>> must ultimately have a ClosedShape. You could use such multi-outlet graphs
>>> for reusing pieces of functionality, but anything more complex than a
>>> BidiShape  seems  rather unwieldy to me.
>>>
>>> My understanding is that Graph's shape should not interfere with message
>>> flow, because it's just a canvas with contact points on the perimeter. What
>>> matters are the components that you plug into it. Akka just makes sure that
>>> you don't leave any of the contact points dangling. This makes me think
>>> that the problems with messages getting "stuck" was caused somewhere other
>>> than graph shape construction site.
>>>
>>> Have you tried inserting probes alon the lines of Flow.alsoTo(Sink.foreach(_
>>> => println("beep!"))) (shooting from the hip here, apologies if it does
>>> not compile straight away) into your graph? That could help you locate
>>> where the messages are stuck / discarded.
>>>
>>> Cheers,
>>> Rafał
>>>
>>> W dniu poniedziałek, 17 października 2016 20:22:43 UTC+2 użytkownik
>>> Sergey Sopin napisał:

 Hi,

 I am trying to create my own akka streams shape with several Inlets and
 Outlets. I have written following code:

 package kernel.modeller.workers.streamFinder.generic

 import akka.stream.{Shape, Outlet, Inlet}
 import scala.annotation.unchecked.uncheckedVariance
 import scala.collection.immutable

 object FanShape {
   sealed trait Init[_] {
 def inlets: immutable.Seq[Inlet[_]]
 def outlets: immutable.Seq[Outlet[_]]
 def name: String
   }
   final case class Name[_](override val name: String) extends Init[Any] {
 override def inlets: immutable.Seq[Inlet[_]] = Nil
 override def outlets: immutable.Seq[Outlet[_]] = Nil
   }
   final case class Ports[_](override val inlets: immutable.Seq[Inlet[_]], 
 override val outlets: immutable.Seq[Outlet[_]]) extends Init[Any] {
 override def name: String = "FanShape"
   }
 }

 abstract class FanShape[_] private (_in: Iterator[Inlet[_]], _out: 
 Iterator[Outlet[_]], _name: String) extends Shape {

   import FanShape._

   def this(init: FanShape.Init[_]) = this(init.inlets.iterator, 
 init.outlets.iterator, init.name)

   final override def outlets: immutable.Seq[Outlet[_]] = _outlets
   final override def inlets: immutable.Seq[Inlet[_]] = _inlets

   private var _outlets: Vector[Outlet[_]] = Vector.empty
   private 

Re: [akka-user] Re: ANNOUNCE: Akka HTTP 3.0.0-RC1

2016-10-18 Thread Konrad Malawski
And fixed:
https://github.com/akka/akka-http/commit/66adf848b57abdf6803b5713e1787fd23c00ccdb


-- 
Konrad 'ktoso’ Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>
<http://java.pl/>java.pl / geecon.org / krakowscala.pl / lambdakrk.pl /
sckrk.com

On 18 October 2016 at 19:44:07, Eric Swenson (e...@swenson.org) wrote:

I thought as much, but the documentation you just posted here:
http://doc.akka.io/docs/akka-http/current/scala/http/introduction.html still
says:

Akka HTTP is provided in a separate jar file, to use it make sure to
include the following dependency:

"com.typesafe.akka" %% "akka-http-experimental" % "3.0.0-RC1"

— Eric

On Oct 18, 2016, at 10:42, Konrad Malawski <konrad.malaw...@lightbend.com>
wrote:

Yes, that's what all the fuss is about ;-)
In fact, in RC it's already removed:
http://search.maven.org/#artifactdetails%7Ccom.typesafe.akka%7Cakka-http%7C3.0.0-RC1%7Cjar

For people not tracking this in detail: please note that all other modules
other than "the DSL" have been stable for a long time already.

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io/> @ Lightbend <http://lightbend.com/>

On 18 October 2016 at 19:41:18, Eric Swenson (e...@swenson.org) wrote:

Congratulations!  Is the plan to remove the "experimental" from
akka-http-experimental when this moves from RC to final?  -- Eric

On Monday, October 17, 2016 at 3:22:17 PM UTC-7, Konrad 'ktoso' Malawski
wrote:
>
> Dear hakkers,
> We are proud to announce the first Release Candidate of the Akka HTTP's
> "fully stable" release–the only missing, bit was the Routing DSLs, which we
> now deem stable enough to support for an extended period of time.
>
> This release marks the first of the 3.0.0 series of this project and
> signifies a large step in terms of confidence in the library, as well as
> the move of Akka HTTP into its own repository. From now on Akka HTTP will
> be versioned separately from Akka “core”. This has been discussed at large
> with the community on akka-meta <http://github.com/akka/akka-meta>, and
> the akka-http <https://github.com/akka/akka-http/> repositories on
> github. Thank you very much for your input!
>
> For more background why this move, please read “Akka HTTP - stable,
> growing and tons of opportunity
> <https://github.com/akka/akka-meta/issues/27>” on akka-meta. While
> preparing In the meantime we have delivered a Proof-of-Concept of HTTP/2
> for Akka HTTP and plan to continue this work later this year–community help
> is very much welcome on this front as well.
>
> The documentation from now on will be available here:
>
> Some noteworthy changes in the *3.0.0-RC1* (since it's move out from
> 2.4.11) release are:
>
>
>- New lightbend/paradox powered documentation
>-
>   - This will allow us to aggregate it together with Akka and other
>   documentation, as well as link more easily to ScalaDoc pages
>   - Akka HTTP documentation will from now on live here:
>   http://doc.akka.io/docs/akka-http/current/index.html
>   <http://doc.akka.io/docs/akka-http/current/index.html>
>   - We’ll work on a better theme for it very soon.
>   - Multipart is now correctly Binary MediaType (instead of
>WithOpenCharset) #398 <https://github.com/akka/akka-http/pull/398>
>- A new designated mailing-list and page for any critical security
>issues that might come up has been created:
>http://doc.akka.io/docs/akka-http/current/security.html
><http://doc.akka.io/docs/akka-http/current/security.html>
>-
>   - Please follow the linked mailing list if you have production Akka
>   systems, so you’ll be the first to know in case a security issue is 
> found
>   and fixed in Akka.
>
>
> The plan regarding releasing a stable 3.0.0 is to wait a little bit for
> community feedback on the release candidates, and call a stable one no
> longer than a few weeks from now. We’re eagerly awaiting your feedback and
> can’t wait to ship the stable version of all of Akka HTTP’s modules!
>
> Credits
>
> A total 15 issues were closed since 2.4.11, most of the work was moving
> source code, documentation and issues to their new places.
>
> The complete list of closed issues can be found on the 3.0.0-RC1
> <https://github.com/akka/akka-http/milestone/1?closed=1> milestone on
> github.
>
> For this release we had the help of 14 committers – thank you!
>
> A special thanks to Jonas Fonseca <https://github.com/jonas> who did a
> tremendously awesome job at migrating all the docs from sphinx
> (restructuredtext) to paradox (markdown), contributing features that the
> Akka docs needed to upstream Paradox–thanks a lot!
>
>

Re: [akka-user] Re: ANNOUNCE: Akka HTTP 3.0.0-RC1

2016-10-18 Thread Konrad Malawski
Thanks for noticing, that's bug - fixing it right away.

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 18 October 2016 at 19:44:03, Eric Swenson (e...@swenson.org) wrote:

I thought as much, but the documentation you just posted here:
http://doc.akka.io/docs/akka-http/current/scala/http/introduction.html still
says:

Akka HTTP is provided in a separate jar file, to use it make sure to
include the following dependency:

"com.typesafe.akka" %% "akka-http-experimental" % "3.0.0-RC1"

— Eric

On Oct 18, 2016, at 10:42, Konrad Malawski <konrad.malaw...@lightbend.com>
wrote:

Yes, that's what all the fuss is about ;-)
In fact, in RC it's already removed:
http://search.maven.org/#artifactdetails%7Ccom.typesafe.akka%7Cakka-http%7C3.0.0-RC1%7Cjar

For people not tracking this in detail: please note that all other modules
other than "the DSL" have been stable for a long time already.

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io/> @ Lightbend <http://lightbend.com/>

On 18 October 2016 at 19:41:18, Eric Swenson (e...@swenson.org) wrote:

Congratulations!  Is the plan to remove the "experimental" from
akka-http-experimental when this moves from RC to final?  -- Eric

On Monday, October 17, 2016 at 3:22:17 PM UTC-7, Konrad 'ktoso' Malawski
wrote:
>
> Dear hakkers,
> We are proud to announce the first Release Candidate of the Akka HTTP's
> "fully stable" release–the only missing, bit was the Routing DSLs, which we
> now deem stable enough to support for an extended period of time.
>
> This release marks the first of the 3.0.0 series of this project and
> signifies a large step in terms of confidence in the library, as well as
> the move of Akka HTTP into its own repository. From now on Akka HTTP will
> be versioned separately from Akka “core”. This has been discussed at large
> with the community on akka-meta <http://github.com/akka/akka-meta>, and
> the akka-http <https://github.com/akka/akka-http/> repositories on
> github. Thank you very much for your input!
>
> For more background why this move, please read “Akka HTTP - stable,
> growing and tons of opportunity
> <https://github.com/akka/akka-meta/issues/27>” on akka-meta. While
> preparing In the meantime we have delivered a Proof-of-Concept of HTTP/2
> for Akka HTTP and plan to continue this work later this year–community help
> is very much welcome on this front as well.
>
> The documentation from now on will be available here:
>
> Some noteworthy changes in the *3.0.0-RC1* (since it's move out from
> 2.4.11) release are:
>
>
>- New lightbend/paradox powered documentation
>-
>   - This will allow us to aggregate it together with Akka and other
>   documentation, as well as link more easily to ScalaDoc pages
>   - Akka HTTP documentation will from now on live here:
>   http://doc.akka.io/docs/akka-http/current/index.html
>   <http://doc.akka.io/docs/akka-http/current/index.html>
>   - We’ll work on a better theme for it very soon.
>   - Multipart is now correctly Binary MediaType (instead of
>WithOpenCharset) #398 <https://github.com/akka/akka-http/pull/398>
>- A new designated mailing-list and page for any critical security
>issues that might come up has been created:
>http://doc.akka.io/docs/akka-http/current/security.html
><http://doc.akka.io/docs/akka-http/current/security.html>
>-
>   - Please follow the linked mailing list if you have production Akka
>   systems, so you’ll be the first to know in case a security issue is 
> found
>   and fixed in Akka.
>
>
> The plan regarding releasing a stable 3.0.0 is to wait a little bit for
> community feedback on the release candidates, and call a stable one no
> longer than a few weeks from now. We’re eagerly awaiting your feedback and
> can’t wait to ship the stable version of all of Akka HTTP’s modules!
>
> Credits
>
> A total 15 issues were closed since 2.4.11, most of the work was moving
> source code, documentation and issues to their new places.
>
> The complete list of closed issues can be found on the 3.0.0-RC1
> <https://github.com/akka/akka-http/milestone/1?closed=1> milestone on
> github.
>
> For this release we had the help of 14 committers – thank you!
>
> A special thanks to Jonas Fonseca <https://github.com/jonas> who did a
> tremendously awesome job at migrating all the docs from sphinx
> (restructuredtext) to paradox (markdown), contributing features that the
> Akka docs needed to upstream Paradox–thanks a lot!
>
> Credits:
>
> commits added removed
>
>   10   22489   24696 Jonas Fonseca
>
>   101927 256 Johann

Re: [akka-user] Re: ANNOUNCE: Akka HTTP 3.0.0-RC1

2016-10-18 Thread Konrad Malawski
Yes, that's what all the fuss is about ;-)
In fact, in RC it's already removed:
http://search.maven.org/#artifactdetails%7Ccom.typesafe.akka%7Cakka-http%7C3.0.0-RC1%7Cjar

For people not tracking this in detail: please note that all other modules
other than "the DSL" have been stable for a long time already.

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 18 October 2016 at 19:41:18, Eric Swenson (e...@swenson.org) wrote:

Congratulations!  Is the plan to remove the "experimental" from
akka-http-experimental when this moves from RC to final?  -- Eric

On Monday, October 17, 2016 at 3:22:17 PM UTC-7, Konrad 'ktoso' Malawski
wrote:
>
> Dear hakkers,
>
> We are proud to announce the first Release Candidate of the Akka HTTP's
> "fully stable" release–the only missing, bit was the Routing DSLs, which we
> now deem stable enough to support for an extended period of time.
>
>
> This release marks the first of the 3.0.0 series of this project and
> signifies a large step in terms of confidence in the library, as well as
> the move of Akka HTTP into its own repository. From now on Akka HTTP will
> be versioned separately from Akka “core”. This has been discussed at large
> with the community on akka-meta <http://github.com/akka/akka-meta>, and
> the akka-http <https://github.com/akka/akka-http/> repositories on
> github. Thank you very much for your input!
>
> For more background why this move, please read “Akka HTTP - stable,
> growing and tons of opportunity
> <https://github.com/akka/akka-meta/issues/27>” on akka-meta. While
> preparing In the meantime we have delivered a Proof-of-Concept of HTTP/2
> for Akka HTTP and plan to continue this work later this year–community help
> is very much welcome on this front as well.
>
> The documentation from now on will be available here:
>
> Some noteworthy changes in the *3.0.0-RC1* (since it's move out from
> 2.4.11) release are:
>
>
>-
>
>New lightbend/paradox powered documentation
>-
>   -
>
>   This will allow us to aggregate it together with Akka and other
>   documentation, as well as link more easily to ScalaDoc pages
>   -
>
>   Akka HTTP documentation will from now on live here:
>   http://doc.akka.io/docs/akka-http/current/index.html
>   <http://doc.akka.io/docs/akka-http/current/index.html>
>   -
>
>   We’ll work on a better theme for it very soon.
>   -
>
>Multipart is now correctly Binary MediaType (instead of
>WithOpenCharset) #398 <https://github.com/akka/akka-http/pull/398>
>-
>
>A new designated mailing-list and page for any critical security
>issues that might come up has been created:
>http://doc.akka.io/docs/akka-http/current/security.html
><http://doc.akka.io/docs/akka-http/current/security.html>
>-
>   -
>
>   Please follow the linked mailing list if you have production Akka
>   systems, so you’ll be the first to know in case a security issue is 
> found
>   and fixed in Akka.
>
>
> The plan regarding releasing a stable 3.0.0 is to wait a little bit for
> community feedback on the release candidates, and call a stable one no
> longer than a few weeks from now. We’re eagerly awaiting your feedback and
> can’t wait to ship the stable version of all of Akka HTTP’s modules!
>
> Credits
>
> A total 15 issues were closed since 2.4.11, most of the work was moving
> source code, documentation and issues to their new places.
>
> The complete list of closed issues can be found on the 3.0.0-RC1
> <https://github.com/akka/akka-http/milestone/1?closed=1> milestone on
> github.
>
> For this release we had the help of 14 committers – thank you!
>
> A special thanks to Jonas Fonseca <https://github.com/jonas> who did a
> tremendously awesome job at migrating all the docs from sphinx
> (restructuredtext) to paradox (markdown), contributing features that the
> Akka docs needed to upstream Paradox–thanks a lot!
>
> Credits:
>
> commits added removed
>
>   10   22489   24696 Jonas Fonseca
>
>   101927 256 Johannes Rudolph
>
>   10 849 412 Konrad Malawski
>
>4 448 136 Robert Budźko
>
>2  37  37 Bernard Leach
>
>2 107   7 Richard Imaoka
>
>2  26  24 Jakub Kozłowski
>
>1 145 101 Jan @gosubpl
>
>1 108 114 Derek Wyatt
>
>1  45  33 Wojciech Langiewicz
>
>1  49   0 @2beaucoup
>
>1   6   6 Markus Hauck
>
>1   1   1 Ian Forsey
>
>1   1   1 Johan Andrén
>
&

Re: [akka-user] Type mismatch, expected: ToResponseMarshallable, actual: HttpEntity.Strict

2016-10-16 Thread Konrad Malawski
Make sure you have the latest version of the scala plugin.

And I'd rather ask such questions on the Intellij issue tracker.
Akka itself is doing the right thing as you mentioned... :)


-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 16 October 2016 at 15:49:51, Chuanlei Ni (nichuan...@gmail.com) wrote:

HI,

I copy the code example from introduction of akka-http (
http://doc.akka.io/docs/akka/2.4/scala/http/introduction.html)
I manage the project by maven, and the pom.xml is



com.typesafe.play
twirl-api_2.11
1.1.1


com.typesafe.akka
akka-http-experimental_2.11
2.4.11



and some plugins for scala and twirl are ignored.
The code is as follows

import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.model._
import akka.http.scaladsl.server.Directives._
import akka.stream.ActorMaterializer

import scala.io.StdIn


object Main{
  def main(args : Array[String]): Unit ={
implicit val system = ActorSystem("my-system")
implicit val materializer = ActorMaterializer()
// needed for the future flatMap/onComplete in the end
implicit val ec = system.dispatcher
val RESOURCE_DIR = "spark/deploy/master/webui"
val STATIC_RESOURCE_DIR = "spark/deploy/static"
val route =
  path("world"){
get{
  *complete(HttpEntity(ContentTypes.`text/html(UTF-8)`,
html.Hello.render("Jake").toString()))*
}
  } ~
  path("hello") {
get {
  *complete(HttpEntity(ContentTypes.`text/html(UTF-8)`,
html.Hello.render("Jake").toString()))*
}~
  pathPrefix("static") {
getFromResourceDirectory(STATIC_RESOURCE_DIR)
  } ~
  getFromResourceDirectory(RESOURCE_DIR)
  }
val bindingFuture = Http().bindAndHandle(route, "localhost", 8080)

println(s"Server online at http://localhost:8080;)
StdIn.readLine() // let it run until user presses return
  }
}


But, some error hints appear in my intellj idea

Type mismatch, expected: ToResponseMarshallable, actual: HttpEntity.Strict
for

*complete(HttpEntity(ContentTypes.`text/html(UTF-8)`,
html.Hello.render("Jake").toString()))*


However, I can run this webservice without any error.

I also try to cast HttpEntity to ToResponseMarshallable, but the conversion
is forbidden

What shall I do to clear the error hint in intellj idea?

Thanks in advance.















--
>> 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] Re: Akka stream - implements Pause/Resume

2016-10-14 Thread Konrad Malawski
Have you read the blog post?
In the async callback you can push(), that's what I meant.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 14 October 2016 at 10:11:09, Konrad 'ktoso' Malawski (ktos...@gmail.com)
wrote:

Please read this:
- http://blog.akka.io/integrations/2016/08/29/connecting-existing-apis
- and this: http://doc.akka.io/docs/akka/2.4/scala/stream/stream-
customize.html

Specifically, your trigger should be implemented as async-callback, as it
comes from the outside but should "wake up" the stage to be able to push
data again.
In your current setup it never "wakes up" since all pulls/pushes have been
processed - the stage has no idea it should do something once you called
open.

-- Konrad

W dniu piątek, 14 października 2016 09:03:54 UTC+2 użytkownik regis leray
napisał:
>
> Hi,
>
> Im currently trying to implement a valve Graph to manage pause/resume. We
> can control the behavior of the graph by using the MaterializeValue
>
> trait ValveSwitch {
>   def open: Unit
>   def close: Unit
> }
>
>
> Current implementation of the valve
>
> class Valve[A](mode: ValveMode = ValveMode.Open) extends 
> GraphStageWithMaterializedValue[FlowShape[A, A], ValveSwitch] {
>
>   override val shape = FlowShape(Inlet[A]("valve.in"), Outlet[A]("valve.out"))
>
>   override def createLogicAndMaterializedValue(inheritedAttributes: 
> Attributes): (GraphStageLogic, ValveSwitch) = {
> val logic = new ValveGraphStageLogic(shape, mode)
> (logic, logic.switch)
>   }
>
> }
>
>
> The current implementation is pretty simple, each time we are receiving a
> onPull demand we are requesting by doing pull(in).
> When a onPush demand is received we are checking the current state
> - if Open we are doing the default behavior by doing push(out,element)
> - if Close we are putting the element into a queue
>
> private class ValveGraphStageLogic(shape: Shape, var mode: ValveMode) extends 
> GraphStageLogic(shape){
>   import shape._
>
>   var bufferedElement = List.empty[A]
>
>   val switch = new ValveSwitch {
> override def open: Unit = {
>   mode = ValveMode.Open
>   println(s"pushing $bufferedElement, out is available ? 
> ${isAvailable(out)}")
>
>   bufferedElement.foreach(push(out, _))
>   bufferedElement = List.empty
> }
>
> override def close: Unit = {
>   mode = ValveMode.Closed
> }
>   }
>
>   setHandler(in, new InHandler {
> override def onPush(): Unit = {
>   val element = grab(in) //acquires the element that has been received 
> during an onPush
>   println(s"${mode} on push called with $element")
>   if (mode == ValveMode.Open) {
> push(out, element) //push directly the element on the out port
>   } else {
> bufferedElement = bufferedElement :+ element
>   }
> }
>   })
>
>   setHandler(out, new OutHandler {
> override def onPull(): Unit = {
>   println("on pull called")
>   pull(in) //request the next element on in port
> }
>   })
> }
>
>
> When we are resuming the valve my using the switch.open, we are pushing
> the element
>
> override def open: Unit = {
>
>   mode = ValveMode.Open
>   println(s"pushing $bufferedElement, out is available ? ${isAvailable(out)}")
>
>   bufferedElement.foreach(push(out, _))
>   bufferedElement = List.empty
> }
>
>
> The Current test is failing
>
> "A closed valve" should "emit only 3 elements after it has been open" in {
>
> val (valve, probe) = Source(1 to 5)
> .viaMat(new Valve(ValveMode.Closed))(Keep.right) //the current valve by 
> default is closed, dont push any message
> .toMat(TestSink.probe[Int])(Keep.both)
> .run()
>
>   probe.request(2)
>   probe.expectNoMsg()
>
>   valve.open //open the valve should emit the previous
>
>
>   probe.expectNext shouldEqual 1 //we never receive the element
>   probe.expectNext shouldEqual 2
>
>   probe.request(3)
>   probe.expectNext shouldEqual 3
>   probe.expectNext shouldEqual 4
>   probe.expectNext shouldEqual 5
>
>   probe.expectComplete()
> }
>
>
> Here the console log
>
> on pull called
> Closed on push called with 1
> pushing Some(1), out is available ? true
>
> Expected OnNext(_), yet no element signaled during 3 seconds
> java.lang.AssertionError: Expected OnNext(_), yet no element signaled during 
> 3 seconds
> at 
> akka.stream.testkit.TestSubscriber$ManualProbe.expectNext(StreamTestKit.scala:268)
> at 
> akka.stream.testkit.TestSubscriber$ManualProbe.expectNext(StreamTestKit.scala:259)
> at 
> com.omsignal.omrun.orchestration.rest.ValveSpec$$anonfun$1.apply(ValveSpec.scala:44)
> at 
> com.omsignal.omrun.orchestration.rest.ValveSpec$$anonfun$1.apply(ValveSpec.scala:34)
>
>
> I'm suspecting the current code to have an issue when we are resuming the
> valve, it doesnt seems the push really works
>
> val switch = new ValveSwitch {
> override def open: Unit = {
>   mode = ValveMode.Open
>   println(s"pushing $bufferedElement, out is available ? 
> 

Re: [akka-user] Akka stream - implements Pause/Resume

2016-10-14 Thread Konrad Malawski
Please read this:
- http://blog.akka.io/integrations/2016/08/29/connecting-existing-apis
- and this:
http://doc.akka.io/docs/akka/2.4/scala/stream/stream-customize.html

Specifically, your trigger should be implemented as async-callback, as it
comes from the outside but should "wake up" the stage to be able to push
data again.
In your current setup it never "wakes up" since all pulls/pushes have been
processed - the stage has no idea it should do something once you called
open.

On Fri, Oct 14, 2016 at 12:13 AM, regis leray  wrote:

> Hi,
>
> Im currently trying to implement a valve Graph to manage pause/resume. We
> can control the behavior of the graph by using the MaterializeValue
>
> trait ValveSwitch {
>   def open: Unit
>   def close: Unit
> }
>
>
> Current implementation of the valve
>
> class Valve[A](mode: ValveMode = ValveMode.Open) extends 
> GraphStageWithMaterializedValue[FlowShape[A, A], ValveSwitch] {
>
>   override val shape = FlowShape(Inlet[A]("valve.in"), Outlet[A]("valve.out"))
>
>   override def createLogicAndMaterializedValue(inheritedAttributes: 
> Attributes): (GraphStageLogic, ValveSwitch) = {
> val logic = new ValveGraphStageLogic(shape, mode)
> (logic, logic.switch)
>   }
>
> }
>
>
> The current implementation is pretty simple, each time we are receiving a
> onPull demand we are requesting by doing pull(in).
> When a onPush demand is received we are checking the current state
> - if Open we are doing the default behavior by doing push(out,element)
> - if Close we are putting the element into a queue
>
> private class ValveGraphStageLogic(shape: Shape, var mode: ValveMode) extends 
> GraphStageLogic(shape){
>   import shape._
>
>   var bufferedElement = List.empty[A]
>
>   val switch = new ValveSwitch {
> override def open: Unit = {
>   mode = ValveMode.Open
>   println(s"pushing $bufferedElement, out is available ? 
> ${isAvailable(out)}")
>
>   bufferedElement.foreach(push(out, _))
>   bufferedElement = List.empty
> }
>
> override def close: Unit = {
>   mode = ValveMode.Closed
> }
>   }
>
>   setHandler(in, new InHandler {
> override def onPush(): Unit = {
>   val element = grab(in) //acquires the element that has been received 
> during an onPush
>   println(s"${mode} on push called with $element")
>   if (mode == ValveMode.Open) {
> push(out, element) //push directly the element on the out port
>   } else {
> bufferedElement = bufferedElement :+ element
>   }
> }
>   })
>
>   setHandler(out, new OutHandler {
> override def onPull(): Unit = {
>   println("on pull called")
>   pull(in) //request the next element on in port
> }
>   })
> }
>
>
> When we are resuming the valve my using the switch.open, we are pushing
> the element
>
> override def open: Unit = {
>
>   mode = ValveMode.Open
>   println(s"pushing $bufferedElement, out is available ? ${isAvailable(out)}")
>
>   bufferedElement.foreach(push(out, _))
>   bufferedElement = List.empty
> }
>
>
> The Current test is failing
>
> "A closed valve" should "emit only 3 elements after it has been open" in {
>
> val (valve, probe) = Source(1 to 5)
> .viaMat(new Valve(ValveMode.Closed))(Keep.right) //the current valve by 
> default is closed, dont push any message
> .toMat(TestSink.probe[Int])(Keep.both)
> .run()
>
>   probe.request(2)
>   probe.expectNoMsg()
>
>   valve.open //open the valve should emit the previous
>
>
>   probe.expectNext shouldEqual 1 //we never receive the element
>   probe.expectNext shouldEqual 2
>
>   probe.request(3)
>   probe.expectNext shouldEqual 3
>   probe.expectNext shouldEqual 4
>   probe.expectNext shouldEqual 5
>
>   probe.expectComplete()
> }
>
>
> Here the console log
>
> on pull called
> Closed on push called with 1
> pushing Some(1), out is available ? true
>
> Expected OnNext(_), yet no element signaled during 3 seconds
> java.lang.AssertionError: Expected OnNext(_), yet no element signaled during 
> 3 seconds
> at 
> akka.stream.testkit.TestSubscriber$ManualProbe.expectNext(StreamTestKit.scala:268)
> at 
> akka.stream.testkit.TestSubscriber$ManualProbe.expectNext(StreamTestKit.scala:259)
> at 
> com.omsignal.omrun.orchestration.rest.ValveSpec$$anonfun$1.apply(ValveSpec.scala:44)
> at 
> com.omsignal.omrun.orchestration.rest.ValveSpec$$anonfun$1.apply(ValveSpec.scala:34)
>
>
> I'm suspecting the current code to have an issue when we are resuming the
> valve, it doesnt seems the push really works
>
> val switch = new ValveSwitch {
> override def open: Unit = {
>   mode = ValveMode.Open
>   println(s"pushing $bufferedElement, out is available ? 
> ${isAvailable(out)}")
>
>   bufferedElement.foreach(push(out, _))
>   bufferedElement = Option.empty
> }
>
> override def close: Unit = {
>   mode = ValveMode.Closed
> }
>   }
>
>
> There is definitively something i dont catch up, if anyone could help me
> to see some 

Re: [akka-user] Re: Completion of a Graph with a Cycle

2016-10-12 Thread Konrad Malawski
Have you seen
http://doc.akka.io/docs/akka/2.4/scala/stream/stream-dynamic.html#Controlling_graph_completion_with_KillSwitch
 ?

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 12 October 2016 at 15:42:01, external.stefan.wach...@bosch-si.com (
external.stefan.wach...@bosch-si.com) wrote:

I think I found a general solution in the meantime. We have a "semaphore"
component that wraps a flow and tracks / delimits the number of elements
that may be "in flight" at the same time in the wrapped flow (the flow must
have a 1:1 relationship between its input and output).The semaphore
component can forward a completion when there are no more elements in
flight. (The wrapped flow is canceled in that case just in case that it
completes not by itself.)

Am Mittwoch, 12. Oktober 2016 09:21:09 UTC+2 schrieb EXTERNAL Wachter
Stefan (Keybird IT Consulting und Vetriebs GmbH, INST-ICM/BSV-BS):
>
> Hi all,
>
>
>
> is there a principled way to complete a graph that contains a cycle? The
> basic problem is that the initial Merge component can either complete
> eagerly or not. Both settings are suboptimal (if it completes not eager it
> will complete never, if it completes eager elements in the feedback cycle
> get lost).
>
>
>
> I think that using some kind of poison pill could be used. However, is
> there some principled mechanism that might be used?
>
>
>
> Mit freundlichen Grüßen / Best regards
>
>
>
> * Dr. Stefan Wachter*
>
>
>
> Bosch Software Innovations GmbH
>
> Communications (INST-ICM/BSV-BS)
>
> Stuttgarterstr. 130
>
> 71332 Waiblingen
>
> GERMANY
>
> www.bosch-si.de
>
> www.blog.bosch-si.com
>
>
>
> Tel. +49 711 811 58 477
>
> Fax +49 711 811 58 100
>
> external.stefan.wach...@bosch-si.com 
>
>
>
--
>> 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] Re: Memory leak: unexpected mailbox filling up

2016-10-06 Thread Konrad Malawski
That problem does not happen in Akka Streams, it explicitly manages
flow-control by the way.

On Thu, Oct 6, 2016 at 10:03 AM, Viktor Klang 
wrote:

> Of course it builds up if you can't process the messages equal-or-faster
> than you get them?
>
> --
> Cheers,
> √
>
> On Oct 6, 2016 09:49, "Alexander Lukyanchikov" <
> alexanderlukyanchi...@gmail.com> wrote:
>
>>
>> Sorry guys, quick update:
>>
>> Time interval actually affects the situation: if actor job time <
>> scheduler interval, everything is good, no matter how many actors we have.
>>
>> When actor job time > scheduler interval and ACTOR_COUNT < 30, envelopes
>> filling up and not garbage collected (millions of them after a few hours).
>> *But if I increase ACTOR_COUNT up to 30, GC starts to delete those
>> not-delivered messages, according to the profiler.*
>>
>> Why? Looks like something in Akka starts working differently after that
>> magic threshold.
>>
>> Any ideas?
>>
>>
>> --
>> >> 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/
> 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,
Konrad 'ktoso' Malawski
Akka  @ Typesafe 

-- 
>>  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] Control how much cpu are used by the actor system?

2016-09-30 Thread Konrad Malawski
That's what containers are for though.
Run your jvm in a container and restrict resources available to that one

On 30 Sep 2016 19:48, "Roland Kuhn"  wrote:

> Hi Jean-François,
>
> the JVM does not offer the functionality you seek, you'll have to use your
> operating system’s capabilities to restrict the resources available to the
> JVM itself.
>
> Regards, Roland
>
> Sent from my iPhone
>
> On 30 Sep 2016, at 18:29, Jean-François Côté 
> wrote:
>
> Hi guys!
>
> Is there any way to control how much cpu the akka system use over the
> total of cpu available in the JVM? For example, I would want all my actor
> system to only use 75% of the processing power available so that 2 of my 8
> core is available for other system on the server. I've checked dispatcher,
> router, etc but nothing seems to control this kind of thing. But maybe I
> missed something.
>
> Thanks!
> J-F
>
> --
> >> 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.
>

-- 
>>  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.4.10 - connection reset by peer when consuming stream with parallelism == 1

2016-09-30 Thread Konrad Malawski
That means the other side has closed the connection. It could be an idle
timeout. Are you sure data is consistently flowing, and not being idle for
minutes?

On 30 Sep 2016 16:59, "Eric Torti"  wrote:

> Hey guys,
>
> I am new to akka streams so I may be missing something big here. Using
> akka-stream, akka-http-core, akka-typed-experimental all 2.4.10 - scala
> 2.11.8.
>
> I am experiencing the `connection reset by peer` error on a stream that I
> have checked with `curl` to remain open far longer than the time it takes
> akka to crash.
>
> The stream is produced from json lines like so:
>
> ```
>
> def stream(): Source[Development, Any] = {
>
>   def chunkConsumer(res: HttpResponse) = {
> res.entity.dataBytes
>   .via(Framing.delimiter(ByteString("\r\n"), 1048576, allowTruncation = 
> true))
>   .map[Development](bs => { parse(bs.utf8String).extract[Development] })
>   }
>
>   val req = HttpRequest(method = HttpMethods.GET, uri = 
> s"http://$endpoint:$port/developments/stream;)
>   val res: Source[Development, Any] = 
> Source.single(req).via(client).flatMapConcat(chunkConsumer)
>
>   res
> }
>
> ```
>
> And consumed like so:
>
> ```
>
> def slowAsyncTransformation(d: Development) = {
>   Future { Thread sleep 50; d }
> }
>
> val parallelism = 2
>
> DevelopmentsAPI
>   .stream()
>   .mapAsync(parallelism)(slowAsyncTransformation(_))
>   .runFold(0)((acc, d) => {
> System.out.println("processing development " + d.id)
> acc + 1
>   })
>   .onComplete {
> case Success(s) => {
>   System.out.println(s"processed $s developments")
>   system.terminate()
>   Await.result(system.whenTerminated, 5 seconds)
>   System.exit(0)
> }
> case Failure(ex) => {
>   System.err.println(s"Could not finish processing developments: $ex")
>   system.terminate()
>   Await.result(system.whenTerminated, 5 seconds)
>   System.exit(1)
> }
>   }
>
> ```
>
>
> I can consistently get this to work from end to end in 180 seconds if I have 
> `parallelism` set to 2.
>
>
> But if I set `parallelism` to 1, it crashes in 35 seconds with `Could not
> finish processing developments: akka.stream.StreamTcpException: The
> connection closed with error: Connection reset by peer`
>
> I cannot make sense of why is the degree of parallelism being 1 would
> cause the peer to reset the connection.
>
> Any help will be greatly appreciated.
>
> Thanks,
>
> Eric
>
> --
> >> 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] Unmarshalling using javadsl

2016-09-28 Thread Konrad Malawski
If you're a Java user I'm not quite sure how you arrived at the concept of
per request actors, esp implemented like that.

a) This won't work - completing must be done in a route.

And ...

b) use the entityAs() directive, it is documented, please check the docs.
Also:
http://doc.akka.io/docs/akka/2.4.10/java/http/implications-of-streaming-http-entity.html#consuming-the-http-request-entity-server

Happy hakking!


-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 28 September 2016 at 20:55:36, jpsteinm...@skydance.com (
jpsteinm...@skydance.com) wrote:

Hi,

I'm new to Akka Http and have been working on implementing a RESTful
service using the actor-per-request model. So far I've gotten everything
working but I am stuck at unmarshalling the entity in my request handler
actor. While there are lots of documentation for using unmarshal directives
in the scaladsl I don't see anything specific to Java which will help me.

This is currently what my request handler code looks like where I need the
unmarshaller...

public class MyRequestHandler extends UntypedActor {
public void onReceive(Object msg) throws Throwable {
if (msg instanceof RequestContext) {
RequestContext context = (RequestContext)msg;
if (context.getRequest().method() == HttpMethods.POST) {
// TODO Unmarshal request entity
}
}
}
}

Thanks in advance,

Jean-Philippe Steinmetz
--
>> 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 HTTP Stream listener stops processing databytes after a while

2016-09-28 Thread Konrad Malawski
Add a log() stage to the flow.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 28 September 2016 at 14:21:28, Tal Beno (tal.b...@gmail.com) wrote:

I have an app which has 3 HTTP listeners like this one:

val futureResponse1: Future[HttpResponse] =
  Http().singleRequest(HttpRequest(uri = someUrl))

each of the 3 is listening to a non stop stream (each to a different one).
And handles it with a simple flow that starts with grouping and then a
relatively fast processing (non-blocking):

futureResponse1.flatMap {response =>
  response.status match {
case StatusCodes.OK =>
  val source: Source[ByteString, Any] = response.entity.dataBytes
  source.
grouped(100).
map(doSomethingFast).
runWith(Sink.ignore)

case notOK => system.log.info("failed opening, status: " + notOK.toString())
  }

...

I get no exceptions or warnings. But after a while (could be 15-25 minutes)
the listeners are just suddenly stopping. One after the other (not
together).

Maybe its the grouped phase that is the problem there? Or maybe the
connection/stream just stops? Or the dispatcher that is shared by them is
getting starved / something not getting released.

Any ideas why that may be happening please?
--
>> 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] Streams - Tcp outgoing reconnecting

2016-09-22 Thread Konrad Malawski
Please check akka/* repositories :-)
Such as akka/akka-stream-contrib – akka-contrib-extra is not a supported
thing and was mostly driven by conductr some time ago, not very alive right
now.

In fact, we do have new reconnection facilities in that repo:
https://github.com/akka/akka-stream-contrib/blob/master/contrib/src/main/scala/akka/stream/contrib/Retry.scala

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 22 September 2016 at 01:13:03, Ladislav Skokan (sko...@gmail.com) wrote:

Hi

I try to implement TCP outgoing stream and I need to reconnect if TCP
server restarts. I found that there was a reconnecting pattern in Akka
streams and it was removed here


What is the best way to reconnect client socket today. Any code example
somewhere?

Thank you, Ladislav.

--
>> 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 Stream] Happens-before relation and runForEach

2016-09-20 Thread Konrad Malawski
final Source source = // ...
final MutableInt max = new MutableInt(Integer.MIN_VALUE);
final Procedure f = i -> {
  if (i > max.intValue()) {
max.setValue(i);
  }
};
final CompletionStage result = source
.runForeach(f, materializer)
.thenApply(__ -> max.intValue());

Is the above code correct in the sense that it always commutes the maximum
(or MIN_VALUE in case the stream is empty)?

According to Akka Stream documentation

on
Stream Ordering, there is a Java happens-before relation between
invocations of f. Do I still need to use AtomicInteger so that the effects
are seen by all threads?

You're side-effecting outside the stream, so nothing is guaranteed.

Yes, it would have to be an atomic integer.


Instead consider using a better operator for this kind of thing than
foreach - like fold (runFold) which is enough for such operation you're
doing here.


Happy hakking.

-- 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] Scala Akka Alignment

2016-09-20 Thread Konrad Malawski
You can see which version of Scala an Akka artifact is released for by
looking at the artifact names:
http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22akka-remote_2.11%22

So as you see, it's released for 2.11.

That you're talking about jar files makes me thing you're mixing different
akka versions... That's not supported, make sure it's all the same version
of Akka.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 20 September 2016 at 14:28:32, Joseph Mansigian (
joseph.c.mansig...@gmail.com) wrote:

I am trying to use scala 2.11.8 and akka 2.4.9 for remoting.  Not sure if
these versions are compatible.  I noticed that there is an akka jar with
scala which is confusing to me since I already hava akka jars on the
classpath.  When I run code  I am getting:

  java.lang.NoSuchMethodError:
akka.util.Helpers$.toRootLowerCase(Ljava/lang/String;)Ljava/lang/String;

Have the jar with some version of akka.util.Helpers$ on the classpath but
apparently this version does not have the method cited in the error
message.  Anyone recognize what is happening?  Source, classpath, directory
structure, stacktrace, etc available on demand.   Thank you for helping.

--
>> 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-HTTP] Request for comment - Post render regex modifier

2016-09-19 Thread Konrad Malawski
Nothing to be sorry about, thanks a lot for posting as issue!

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 19 September 2016 at 11:55:11, Derek Wyatt (de...@derekwyatt.org) wrote:

Crap, sorry Konrad.  Will do.

On Monday, September 19, 2016 at 2:53:59 PM UTC-4, Konrad Malawski wrote:
>
> Hi Derek,
> could you re-post this on github.com/akka/akka-http?
> I want to have a look but having a very chaotic week - it'd help me/us to
> have it as ticket - easier to find and come back to it than on akka-user.
>
> I think we should be able to help in some way or another if servers are
> doing "weird stuff",
> I have not yet reviewed your proposal though, so let's see.
>
> Thanks for attempting to solve it in Akka itself, should be of good
> benefit to everyone :)
>
> --
> Konrad `ktoso` Malawski
> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>
> On 19 September 2016 at 11:46:58, Derek Wyatt (de...@derekwyatt.org
> ) wrote:
>
> Hi folks,
>
> I've been wrestling with a bug in IIS (see https://groups.google.com/d/
> msg/akka-user/7iW5-HlshZk/S75Wgxg_AwAJ).  It seems that I'm going to have
> to deal with the problem myself, because either IIS can't be fixed or the
> guys I'm dealing with aren't willing to try.  And, at any rate, since I've
> used Akka HTTP to build a Reverse HTTP Proxy, I'm sure I'm going to have to
> deal with oddities as part of every day life so an enhancement as the one
> I'm proposing is vital to my success.
>
> As such, I've thrown together a simple (and highly inelegant at the
> moment) mechanism for being able to rewrite the Content-Type header after
> rendering, as this is the header that is currently causing me problems.
>
> I'd very much appreciate someone taking a look at it and critique the
> approach.  I tried a number of ways of shoehorning this feature into the
> code, implicits on the render method, a template-method pattern for wiring
> in a user-defined transformer and they were all pretty cumbersome.  This
> was the "simplest" method I could find for the moment.
>
> I don't have any default values for the arguments because I wanted to make
> sure I was able to write it up properly all the way through.
>
> Does anyone think this idea (once cleaned and made "proper") could be
> accepted as a PR?  I'm still working on it a fair bit because I've got to
> get something into production that will allow me to work around the IIS
> problem, but I expect the essence is there.
>
> https://github.com/derekwyatt/akka/commit/1b279bc426be352a1d204e45e85545
> 1acaac58e3
>
> Thanks,
> Derek
>
> --
> >>>>>>>>>> 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-HTTP] Request for comment - Post render regex modifier

2016-09-19 Thread Konrad Malawski
Hi Derek,
could you re-post this on github.com/akka/akka-http?
I want to have a look but having a very chaotic week - it'd help me/us to
have it as ticket - easier to find and come back to it than on akka-user.

I think we should be able to help in some way or another if servers are
doing "weird stuff",
I have not yet reviewed your proposal though, so let's see.

Thanks for attempting to solve it in Akka itself, should be of good benefit
to everyone :)

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 19 September 2016 at 11:46:58, Derek Wyatt (de...@derekwyatt.org) wrote:

Hi folks,

I've been wrestling with a bug in IIS (see
https://groups.google.com/d/msg/akka-user/7iW5-HlshZk/S75Wgxg_AwAJ).  It
seems that I'm going to have to deal with the problem myself, because
either IIS can't be fixed or the guys I'm dealing with aren't willing to
try.  And, at any rate, since I've used Akka HTTP to build a Reverse HTTP
Proxy, I'm sure I'm going to have to deal with oddities as part of every
day life so an enhancement as the one I'm proposing is vital to my success.

As such, I've thrown together a simple (and highly inelegant at the moment)
mechanism for being able to rewrite the Content-Type header after
rendering, as this is the header that is currently causing me problems.

I'd very much appreciate someone taking a look at it and critique the
approach.  I tried a number of ways of shoehorning this feature into the
code, implicits on the render method, a template-method pattern for wiring
in a user-defined transformer and they were all pretty cumbersome.  This
was the "simplest" method I could find for the moment.

I don't have any default values for the arguments because I wanted to make
sure I was able to write it up properly all the way through.

Does anyone think this idea (once cleaned and made "proper") could be
accepted as a PR?  I'm still working on it a fair bit because I've got to
get something into production that will allow me to work around the IIS
problem, but I expect the essence is there.

https://github.com/derekwyatt/akka/commit/1b279bc426be352a1d204e45e855451acaac58e3

Thanks,
Derek

--
>> 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] OneForOneStrategy thread safety

2016-09-15 Thread Konrad Malawski
That depends what you do inside it though.
My itself it is safe, it's just a function pretty much. Unless you side
effect inside it it's fine.

On 15 Sep 2016 4:47 p.m., "Wei"  wrote:

> Hello,
>
> Is OneForOneStrategy class thread safe? Can I share one instance of this
> class with multiple actors as their supervisorStrategy?
>
> 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.
>

-- 
>>  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 Http Logging with traceId

2016-09-13 Thread Konrad Malawski
Reactive Monitoring is able to propagate MDC across Actors:
https://www.lightbend.com/products/monitoring

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 13 September 2016 at 08:57:24, Arun (sethia.a...@gmail.com) wrote:

Thanks Jan.

I am looking for something similar to
http://code.hootsuite.com/logging-contextual-info-in-an-asynchronous-scala-application/
, I could able to find that either by using custom akka dispatcher or
custom execution context, we can achieve the same, but I would prefer
anything I can do with minimal changes in akka default behaviour.

Using MDC with Logback; the logback uses a ThreadLocal variable and this
works when one thread is used for one request, in case of Akka asynchronous
communication happens across multiple threads.

Thanks
Arun

On Tuesday, September 13, 2016 at 11:27:58 AM UTC+5:30, Jan Algermissen
wrote:
>
> Hi Arun
>
> Take a look at kamon.io
>
> Jan
>
> Sent from my iPhone
>
> On 13.09.2016, at 07:48, Arun  wrote:
>
> Hi,
>
> We have a requirement where we need to log information with traceId (or
> unique identifier) for  a given HTTP request across route and actors. This
> can help us to trace logging.
>
> The configuration is as following:
>
> akka {
>   loggers = ["akka.event.slf4j.Slf4jLogger"]
>   loglevel = "INFO"
>   logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
>
> }
>
>
> and logback.xml is as following:
>
>
> 
> 
> 
> true
> 
> @timestamp
> msg
> [ignore]
> [ignore]
> logger
> [ignore]
> 
>  class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
> 80
> 2048
> 20
>   true
> 
> 
> 
> 
> 
> 
> 
>
>
> Please let me know how we can enable traceId from route to actor systems.
>
>
> Thanks
>
> Arun
>
> --
> >> 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] Enjoying Akka HTTP performance

2016-09-12 Thread Konrad Malawski
That's very cool - thanks for posting these Christian!
We didn't actually compare with Play, didn't have time somehow; We were
focused on beating Spray :-)

Very cool to see we're on par with Netty Play.

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 12 September 2016 at 15:08:11, Christian Schmitt (
c.schm...@briefdomain.de) wrote:

Reflog:

schmitch@deployster:~/projects/schmitch/wrk2$ git reflog HEAD

c4250ac HEAD@{0}: clone: from https://github.com/giltene/wrk2.git

Am Montag, 12. September 2016 15:07:08 UTC+2 schrieb Christian Schmitt:
>
> it is actually wrk2:
>
> schmitch@deployster:~/projects/schmitch/wrk2$ ./wrk --version
>
> wrk 4.0.0 [kqueue] Copyright (C) 2012 Will Glozer
>
>
> I compiled it on the mac against the homebrew openssl library.
>
> Actually I also thing that at something like 60k-70k packages my client
> network gear and the switch starts to fall behind (thats why the latency is
> so high).
>
> Am Montag, 12. September 2016 15:01:40 UTC+2 schrieb √:
>>
>> https://github.com/giltene/wrk2
>>
>> On Mon, Sep 12, 2016 at 2:59 PM, Christian Schmitt <
>> c.sc...@briefdomain.de> wrote:
>>
>>> extracted from my gist:
>>>
>>> akka-http:
>>> schmitch@deployster:~/projects/schmitch/wrk2$ ./wrk -t2 -c100 -d300s
>>> -R120k http://192.168.179.157:3000
>>> Running 5m test @ http://192.168.179.157:3000
>>>   2 threads and 100 connections
>>>   Thread calibration: mean lat.: 787.360ms, rate sampling interval:
>>> 2975ms
>>>   Thread calibration: mean lat.: 585.613ms, rate sampling interval:
>>> 2473ms
>>>   Thread Stats   Avg  Stdev Max   +/- Stdev
>>> Latency30.11s22.42s1.58m62.48%
>>> Req/Sec44.77k 4.77k   54.28k58.88%
>>>   26888534 requests in 5.00m, 4.50GB read
>>> Requests/sec:  89628.49
>>> Transfer/sec: 15.37MB
>>>
>>> play with netty and native enabled (netty without native is exactly the
>>> same as akka-http:
>>> schmitch@deployster:~/projects/schmitch/wrk2$ ./wrk -t2 -c100 -d300s
>>> -R120k http://192.168.179.157:9000
>>> Running 5m test @ http://192.168.179.157:9000
>>>   2 threads and 100 connections
>>>   Thread calibration: mean lat.: 625.068ms, rate sampling interval:
>>> 2504ms
>>>   Thread calibration: mean lat.: 696.276ms, rate sampling interval:
>>> 2562ms
>>>   Thread Stats   Avg  Stdev Max   +/- Stdev
>>> Latency28.14s18.49s1.32m61.39%
>>> Req/Sec46.78k 3.23k   51.52k52.63%
>>>   28079997 requests in 5.00m, 4.02GB read
>>> Requests/sec:  93600.05
>>> Transfer/sec: 13.74MB
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Am Montag, 12. September 2016 14:52:48 UTC+2 schrieb √:
>>>>
>>>> What does wrk2 say?
>>>>
>>>> On Mon, Sep 12, 2016 at 2:37 PM, Christian Schmitt <
>>>> c.sc...@briefdomain.de> wrote:
>>>>
>>>>> I just compared Playframework on Netty vs Akka-http guess thats fair
>>>>> since play is quite high level.
>>>>>
>>>>> Performance for 2k, 20k, 120k Req/s (2k was used to warmup the VM):
>>>>> https://gist.github.com/schmitch/2ca3359bc34560c6063d0b00eb0a7aac
>>>>> Projects: https://github.com/schmitch/performance (akka-http is just
>>>>> his project + @volatile on the var)
>>>>>
>>>>> Am Montag, 12. September 2016 13:04:29 UTC+2 schrieb Konrad Malawski:
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Konrad `ktoso` Malawski
>>>>>> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>>>>>>
>>>>>> On 12 September 2016 at 12:56:46, Christian Schmitt (
>>>>>> c.sc...@briefdomain.de) wrote:
>>>>>>
>>>>>> actually wouldn't it be more reasonable to try it against netty?
>>>>>>
>>>>>> Yes and no. Then one should compare raw IO APIs, and none of the
>>>>>> high-level features Akka HTTP provides (routing, trivial back-pressured
>>>>>> entity streaming, fully typesafe http model) etc

Re: [akka-user] Enjoying Akka HTTP performance

2016-09-12 Thread Konrad Malawski
-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 12 September 2016 at 12:56:46, Christian Schmitt (
c.schm...@briefdomain.de) wrote:

actually wouldn't it be more reasonable to try it against netty?

Yes and no. Then one should compare raw IO APIs, and none of the high-level
features Akka HTTP provides (routing, trivial back-pressured entity
streaming, fully typesafe http model) etc.

It's a fun experiment to see how much faster Netty is, but I don't think
it's the goal here – if you really want to write each and every
microservice with raw Netty APIs–enjoy, but I don't think that's the nicest
API to just bang out a service in 4 minutes :)

(Note, much love for Netty here, but I don't think comparing 1:1 with Akka
HTTP here is the right way to look at it (yes, of course we'll be slower
;-)).


I mean that node is slower than akka-http isn't something I wonder about.

You'd be surprised what node people claim about its performance ;-)

Am Montag, 12. September 2016 12:12:29 UTC+2 schrieb Konrad Malawski:
>
> Hi Adam,
> thanks for sharing the runs!
> Your benchmarking method is good - thanks for doing a proper warmup and
> using wrk2 :-)
> Notice that the multiple second response times in node basically mean it's
> not keeping up and stalling the connections (also known as coordinated
> emission).
>
> It's great to see such side by side with node, thanks for sharing it again.
> Happy hakking!
>
> On Mon, Sep 12, 2016 at 10:33 AM, Adam <adam...@gmail.com >
> wrote:
>
>> Hi,
>>
>> I'd just like to share my satisfaction from Akka HTTP performance in
>> 2.4.10.
>> I'm diagnosing some low level Node.js performance issues and while
>> running various tests that only require the most basic "Hello World" style
>> code, I decided to take a few minutes to check how would Akka HTTP handle
>> the same work.
>> I was quite impressed with the results, so I thought I'd share.
>>
>> I'm running two c4.large instances (so two cores on each instance) - one
>> running the HTTP service and another running wrk2.
>> I've tested only two short sets (seeing as I have other work to do):
>>
>>1. use 2 threads to simulate 100 concurrent users pushing 2k
>>requests/sec for 5 minutes
>>2. use 2 threads to simulate 100 concurrent users pushing 20k
>>requests/sec for 5 minutes
>>
>> In both cases, the tests are actually executed twice without a restart in
>> between and I throw away the results of the first run.
>>
>> The first run is just to get JIT and other adaptive mechanisms to do
>> their thing.
>>
>> 5 minutes seems to be enough based on the CPU behavior I see, but for a
>> more "official" test I'd probably use something longer.
>>
>>
>> As for the code, I was using vanilla Node code - the kind you see as the
>> most basic example (no web frameworks or anything) but for Akka, I used the
>> high level DSL.
>>
>>
>> Here's the Code:
>>
>>
>> *Akka HTTP*
>>
>>
>> package com.example.rest
>>
>> import akka.actor.ActorSystem
>> import akka.http.scaladsl.Http
>> import akka.http.scaladsl.server.Directives._
>> import akka.stream.ActorMaterializer
>>
>>
>> case class Reply(message: String = "Hello World", userCount: Int)
>>
>> object MyJsonProtocol
>>   extends akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
>> with spray.json.DefaultJsonProtocol {
>>
>>   implicit val replyFormat = jsonFormat2(Reply.apply)
>> }
>>
>> object FullWebServer {
>>   var userCount = 0;
>>
>>   def getReply() = {
>> userCount += 1
>> Reply(userCount=userCount)
>>   }
>>
>>   def main(args: Array[String]) {
>> implicit val system = ActorSystem()
>> implicit val materializer = ActorMaterializer()
>> import MyJsonProtocol._
>>
>> val route =
>>   get {
>> complete(getReply())
>>   }
>>
>> // `route` will be implicitly converted to `Flow` using 
>> `RouteResult.route2HandlerFlow`
>> val bindingFuture = Http().bindAndHandle(route, "0.0.0.0", 3000)
>> println("Server online at http://127.0.0.1:3000/;)
>>   }
>> }
>>
>>
>> *Node*
>>
>> var http = require('http');
>>
>> let userCount = 0;
>> var server = http.createServer(function (request, response) {
>> userCount++;
>> response.writeHead(200, {"Content-Type": "application/json"});
>> const hello = {msg: "Hello 

Re: [akka-user] Enjoying Akka HTTP performance

2016-09-12 Thread Konrad Malawski
Hi Adam,
thanks for sharing the runs!
Your benchmarking method is good - thanks for doing a proper warmup and
using wrk2 :-)
Notice that the multiple second response times in node basically mean it's
not keeping up and stalling the connections (also known as coordinated
emission).

It's great to see such side by side with node, thanks for sharing it again.
Happy hakking!

On Mon, Sep 12, 2016 at 10:33 AM, Adam  wrote:

> Hi,
>
> I'd just like to share my satisfaction from Akka HTTP performance in
> 2.4.10.
> I'm diagnosing some low level Node.js performance issues and while running
> various tests that only require the most basic "Hello World" style code, I
> decided to take a few minutes to check how would Akka HTTP handle the same
> work.
> I was quite impressed with the results, so I thought I'd share.
>
> I'm running two c4.large instances (so two cores on each instance) - one
> running the HTTP service and another running wrk2.
> I've tested only two short sets (seeing as I have other work to do):
>
>1. use 2 threads to simulate 100 concurrent users pushing 2k
>requests/sec for 5 minutes
>2. use 2 threads to simulate 100 concurrent users pushing 20k
>requests/sec for 5 minutes
>
> In both cases, the tests are actually executed twice without a restart in
> between and I throw away the results of the first run.
>
> The first run is just to get JIT and other adaptive mechanisms to do their
> thing.
>
> 5 minutes seems to be enough based on the CPU behavior I see, but for a
> more "official" test I'd probably use something longer.
>
>
> As for the code, I was using vanilla Node code - the kind you see as the
> most basic example (no web frameworks or anything) but for Akka, I used the
> high level DSL.
>
>
> Here's the Code:
>
>
> *Akka HTTP*
>
>
> package com.example.rest
>
> import akka.actor.ActorSystem
> import akka.http.scaladsl.Http
> import akka.http.scaladsl.server.Directives._
> import akka.stream.ActorMaterializer
>
>
> case class Reply(message: String = "Hello World", userCount: Int)
>
> object MyJsonProtocol
>   extends akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
> with spray.json.DefaultJsonProtocol {
>
>   implicit val replyFormat = jsonFormat2(Reply.apply)
> }
>
> object FullWebServer {
>   var userCount = 0;
>
>   def getReply() = {
> userCount += 1
> Reply(userCount=userCount)
>   }
>
>   def main(args: Array[String]) {
> implicit val system = ActorSystem()
> implicit val materializer = ActorMaterializer()
> import MyJsonProtocol._
>
> val route =
>   get {
> complete(getReply())
>   }
>
> // `route` will be implicitly converted to `Flow` using 
> `RouteResult.route2HandlerFlow`
> val bindingFuture = Http().bindAndHandle(route, "0.0.0.0", 3000)
> println("Server online at http://127.0.0.1:3000/;)
>   }
> }
>
>
> *Node*
>
> var http = require('http');
>
> let userCount = 0;
> var server = http.createServer(function (request, response) {
> userCount++;
> response.writeHead(200, {"Content-Type": "application/json"});
> const hello = {msg: "Hello world", userCount: userCount};
> response.end(JSON.stringify(hello));
> });
>
> server.listen(3000);
>
> console.log("Server running at http://127.0.0.1:3000/;);
>
> (to be more exact there's also some wrapping code because I'm running this in 
> a cluster so all cores can be utilized)
>
>
> So for the first test, things are pretty much the same - Akka HTTP uses
> less CPU (4-6% vs. 10% in Node) and has a slightly lower average response
> time, but a higher max response time.
>
> Not very interesting.
>
>
> The second test was more one sided though.
>
>
> The Node version maxed out the CPU and got the following results:
>
>
> Running 5m test @ http://srv-02:3000/
>   2 threads and 100 connections
>   Thread calibration: mean lat.: 215.794ms, rate sampling interval: 1623ms
>   Thread calibration: mean lat.: 366.732ms, rate sampling interval: 1959ms
>   Thread Stats   Avg  Stdev Max   +/- Stdev
> Latency 5.31s 4.48s   16.66s65.79%
> Req/Sec 9.70k 0.87k   10.86k57.85%
>   5806492 requests in 5.00m, 1.01GB read
> Requests/sec:  19354.95
> Transfer/sec:  3.43MB
>
>
> Whereas for the Akka HTTP version I saw each core using ~40% CPU
> throughout the test and I had the following results:
>
> Running 5m test @ http://srv-02:3000/
>   2 threads and 100 connections
>   Thread calibration: mean lat.: 5.044ms, rate sampling interval: 10ms
>   Thread calibration: mean lat.: 5.308ms, rate sampling interval: 10ms
>   Thread Stats   Avg  Stdev Max   +/- Stdev
> Latency 1.83ms1.27ms  78.91ms   95.96%
> Req/Sec10.55k 1.79k   28.22k75.98%
>   5997552 requests in 5.00m, 1.00GB read
> Requests/sec:  19991.72
> Transfer/sec:  3.41MB
>
>
> Which is not a huge increase over 2K requests/sec:
>
>
> Running 5m test @ http://srv-02:3000/
>   2 threads and 100 connections
>   

Re: [akka-user] Configuration of SerializationBindings Programmatically?

2016-09-09 Thread Konrad Malawski
parseMap +1

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 9 September 2016 at 22:10:33, Viktor Klang (viktor.kl...@gmail.com)
wrote:

ConfigFactory.parseMap?

--
Cheers,
√

On Sep 9, 2016 22:01, "kraythe"  wrote:

> Yeah, that much I know. However, I have a map of Class -> id in code and I
> want to create serialization bindings to this serializer for each of the
> types in that map's key set and assign type ids based on the map. What I am
> trying to do is figure out how to create the ConfigValue object
> programmatically to accomplish that.
>
> Thanks.
>
> On Friday, September 9, 2016 at 2:55:32 PM UTC-5, √ wrote:
>>
>> The ActorSystem takes an optional Config when created[1], create that
>> Config object programmatically and do 
>> withFallback(ConfigFactory.load(classloader))
>>
>>
>>
>> [1]: https://github.com/akka/akka/blob/master/akka-actor/src
>> /main/scala/akka/actor/ActorSystem.scala#L141
>>
>> On Fri, Sep 9, 2016 at 9:49 PM, kraythe  wrote:
>>
>>> I am using Akka-kryo by Roman Levenshtein
>>>  as recommended on
>>> the akka serialization page. I know all about Kryo and have used it many
>>> times before. I can integrate it with manual config and it works fine.
>>> Thats not my point. I want to configure the bindings programatically.
>>>
>>> On Friday, September 9, 2016 at 2:44:42 PM UTC-5, Justin du coeur wrote:

 Don't have an answer off the cuff -- the answer probably depends on the
 Kryo plugin that you're using.  My recommendation is to take a dig through 
 the
 akka-kryo-serialization source code
 , particularly the
 KryoSerializer class
 .
 I learned a huge amount by going through that with the Kryo
 documentation  and Javadocs
 
  open;
 it's not horribly complex, and the process of figuring out how it works
 teaches pretty much everything critical about using Kryo with Akka...

 On Fri, Sep 9, 2016 at 3:29 PM, kraythe  wrote:

> Greetings,
>
> In reference to the configuration of serialization bindings I would
> like to do this programatically instead of using the config file. I have a
> type with a static map of types and binding ids based on a Kryo plugin to
> Akka. What I would like to do is create bindings based on that type and
> configure the system accordingly. Does anyone have any example code of how
> this can be done assuming I have access to the config object already? I
> know I can use the default config.with("serialization-bindings".
> value) but I don't know the proper way to construct that value and avoid
> overwriting anything default in the config. The documentation I have read
> is not explanatory on this. http://doc.akka.io/docs/
> akka/snapshot/scala/serialization.html
>
> Thanks a bunch.
> --
> >> 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/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.
>>>
>>
>>
>>
>> --
>> 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
> 

Re: [akka-user] Any form of first-try / first-peek at Artery Akka remoting ?

2016-09-08 Thread Konrad Malawski
Yes we're working on it.
Yes there's releases, just use them ;-)

See 2.4-ARTERY versions:
http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.typesafe.akka%22%20AND%20a%3A%22akka-remote_2.11%22

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 8 September 2016 at 10:29:26, Muthukumaran Kothandaraman (
muthu.kmk2...@gmail.com) wrote:

Hi,

Is Artery still a work in progress or any snapshots are available for
trying out ?

Regards
Muthu

--
>> 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 HTTP performance in 2.4.9

2016-09-06 Thread Konrad Malawski
Without looking at the code, two things to fix right away in your
methodology:

1) You're running `ab` without persistent connections (also known as
"useless mode").
Please run: `ab -k` to use keep-alive connections, which is what all http
clients and browsers do.

2) Please do not benchmark using the same host for running the app and load
generator...
You're stealing resources from the http server as you're load generator is
trying to hit it as hard as it can, and the other way around.
The benchmark will be completely skewed by that.

ab is also not very good in general, use wrk instead - a more modern load
generator.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 6 September 2016 at 16:34:22, Adam (adamho...@gmail.com) wrote:

Hi,

I've previously seen bad performance form Akka HTTP for a simple ping/pong
scenario (which I realize according to the release notes is still a
relatively bad scenario for Akka HTTP), but the results I'm getting are bad
enough that I'm wondering if my test is even valid.

Here's my code:

package com.example.rest

import akka.NotUsed
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.model._
import akka.stream.scaladsl.{Flow, Keep, RunnableGraph, Sink, Source}
import akka.stream.{ActorMaterializer, ActorMaterializerSettings, Fusing}

import scala.concurrent.Future
import scala.io.StdIn

object WebServer extends App {
  implicit val system = ActorSystem()
  implicit val materializer =
ActorMaterializer(ActorMaterializerSettings(system).withAutoFusing(false))
  implicit val executionContext = system.dispatcher

  val response = HttpResponse(entity =
HttpEntity(ContentTypes.`text/plain(UTF-8)`,"Ok"))
  val requestHandler: HttpRequest => HttpResponse = {
case _ => response
  }

  val flow: Flow[HttpRequest, HttpResponse, NotUsed] =
Flow[HttpRequest] map requestHandler
  val prefused = Fusing.aggressive(flow)
  val httpHandler: Flow[HttpRequest, HttpResponse, NotUsed] =
Flow.fromGraph(prefused)

  if (args(0) == "http"){
runHttpServer()
  } else {
runPingPong(args(1).toInt)
  }

  def runHttpServer() = {
val bindingFuture = Http().bindAndHandle(handler = httpHandler,
interface = "127.0.0.1  ", port = 3000)

println("Type RETURN to exit")
StdIn.readLine()

bindingFuture
  .flatMap(_.unbind()) // trigger unbinding from the port
  .onComplete(_ => system.terminate())
  }

  def runPingPong(times: Int) = {
val ping = HttpRequest().withUri(Uri("/"))

val graph: RunnableGraph[Future[Int]] = Source(1 to times)
  .map(_ => ping)
  .via(httpHandler)
  .map(_ => 1)
  .toMat(Sink.fold[Int, Int](0)((a, b) => a + 1))(Keep.right)

val startTime = System.nanoTime()
val count: Future[Int] = graph.run()

count.onComplete(res => {
  if (res.isFailure) {
Console.err.println(s"failed with: ${res.failed}")
  } else {
println(s"ran for ${res.get} times")
val et = System.nanoTime() - startTime
val etMillis = et / 100.0
println(s"et: ${etMillis}ms")
  }
  system.terminate()
})
  }
}

The in memory scenario (runPingPong) yields the following results on
my local windows machine:

ran for 10 times
et: 322.150515ms


Running ab to test actual local HTTP calls get me this:

ab -c 400 -n 10 -m GET http://127.0.0.1:3000/

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1 requests
Completed 2 requests
Completed 3 requests
Completed 4 requests
Completed 5 requests
Completed 6 requests
Completed 7 requests
Completed 8 requests
Completed 9 requests
Completed 10 requests
Finished 10 requests


Server Software:akka-http/2.4.9
Server Hostname:127.0.0.1
Server Port:3000

Document Path:  /
Document Length:2 bytes

Concurrency Level:  400
Time taken for tests:   139.083 seconds
Complete requests:  10
Failed requests:0
Total transferred:  1620 bytes
HTML transferred:   20 bytes
Requests per second:719.00 [#/sec] (mean)
Time per request:   556.332 [ms] (mean)
Time per request:   1.391 [ms] (mean, across all concurrent requests)
Transfer rate:  113.75 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:01  24.7  0 593
Processing:13  552 394.65622144
Waiting:2  388 347.15261583
Total: 13  554 395.25622144

Percentage of the requests served within a certain time (ms)
  50%562
  66%586
  75%639
  80%   1047
  90%   1065
  95%   1096
  98%   1560
  99%   1574
 100%   2144 (longest request)


I was able to use the same approach with other frameworks (e.g. Play 

Re: [akka-user] akka serialization - message boundary

2016-09-06 Thread Konrad Malawski
This document talks about serialization in the context of persistence, but
many of the patterns are the same for remoting:
http://doc.akka.io/docs/akka/snapshot/scala/persistence-schema-evolution.html


-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 6 September 2016 at 08:33:36, Viktor Klang (viktor.kl...@gmail.com)
wrote:

Akka encloses the binary data in an envelope to track message size. It is
recommended to send small messages for the same reason it is recommended to
to send huge packets through normal post boxes. :-)

--
Cheers,
√

On Sep 6, 2016 08:00, "Wei"  wrote:

> Hello,
>
> I am trying to write a custom serializer in akka. While deriving from the
> Serializer trait and implementing the fromBinary(byte, clazz) methods, I
> started to think of a questions: does the byte given to this method always
> one whole message? Could it be partial or multiple message in the byte? In
> other words, how does akka determine message boundary when getting the byte
> from the network stream?
>
> Thanks a lot.
>
> --
> >> 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.

-- 
>>  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 serialization - message boundary

2016-09-06 Thread Konrad Malawski
Hi there,
not quite. If you use java serialization of X that contains Y things, then
Java serialization serializes the entire thing.
For example, if you serialized a List using java serialization, it also
will serialize the things inside the list - that's how it works.

Akka always wraps your serialized message in a binary (protobuf serialized
nowadays) envelope, the envelope contains your message,
serialized using whichever serializer was configured for it.

So with the List + Java example you'll end up with a java serialized list
of java serialized items, within an akka envelope.

Tips:
a) Don't send around raw lists anyway, define proper message types - it's
your message protocol, take good care of it.
b) Define a good serializer for your messages. You can start out with
akka-kryo-serialization, it's simple to set up, pretty fast etc.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 6 September 2016 at 08:33:36, Viktor Klang (viktor.kl...@gmail.com)
wrote:

Akka encloses the binary data in an envelope to track message size. It is
recommended to send small messages for the same reason it is recommended to
to send huge packets through normal post boxes. :-)

--
Cheers,
√

On Sep 6, 2016 08:00, "Wei"  wrote:

> Hello,
>
> I am trying to write a custom serializer in akka. While deriving from the
> Serializer trait and implementing the fromBinary(byte, clazz) methods, I
> started to think of a questions: does the byte given to this method always
> one whole message? Could it be partial or multiple message in the byte? In
> other words, how does akka determine message boundary when getting the byte
> from the network stream?
>
> Thanks a lot.
>
> --
> >> 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.

-- 
>>  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 Multithreading on Akka-Cluster

2016-09-05 Thread Konrad Malawski
This is not really enough information to say where or what the bottlenecks
are. If you need a full architecture overview that's a commercial thing we
can offer.

Having that said, you did not mention what HTTP server you're using.
Actors are simply multiplexed onto threads, so if you're doing blocking in
your actors you'll end up blocking the entire system - this could be one of
the reasons you're seeing bad perf and no parallelism.
Another reason could be that you do all inside one actor or synchronously
in a thread, creating a bottleneck.

Please explain a bit more on your setup and we could provide some more
helpful hints.

Please also refer to the documentation when in doubt :)

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 5 September 2016 at 11:22:26, silvio poma (silviopom...@gmail.com) wrote:

Hi All,
Working on a project for a big client that want to switch from a monolithic
infrastructure to a microservice one we are getting stuck in a big doubt.
We are making an infrastructure where each microservice are deployed in a
different container on an ECS instance, than we have the first microservice
that receive a message from the client via HTTP and this message triggers
all the actors that start to send message one to each others.
We've created an Akka-Cluster and each microservice is a node of the
cluster. Every Actor send a message to a Router
(cluster-metrics-adaptive-group) that has his  routees.paths that points to
the specific node.
Testing the performances of our system we realize that everything is too
slow and there is not any multithreading.
How does multithreading work? Is our infrastructure too complex? Is there
any best-practice we can implement to improve our system?
Thanks all!
Silvio

--
>> 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] ANNOUNCE: Akka Community Survey 2016

2016-09-02 Thread Konrad Malawski
Dear hakkers,

we did a lot this year already. We merged Akka Streams and HTTP into the
2.4 series of Akka, pushed 16 releases of Akka itself, and maintained the
various Persistence plugins. We also reached out to create even more
community collaboration with projects related to Kafka, and now are eagerly
awaiting codename Alpakka (the various Akka Streams connectors to many
different technologies) to take shape and form - all driven by you, the
community. We also started this blog, as we wanted to get more in touch
with you, on a different level than though raw documentation of Akka–we
want to have an ongoing conversation with you.

We want to share more technical details with you and introduce you to the
latest happenings. We also started to recognize our most active members of
our community by giving out special “happy hakking” t-shirts are unique and
you can’t get them anyway else other than becoming a valuable part of our
Akka community. These were actually a surprise to many of our contributors,
and also, for us, a way to say*thanks* for all the amazing work these
contributors and community as a whole have been doing. But this shouldn’t
be the last thing we do this year–in fact, we’re only getting started.

Today, we’d like to announce the “Akka Community Survey 2016”! Its goal is,
to make sure to give you, our community, a voice. Of course we’re always
on-line and listening to your feedback on the various mailing lists, chats
and twitter, however the form of a survey should help us to set direction
and see what your thoughts are in a more structured fashion. We compiled a
list of questions which will help us to identify missing bits and pieces
but also understand better how you are using Akka.

It asks about module usage, your favorite language for Akka, areas of
improvements and will take you probably just a short 5 or 10 minutes. We
keep it open for a 2 weeks (until September 16th, 2016), and hope to be
able to provide you with a nice summary of the results after that.

So, if you have some time to spare and would like to have an impact of
Akka’s future:

*Take the Akka Community Survey 2016
*

Aditionally, as a little motivation, we’ll be raffling away *100 Akka
t-shirts* among the respondents of the survey. Every response who enters
the raffle has a chance to win one. The only prerequisite is, that you give
us your email address at the end of the survey. You can take this survey
anonymously if you don’t want to participate in the raffle. Winners will be
notified within two weeks after we closed the survey.

[image: Win an Akka T-Shirt]
(see more Lightbend swag
)

We’re looking forward to your responses. So take the survey
, and spread
the word!

*happy hakking!*

-- 
Cheers,
Markus Eisele & Akka Team

-- 
>>  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] Problem Configuring ActorSystem

2016-09-01 Thread Konrad Malawski
You can also just set the provider to "remote" (or "cluster").
It's a bit simpler to not make a typo in those ;)

On Thu, Sep 1, 2016 at 6:14 AM, Viktor Klang  wrote:

> there's a comma in the class name
>
> --
> Cheers,
> √
>
> On Sep 1, 2016 5:11 AM, "Joseph Mansigian" 
> wrote:
>
>> I am using Akka with Scala and want to configure an ActorSystem for
>> remote messaging ( but does not need to be remotely configurable ).  The
>> problem I am having is that I am getting a Class Not Found exception for
>> akka,remote.RemoteActorRefProvider when I run the code.  I've double
>> checked all of the usual suspects, the appropriate jar on the compile,  the
>> appropriate jar on the run.  Imports are all Ok as far as I can tell.  I am
>> using scala 2.11.8 with akka 2,4,9 and Java 8 is installed but no Java
>> coding
>>
>> I have read some old posts ( not here ) about Scala placing a version of
>> Akka in its scala/lib and that this version of Akka comes into conflict
>> with the other Akka.
>>
>> Does anyone have any insight into this?  Your help would be much
>> appreciated.
>>
>> thanks, joe
>>
>> --
>> >> 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/
> 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,
Konrad 'ktoso' Malawski
Akka  @ Lightbend 

-- 
>>  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] MalformedRequestContentRejection - typed error messages

2016-08-28 Thread Konrad Malawski
Hi Tim,
I'm sorry but I don't quite get what you're after here?
Since you never know where your handler will be used, there is no way to
have it strictly typed.
The exception handler should match on the type you're expecting and then do
stuff with it.

HTH

On Thu, Aug 18, 2016 at 5:48 PM, Tim Pigden  wrote:

> Hi
> I have custom unmarshaller
>
> I handle the output with
>
> case MalformedRequestContentRejection(msg, causeOpt)
>
> ...
>
>
> msg is a string
>
> causeOpt is an Option[Throwable]
>
>
> I want to pass typed data to this rejection handler.
>
> If I could throw a typed exception somehow, I could match on causeOpt
>
> But causeOpt is always None
>
>
> So is there a way to pass typed data through to the Rejection message?
>
>
> --
> >> 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,
Konrad 'ktoso' Malawski
Akka  @ Lightbend 

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

2016-08-28 Thread Konrad Malawski
What Akka version are you on?

We have a similar issue reported but in a slightly different place...
https://github.com/akka/akka/issues/19981

What is the server responding with specifically?
I'd be very suprised if on a normal usual response we fail toStricting()
this is used by all tools, including some at Lightbend so that would have
come up already hm..


On Tue, Aug 16, 2016 at 1:08 AM, Sarah Yin 
wrote:

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



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

-- 
>>  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] Delay within GraphStageLogic

2016-08-26 Thread Konrad Malawski
Hi there,
you'd extend TimerGraphStageLogic instead and call scheduleOnce
or schedulePeriodicallyWithInitialDelay.
The timer will call your onTimer method then.

This is all documented here:
http://doc.akka.io/docs/akka/2.4.9/scala/stream/stream-customize.html#Using_timers
Please read all the GraphStage docs to get a feel for it :-)

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 26 August 2016 at 07:28:50, Gary Struthers (agilej...@earthlink.net)
wrote:

Hi,

I'm handling exceptions in a custom GraphStage, with some exceptions I want
to retry after a delay. Is there a preferred way to do this? Do I just call
Thread.sleep?

Gary
--
>> 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-stream] Multi input/output flow

2016-08-25 Thread Konrad Malawski
Just replace the /scala/ in the url to /java/ :-)

So it becomes:
http://doc.akka.io/docs/akka/2.4.9/java/stream/stream-graphs.html

All Akka APIs have 100% coverage in both languages / DSLs.

The Java / Scala API for GraphStage is exactly the same class btw, so you
can read any blogs etc about it and won't even really notice it's Scala :-)
-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 25 August 2016 at 20:31:33, Sergey Sopin (sopin1...@gmail.com) wrote:

Thanks a lot! It is exactly what I need, but can I do the same in Java?

Regards,
Sergey

четверг, 25 августа 2016 г., 21:16:44 UTC+3 пользователь Konrad Malawski
написал:
>
> If it has more than 1 input and 1 output it's not a Flow anymore, so let's
> not refer to it as a Flow.
> It's a Graph of a given Shape.
>
> There's nothing special about Shape, so if you want a custom one, you
> simply extend Shape, as is documented in the reference docs:
> http://doc.akka.io/docs/akka/2.4.9/scala/stream/stream-
> graphs.html#building-reusable-graph-components
>
> Notice that it's still fully typesafe for users of the shape!
>
> --
> Konrad `ktoso` Malawski
> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>
> On 25 August 2016 at 20:07:02, Sergey Sopin (sopi...@gmail.com
> ) wrote:
>
> Thanks a lot for your response.
>
> However it is still not clear.
> I am talking about FlowShape with several Inlets and Outlets. As I
> understood from: http://doc.akka.io/docs/akka/2.4/java/stream/stream-
> customize.html#Custom_linear_processing_stages_using_GraphStage
> I have to create Shape by myself as a pair of Inlet and Outlet, but in my
> case I either need to create all possible combinations of Inlets & Outlets
> and return one of them from the function
>   @Override
>   public SourceShape shape() {
> return shape;
>   }
> or invent something new.
>
> First option will not work in my case, so I need something new here.
>
> Could you please tell me how to create such multi inlet/outlet shape? Or
> please explain me if I don't understand something.
> Thanks a lot!
>
>
> четверг, 25 августа 2016 г., 17:50:00 UTC+3 пользователь Konrad Malawski
> написал:
>>
>> Handlers have no shape. The GraphStage does.
>>
>> So your stage has some shape.
>>
>> And then you set as many handlers as you need.
>>
>> Still simple sources and sinks, but we just published a blog post
>> explaining it a bit more: http://blog.akka.io/integrations/2016/08/25/
>> simple-sink-source-with-graphstage
>>
>> --
>> Konrad `ktoso` Malawski
>> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>>
>> On 25 August 2016 at 15:55:14, Sergey Sopin (sopi...@gmail.com) wrote:
>>
>> Hi,
>>
>> I am trying to create multi input/output flow. It should obtain messages
>> from different Inlets and emit to different Outlets based on parameter
>> inside the message.
>>
>> Something like following:
>>
>>1. ...
>>A elem = grab(in1);
>>2.if (p.test(elem)) {
>>3.  push(out1, elem);
>>4.} else {
>>5.  push(out2, elem);
>>6.}
>>...
>>
>>
>> But, usual case is when I am creating shape and setting handler for it.
>> It seems that in my case I need different shapes inside one handler.
>>
>> Thanks a lot!
>>
>> Regards,
>> Sergey
>>
>>
>> --
>> >>>>>>>>>> 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 

Re: [akka-user] [akka-stream] Multi input/output flow

2016-08-25 Thread Konrad Malawski
If it has more than 1 input and 1 output it's not a Flow anymore, so let's
not refer to it as a Flow.
It's a Graph of a given Shape.

There's nothing special about Shape, so if you want a custom one, you
simply extend Shape, as is documented in the reference docs:
http://doc.akka.io/docs/akka/2.4.9/scala/stream/stream-graphs.html#building-reusable-graph-components


Notice that it's still fully typesafe for users of the shape!

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 25 August 2016 at 20:07:02, Sergey Sopin (sopin1...@gmail.com) wrote:

Thanks a lot for your response.

However it is still not clear.
I am talking about FlowShape with several Inlets and Outlets. As I
understood from:
http://doc.akka.io/docs/akka/2.4/java/stream/stream-customize.html#Custom_linear_processing_stages_using_GraphStage
I have to create Shape by myself as a pair of Inlet and Outlet, but in my
case I either need to create all possible combinations of Inlets & Outlets
and return one of them from the function
  @Override
  public SourceShape shape() {
return shape;
  }
or invent something new.

First option will not work in my case, so I need something new here.

Could you please tell me how to create such multi inlet/outlet shape? Or
please explain me if I don't understand something.
Thanks a lot!


четверг, 25 августа 2016 г., 17:50:00 UTC+3 пользователь Konrad Malawski
написал:
>
> Handlers have no shape. The GraphStage does.
>
> So your stage has some shape.
>
> And then you set as many handlers as you need.
>
> Still simple sources and sinks, but we just published a blog post
> explaining it a bit more: http://blog.akka.io/integrations/2016/08/25/
> simple-sink-source-with-graphstage
>
> --
> Konrad `ktoso` Malawski
> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>
> On 25 August 2016 at 15:55:14, Sergey Sopin (sopi...@gmail.com
> ) wrote:
>
> Hi,
>
> I am trying to create multi input/output flow. It should obtain messages
> from different Inlets and emit to different Outlets based on parameter
> inside the message.
>
> Something like following:
>
>1. ...
>A elem = grab(in1);
>2.if (p.test(elem)) {
>3.  push(out1, elem);
>4.} else {
>5.  push(out2, elem);
>6.}
>...
>
>
> But, usual case is when I am creating shape and setting handler for it. It
> seems that in my case I need different shapes inside one handler.
>
> Thanks a lot!
>
> Regards,
> Sergey
>
>
> --
> >>>>>>>>>> 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-stream] Multi input/output flow

2016-08-25 Thread Konrad Malawski
Handlers have no shape. The GraphStage does.

So your stage has some shape.

And then you set as many handlers as you need.

Still simple sources and sinks, but we just published a blog post
explaining it a bit more:
http://blog.akka.io/integrations/2016/08/25/simple-sink-source-with-graphstage

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 25 August 2016 at 15:55:14, Sergey Sopin (sopin1...@gmail.com) wrote:

Hi,

I am trying to create multi input/output flow. It should obtain messages
from different Inlets and emit to different Outlets based on parameter
inside the message.

Something like following:

   1. ...
   A elem = grab(in1);
   2.if (p.test(elem)) {
   3.  push(out1, elem);
   4.} else {
   5.  push(out2, elem);
   6.}
   ...


But, usual case is when I am creating shape and setting handler for it. It
seems that in my case I need different shapes inside one handler.

Thanks a lot!

Regards,
Sergey


--
>> 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 based java web application deployment in Websphere 7

2016-08-22 Thread Konrad Malawski
Hi there,
As Akka is "just" a library, you should be able to run it in a websphere
container.

You should use the latest Akka 2.3.x, since 2.4.x requires JDK8.
If you're unable to upgrade the JDK, I think IBM may not yet have JDK8
right?
Then 2.3 series is your best bet.

If you intend to run this in production, then I would recommend a Lightbend
subscription,
Because 2.3 is not really getting any development unless critical issues.
Being a subscriber
You can count on some more help, from us, even though technically 2.3 has
been end-of-life already for a while if I remember correctly.

I'd like to just mention that this isn't really the optimal way, but I
understand it may be a situation of
"Either in websphere, or not at all". If able to, Akka deployed standalone
as runnable jar is the preferred way, as it's the most lightweight.


Hope this helps, happy hakking.

-- 
Konrad Malawski
Akka @ Lightbend


From: yayati.t...@gmail.com <yayati.t...@gmail.com> <yayati.t...@gmail.com>
Reply: akka-user@googlegroups.com <akka-user@googlegroups.com>
<akka-user@googlegroups.com>
Date: 23 August 2016 at 03:17:35
To: Akka User List <akka-user@googlegroups.com> <akka-user@googlegroups.com>
Subject:  [akka-user] Akka based java web application deployment in
Websphere 7

I have web application with following technologies, trying to figure out
> best version compatible with Websphere 7.0
>
> - Java 1.6
> - Akka 2.3.15
> - camel-netty4-http 2.17.2
>
> Has anyone deployed akka application in Websphere 7?
>
> Thanks, Yayati
>
> --
> >>>>>>>>>> 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] Issue with default query parameters and custom unmarshalling

2016-08-22 Thread Konrad Malawski
Hmm... it could be.
Quick question – do you perhaps have the ask pattern imported in this file?

It could cause ambiguity with the ? from ask I just thought.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 22 August 2016 at 18:26:01, andrew.me...@bottlerocketstudios.com (
andrew.me...@bottlerocketstudios.com) wrote:

I recently came across an issue when I had used `parameters(…)` with custom
unmarshalling and a default value. I found that
`parameters(“foo”.as[MyType] ?)` compiles, but the following did not:
`parameters(“foo”.as[MyType] ? MyType.default)`. The compiler says that
there are "too many parameters for method 'parameters(...' The only thing
that seemed to compile was placing a string on the right side of the `?`
instead of a concrete type. This took me about two hours to figure out
because it was not apparent in the documentation:
http://doc.akka.io/docs/akka/2.4/scala/http/routing-dsl/directives/parameter-directives/parameters.html



Note, knowing that `parameters(“foo” ? 0)` works for an Int, I tried the
following to no avail, thinking that the type could be inferred correctly
and unmarshalled: `parameters(“foo” ? MyType.default)`.



I would suggest an update to the referenced documentation to give an
example for using a default value while using a custom unmarshaller. Any
enlightenment on the reason for this, or if I am missing something, would
be super helpful! 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.

-- 
>>  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 Graph Editor tool

2016-08-22 Thread Konrad Malawski
Sorry, I haven't been using Windows since years hm.

I know Endre used raw Inkscape to do some of our drawings for our docs.


-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 22 August 2016 at 13:14:17, Sergey Sopin (sopin1...@gmail.com) wrote:

Hi again,

Omnigraffle is very good program, but I use Windows :(
Can you recommend something for it?

Thanks!

Regards,
Sergey

воскресенье, 17 июля 2016 г., 16:05:59 UTC+3 пользователь Konrad Malawski
написал:
>
> You may enjoy these Omnigraffle stencils: https://www.
> graffletopia.com/stencils/1493 by Derek Wyatt
>
> --
> Konrad `ktoso` Malawski
> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>
> On 16 July 2016 at 17:44:18, Sergey Sopin (sopi...@gmail.com )
> wrote:
>
> Hi,
>
> Is there any tool which allows to draw graphs as they were shown in akka
> docs? I mean that allows using the same blocks and elements.
>
> Thanks a lot!
>
> Best regards,
> Sergey
> --
> >>>>>>>>>> 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-HTTP] How do I drop the connection from the Server?

2016-08-19 Thread Konrad Malawski
FYI for readers of this thread:

We chatted this over on twitter
https://twitter.com/derekwyatt/status/766652868052918272
In general it is not legal HTTP to not send a response code,
so the typical proper way is to Connection: close and a 500 response code
I'd say.

The really killing a connection could be a power user feature indeed.

On Thu, Aug 18, 2016 at 2:11 PM, Derek Wyatt  wrote:

> Hi guys,
>
> A client connects, and I don't like him.  I don't want to respond to him
> at all; I just want to disconnect him entirely.
>
> I'm using the high level routing DSL and I've read some things about
> cancelling the HTTPResponse Entity's stream, but that doesn't seem to be
> dropping the connection.
>
> Can this be done using the high level API or do I need to refactor my code
> to use the low level API?
>
> Thanks,
> Derek
>
> --
> >> 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,
Konrad 'ktoso' Malawski
Akka  @ Lightbend 

-- 
>>  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] Meaning of the $ in the actor's path

2016-08-18 Thread Konrad Malawski
That it's a name generated by akka.
You did not name your actor, so a default name was generated for it.

Those are generated by using base64 on a sequence number.

It's best practice to actually explicitly name your actor btw.

On 19 Aug 2016 00:41, "Mark Kaberman"  wrote:

> I am creating my Akka actors via Spring integration as described here
> . When I look
> at my actors paths I always see the $ followed by the letter. For example
> If I create an actor and send the message as
>
> rootActor = system.actorOf(SpringExtProvider.get(system).create("
> rootActor").withRouter(new RoundRobinPool(5)), "root");
> rootActor.tell(new Integer(0), null);
>
> and then the log the path inside the actor
>
> public class RootActor extends UntypedActor {
> private static final Logger logger = LoggerFactory.getLogger(
> RootActor.class);
>
> @Override
> public void onReceive(Object message) throws Exception {
> logger.info("{}  {} received the message",
> this.getClass().getSimpleName(), self().path());
> }
> }
>
> The log entry would be
>
> RootActor  akka://AkkaDemo/user/root/$a received the message
>
>
> I am wondering what $a signify? Another question is should the router be
> in the path?
>
> --
> >> 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] How materialized value is defined?

2016-08-17 Thread Konrad Malawski
Please read the docs:
http://doc.akka.io/docs/akka/2.4/scala/stream/stream-customize.html#Custom_materialized_values


-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 17 August 2016 at 04:52:22, Guofeng Zhang (guofen...@gmail.com) wrote:

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.

-- 
>>  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: Access Denied Downloading standalone akka_2.11-2.4.9-RC2.zip

2016-08-15 Thread Konrad Malawski
Thanks for reporting, re-uploaded it.
S3 was behaving weird it seems.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 15 August 2016 at 19:02:56, murtuza chhil (chil...@gmail.com) wrote:

Its working now.

-chhil

On Monday, August 15, 2016 at 8:56:37 AM UTC+5:30, murtuza chhil wrote:
>
> Hello,
>
> Get an error  downloading  latest standalone release from page
> http://akka.io/downloads/
>
> The zip downlod link is
> http://downloads.typesafe.com/akka/akka_2.11-2.4.9-RC2.zip?_
> ga=1.68079190.614045507.1468130713
>
> Error page Content
>
>  encoding="UTF-8"?>AccessDeniedAccess 
> Denied4E93081229D790D5hTqKBgBzP1ydnHywim1E/9e/YrVnhfWyZQ+m39zdiIqoJMrd+VwOLyCBQ+pTw4DX5vByBmimSBs=
>
> ​
>
> -chhil
>
--
>> 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] What means of akka cluster roles leader?

2016-08-15 Thread Konrad Malawski
Duh, my bad. I keep mistaking the use of oldest and leader in this somehow.
Thanks for the correction Patrik!

On 15 Aug 2016 13:50, "Patrik Nordwall" <patrik.nordw...@gmail.com> wrote:

>
>
> On Mon, Aug 15, 2016 at 11:27 AM, Konrad Malawski <
> konrad.malaw...@lightbend.com> wrote:
>
>> Hi Yutao,
>> look at the return type – Option, so it's a single element.
>> It returns the leader of a given role (role == multiple nodes, 1 of them
>> is the leader).
>> I.e. it would host the the Singleton if it were constrained to this role.
>>
>
> That is not correct. Singleton runs on the oldest node. The leader is
> simply the node (with given role) with the lowest address with some
> additional rules. It's not at all as strict as the singleton. It's mostly
> used to manage the cluster membership and applications typically use the
> singleton instead of the leader.
>
> /Patrik
>
>
>
>
>>
>> --
>> Konrad `ktoso` Malawski
>> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>>
>> On 15 August 2016 at 04:23:26, Yutao Shuai (szqs...@gmail.com) wrote:
>>
>>
>> <https://lh3.googleusercontent.com/-tZtLqoK9VUY/V7EnCA2ZVKI/AL0/Gm66R8FjZqIZOmBWrT8b29IL8PdUJboCwCLcB/s1600/TT%25E6%2588%25AA%25E5%259B%25BE%25E6%259C%25AA%25E5%2591%25BD1%25E5%2590%258D.jpg>
>>
>> What this function means? Select a nodes with specfic roles as the
>> cluster leader or every roles has its leader?
>> --
>> >>>>>>>>>> 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 <http://www.lightbend.com/> -  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.
>

-- 
>>>>>>>>>>  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] What means of akka cluster roles leader?

2016-08-15 Thread Konrad Malawski
Hi Yutao,
look at the return type – Option, so it's a single element.
It returns the leader of a given role (role == multiple nodes, 1 of them is
the leader).
I.e. it would host the the Singleton if it were constrained to this role.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 15 August 2016 at 04:23:26, Yutao Shuai (szqs...@gmail.com) wrote:



What this function means? Select a nodes with specfic roles as the cluster
leader or every roles has its leader?
--
>> 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] Re: Multipart Fileupload problem with Akka 2.4.8 and 2.4.9-RC1

2016-08-05 Thread Konrad Malawski
Hi Scott,
OSGi messed up our RC1 release.
Sorry for the trouble, though glad we did the RC which is there for finding
such issues before we release a stable version.

The bug is explained in https://github.com/akka/akka/issues/21105 and I've
fixed both root cause and sbt plugin so we'll never have this issue again.
I'm releasing RC2 right now, please wait a bit and upgrade to it then.

Thanks

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 5 August 2016 at 11:46:35, Scott Lunel (scott.lu...@gmail.com) wrote:

Hey, sorry but I have yet another stupid question.

All of my dependencies seem to be correct now, but when I switch from
version 2.4.8 to 2.4.9-RC1, I get this error:

[ERROR] error: missing or invalid dependency detected while loading class
file 'Unmarshaller.class'.
[INFO] Could not access type Unmarshaller in value
akka.http.javadsl.unmarshalling,
[INFO] because it (or its dependencies) are missing. Check your build
definition for
[INFO] missing or conflicting dependencies.

It says in the migration documentation from 2.4.8 to 2.4.9-RC1 that the
package has been moved from akka.http.javadsl.server to the unmarshalling
one shown above.

I can't seem to get around this error no matter what I do.

On Thursday, August 4, 2016 at 11:28:56 AM UTC-4, Scott Lunel wrote:
>
> Hello everyone,
>
>
> I seem to be having a problem with Multipart file upload since Akka 2.4.8.
> It works perfectly fine in 2.4.7.
>
> I've google searched for anything related to this and haven't found much,
> so I've decided to post here.
>
> Code to reproduce:
>
> val upload = path("upload") {
> post {
>   fileUpload("file") {
> case (fileInfo, bytes) ⇒
>   complete("Done")
>   }
> }
> }
>
>
> The exception:
>
> Uncaught error from thread [toplevel-akka.actor.default-dispatcher-10]
> shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for
> ActorSystem[toplevel]
> java.lang.NoSuchMethodError: akka.stream.ActorMaterializer$
> .downcast(Lakka/stream/Materializer;)Lakka/stream/ActorMaterializer;
> at akka.http.scaladsl.unmarshalling.MultipartUnmarshallers$$
> anonfun$multipartUnmarshaller$1$$anonfun$apply$1$$anonfun$
> apply$2$$anonfun$2.apply(MultipartUnmarshallers.scala:78)
> at akka.http.scaladsl.unmarshalling.MultipartUnmarshallers$$
> anonfun$multipartUnmarshaller$1$$anonfun$apply$1$$anonfun$
> apply$2$$anonfun$2.apply(MultipartUnmarshallers.scala:78)
> at scala.Option.getOrElse(Option.scala:121)
> at akka.http.scaladsl.unmarshalling.MultipartUnmarshallers$$
> anonfun$multipartUnmarshaller$1$$anonfun$apply$1$$anonfun$apply$2.apply(
> MultipartUnmarshallers.scala:78)
> at akka.http.scaladsl.unmarshalling.MultipartUnmarshallers$$
> anonfun$multipartUnmarshaller$1$$anonfun$apply$1$$anonfun$apply$2.apply(
> MultipartUnmarshallers.scala:71)
> at akka.http.scaladsl.unmarshalling.Unmarshaller$$
> anon$1.apply(Unmarshaller.scala:52)
> at akka.http.scaladsl.unmarshalling.LowerPriorityGenericUnmarshall
> ers$$anonfun$messageUnmarshallerFromEntityUnmarshaller$1$$anonfun$apply$
> 1$$anonfun$apply$2.apply(GenericUnmarshallers.scala:20)
> at akka.http.scaladsl.unmarshalling.LowerPriorityGenericUnmarshall
> ers$$anonfun$messageUnmarshallerFromEntityUnmarshaller$1$$anonfun$apply$
> 1$$anonfun$apply$2.apply(GenericUnmarshallers.scala:20)
> at akka.http.scaladsl.unmarshalling.Unmarshaller$$
> anon$1.apply(Unmarshaller.scala:52)
>
>
> This appears to be throwing an exception when the code hits:
>
> entity(as[Multipart.FormData])
>
> I've written my own custom code to do multipart form file uploads and I
> initially suspected it was a problem on my end. However, after testing the
> above code (using one of the file upload directives), this error is being
> thrown in the akka http source.
>
> Is anyone else having this issue? I can't seem to get multipart file
> uploads to work in 2.4.8 and 2.4.9-RC1.
>
> Any help / information would be greatly appreciated.
>
>
> Regards,
>
> Scott.
>
--
>> 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 

Re: [akka-user] Stream within Actor Supervision

2016-08-05 Thread Konrad Malawski
Stream errors are *in* the stream.
It does not blow up the Actor, nor should it.

What's your use case?

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 5 August 2016 at 09:31:16, Gary Struthers (agilej...@earthlink.net)
wrote:

I think I understand. The other part of my question is when a stream is
within an actor. If the stream has an error where I want the enclosing
actor to stop how do I do that? Also, any advice on testing error handling?
--
>> 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] Stream within Actor Supervision

2016-08-05 Thread Konrad Malawski
If you write *custom* GraphStages, then *you* need to decide what
supervision means in that context – then is supports it:
https://github.com/akka/akka/commit/5382014133d01cd38729d731763841680f93a42c#diff-3203199ba389ee802eef94486f26dc88R41


-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 5 August 2016 at 04:47:58, Gary Struthers (agilej...@earthlink.net)
wrote:

Thanks Konrad, when I skimmed that page I read it as supervision didn't
work with GraphStage, which I use a lot but reading slowly I see it's
GraphStage junction that's not supported and I don't use that. This gives
me what I need.
--
>> 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] Re: Akka Java IO TLS

2016-08-04 Thread Konrad Malawski
I have found handing SSL/TLS from JVM a PITA. Why you don't put the SSL
termination in front of the Akka HTTP endpoint (e.g. nginx) ?


I'd honestly +1 that  (a lot).

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

-- 
>>  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] Stream within Actor Supervision

2016-08-04 Thread Konrad Malawski
Hello there,
please read the docs on Stream error handling:
http://doc.akka.io/docs/akka/2.4.9-RC1/scala/stream/stream-error.html#stream-error-scala

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 4 August 2016 at 23:47:27, Gary Struthers (agilej...@earthlink.net)
wrote:

If an Actor contains a Stream what happens when the stream throws an
exception and there is no stream Decider to handle it? Can the Actor's
supervisor handle it and Resume, Restart, and Stop the Actor with the
stream?

Gary
--
>> 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 Stream

2016-08-04 Thread Konrad Malawski
That's correct - streams are fully typed and we're pretty proud of that :)

One difference I'd like to highlight though is that Streams don't directly
"replace" Actors.
In many cases they do, for local processing pipelines etc. However Streams
(any
reactive streams implementation in fact) don't solve the distribution
aspect – that's where Actors excel at.

By distribution I mean features like Cluster Sharding for example:
http://doc.akka.io/docs/akka/current/scala.html
So all distributed systems bits are still best served by Actors, however
all their local bits can often be solved by Streams.

Hope this helps.
You may also like this talk from Scala Matsuri, where I talk a bit around
some of these questions:
https://www.youtube.com/watch?v=mlli4LCLmzM

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 4 August 2016 at 18:13:48, Mike Khan (mike.k...@hmrc.gov.uk) wrote:

Thanks Konrad.

I'm looking into using Akka Streams because (correct me if I am wrong) I
can achieve a higher level of type safety than using Akka Actors directly.
The receive method of an Actor can pretty much take any type which I find
worrying. Having looked into Akka Streams I realized that the an equivalent
Akka Stream implementation can be designed which is equivalent to the the
Akka Actor design in terms of end result. But the beauty with the Akka
Stream approach is that I can't just input just any type. I can only input
the one that is defined by the source.

On Thursday, 4 August 2016 13:57:28 UTC+1, Konrad Malawski wrote:
>
> Yes, this is the right place.
> Announcements are here, as well as general community discussions.
>
> For news only you may want to subscribe to: akka.io/news
> And for blogs from the core team there's akka.io/blog
>
> --
> Konrad `ktoso` Malawski
> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>
> On 4 August 2016 at 14:08:45, Mike Khan (mike...@hmrc.gov.uk )
> wrote:
>
> Hi
>
> Is this the correct channel to stay up to date with Akka Streams? I would
> like to keep up to date on the direction and latest changes to the library.
>
> Mike
> --
> >>>>>>>>>> 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] Re: Multipart Fileupload problem with Akka 2.4.8 and 2.4.9-RC1

2016-08-04 Thread Konrad Malawski
Glad that was it Scott.
I'd recommend keeping an akka.version property in properties in Maven,
and bump it there each time instead of specifically keeping the version in
all dependencies explicitly.

Hope this helps, happy hakking!

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 4 August 2016 at 17:53:29, Scott Lunel (scott.lu...@gmail.com) wrote:

Hey Johan,

Thanks for the quick reply.

Looks like you were right. My Maven configuration is rather complicated,
and one of the child projects was not pulling in the correct version of
akka-http.

Such a silly mistake.

On Thursday, August 4, 2016 at 11:30:15 AM UTC-4, Johan Andrén wrote:
>
> Hi Scott,
>
> Seems like you are mixing different versions of akka-http and
> akka-streams. Look over your dependencies!
>
> --
> Johan
> Akka Team
>
> On Thursday, August 4, 2016 at 5:28:56 PM UTC+2, Scott Lunel wrote:
>>
>> Hello everyone,
>>
>>
>> I seem to be having a problem with Multipart file upload since Akka
>> 2.4.8. It works perfectly fine in 2.4.7.
>>
>> I've google searched for anything related to this and haven't found much,
>> so I've decided to post here.
>>
>> Code to reproduce:
>>
>> val upload = path("upload") {
>> post {
>>   fileUpload("file") {
>> case (fileInfo, bytes) ⇒
>>   complete("Done")
>>   }
>> }
>> }
>>
>>
>> The exception:
>>
>> Uncaught error from thread [toplevel-akka.actor.default-dispatcher-10]
>> shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for
>> ActorSystem[toplevel]
>> java.lang.NoSuchMethodError: akka.stream.ActorMaterializer$
>> .downcast(Lakka/stream/Materializer;)Lakka/stream/ActorMaterializer;
>> at akka.http.scaladsl.unmarshalling.MultipartUnmarshallers$$
>> anonfun$multipartUnmarshaller$1$$anonfun$apply$1$$anonfun$
>> apply$2$$anonfun$2.apply(MultipartUnmarshallers.scala:78)
>> at akka.http.scaladsl.unmarshalling.MultipartUnmarshallers$$
>> anonfun$multipartUnmarshaller$1$$anonfun$apply$1$$anonfun$
>> apply$2$$anonfun$2.apply(MultipartUnmarshallers.scala:78)
>> at scala.Option.getOrElse(Option.scala:121)
>> at akka.http.scaladsl.unmarshalling.MultipartUnmarshallers$$
>> anonfun$multipartUnmarshaller$1$$anonfun$apply$1$$anonfun$apply$2.apply(
>> MultipartUnmarshallers.scala:78)
>> at akka.http.scaladsl.unmarshalling.MultipartUnmarshallers$$
>> anonfun$multipartUnmarshaller$1$$anonfun$apply$1$$anonfun$apply$2.apply(
>> MultipartUnmarshallers.scala:71)
>> at akka.http.scaladsl.unmarshalling.Unmarshaller$$
>> anon$1.apply(Unmarshaller.scala:52)
>> at akka.http.scaladsl.unmarshalling.LowerPriorityGenericUnmarshall
>> ers$$anonfun$messageUnmarshallerFromEntityUnmarshaller$1$$anonfun$apply$
>> 1$$anonfun$apply$2.apply(GenericUnmarshallers.scala:20)
>> at akka.http.scaladsl.unmarshalling.LowerPriorityGenericUnmarshall
>> ers$$anonfun$messageUnmarshallerFromEntityUnmarshaller$1$$anonfun$apply$
>> 1$$anonfun$apply$2.apply(GenericUnmarshallers.scala:20)
>> at akka.http.scaladsl.unmarshalling.Unmarshaller$$
>> anon$1.apply(Unmarshaller.scala:52)
>>
>>
>> This appears to be throwing an exception when the code hits:
>>
>> entity(as[Multipart.FormData])
>>
>> I've written my own custom code to do multipart form file uploads and I
>> initially suspected it was a problem on my end. However, after testing the
>> above code (using one of the file upload directives), this error is being
>> thrown in the akka http source.
>>
>> Is anyone else having this issue? I can't seem to get multipart file
>> uploads to work in 2.4.8 and 2.4.9-RC1.
>>
>> Any help / information would be greatly appreciated.
>>
>>
>> Regards,
>>
>> Scott.
>>
> --
>> 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 Stream

2016-08-04 Thread Konrad Malawski
Yes, this is the right place.
Announcements are here, as well as general community discussions.

For news only you may want to subscribe to: akka.io/news
And for blogs from the core team there's akka.io/blog

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 4 August 2016 at 14:08:45, Mike Khan (mike.k...@hmrc.gov.uk) wrote:

Hi

Is this the correct channel to stay up to date with Akka Streams? I would
like to keep up to date on the direction and latest changes to the library.

Mike
--
>> 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 Cluster (with Sharding) not working without auto-down-unreachable-after

2016-08-04 Thread Konrad Malawski
Just to re-affirm what Justin wrote there.

Auto downing is "auto". It's dumb. That's why it's not safe.
The safer automatic downing modes ones are in
doc.akka.io/docs/akka/rp-16s01p05/scala/split-brain-resolver.html
Yes, that's a commercial thing.

If you don't want to use these, use EC2's APIs - they have APIs from which
you can get information about state like that.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 4 August 2016 at 04:00:34, Justin du coeur (jduco...@gmail.com) wrote:

The keyword here is "auto".  Autodowning is an *incredibly braindead*
algorithm for dealing with nodes coming out of service, and if you use it
in production you more or less guarantee disaster, because that algorithm
can't cope with cluster partition.  You *do* need to deal with downing, but
you have to get something smarter than that.

Frankly, if you're already hooking into AWS, I *suspect* the best approach
is to leverage that -- when a node goes offline, you have some code to
detect that through the ECS APIs, react to it, and manually down that node.
 (I'm planning on something along those lines for my system, but haven't
actually tried yet.)  But whether you do that or something else, you've got
to add *something* that does downing.

I believe the official party line is "Buy a Lightbend Subscription",
through which you can get their Split Brain Resolver, which is a fairly
battle-hardened module for dealing with this problem.  That's not strictly
necessary, but you *do* need to have a reliable solution...

On Wed, Aug 3, 2016 at 8:42 PM, Eric Swenson  wrote:

> We have an akka-cluster/sharding application deployed an AWS/ECS, where
> each instance of the application is a Docker container.  An ECS service
> launches N instances of the application based on configuration data.  It is
> not possible to know, for certain, the IP addresses of the cluster
> members.  Upon startup, before the AkkaSystem is created, the code
> currently polls AWS and determines the IP addresses of all the Docker hosts
> (which potentially could run the akka application).  It sets these IP
> addresses as the seed nodes before bringing up the akka cluster system. The
> configuration for these has, up until yesterday always included the
> akka.cluster.auto-down-unreachable-after configuration setting.  And it has
> always worked.  Furthermore, it supports two very critical requirements:
>
> a) an instance of the application can be removed at any time, due to
> scaling or rolling updates
> b) an instance of the application can be added at any time, due to scaling
> or rolling updates
>
> On the advice of an Akka expert on the Gitter channel, I removed the
> auto-down-unreachable-after setting, which, as documented, is dangerous for
> production.  As a result the system no longer supports rolling updates.  A
> rolling update occurs thus:  a new version of the application is deployed
> (a new ECS task definition is created with a new Docker image).  The ECS
> service launches a new task (Docker container running on an available host)
> and once that container becomes stable, it kills one of the remaining
> instances (cluster members) to bring the number of instances to some
> configured value.
>
> When this happens, akka-cluster becomes very unhappy and becomes
> unresponsive.  Without the auto-down-unreachable-after setting, it keeps
> trying to talk to the old cluster members. which is no longer present.  It
> appears to NOT recover from this.  There is a constant barrage of messages
> of the form:
>
> [DEBUG] [08/04/2016 00:19:27.126]
> [ClusterSystem-cassandra-plugin-default-dispatcher-27]
> [akka.actor.LocalActorRefProvider(akka://ClusterSystem)] resolve of path
> sequence [/system/sharding/ExperimentInstance#-389574371] failed
> [DEBUG] [08/04/2016 00:19:27.140]
> [ClusterSystem-cassandra-plugin-default-dispatcher-27]
> [akka.actor.LocalActorRefProvider(akka://ClusterSystem)] resolve of path
> sequence [/system/sharding/ExperimentInstance#-389574371] failed
> [DEBUG] [08/04/2016 00:19:27.142]
> [ClusterSystem-cassandra-plugin-default-dispatcher-27]
> [akka.actor.LocalActorRefProvider(akka://ClusterSystem)] resolve of path
> sequence [/system/sharding/ExperimentInstance#-389574371] failed
> [DEBUG] [08/04/2016 00:19:27.143]
> [ClusterSystem-cassandra-plugin-default-dispatcher-27]
> [akka.actor.LocalActorRefProvider(akka://ClusterSystem)] resolve of path
> sequence [/system/sharding/ExperimentInstance#-389574371] failed
> [DEBUG] [08/04/2016 00:19:27.143]
> [ClusterSystem-cassandra-plugin-default-dispatcher-27]
> [akka.actor.LocalActorRefProvider(akka://ClusterSystem)] resolve of path
> sequence [/system/sharding/ExperimentInstance#-389574371] failed
>
> and of the form:
>
> [WARN] [08/04/2016 00:19:16.787]
> [ClusterSystem-akka.actor.default-dispatcher-9] [akka.tcp://
> ClusterSystem@10.0.3.103:2552/system/sharding/ExperimentInstance] Retry
> request for shard [5] homes from 

Re: [akka-user] Re: [ANNOUNCE] Akka 2.4.9-RC1 Released! (Akka HTTP Performance and Entity Streaming)

2016-08-03 Thread Konrad Malawski
Hi Jason,
sadly the sbt-osgi plugin did something rather silly (I went in and fixed
the plugin today) breaking the release if Java Marshallers are used.
See here for details and workaround:
https://github.com/akka/akka/issues/21105

Thanks for trying out the release candidate and thanks for your
understanding - sorry that it's dead-on-arrival.
A stable 2.4.9 is coming any day now – that will work then.

We did a ReleaseCandidate this time as we weren't sure about some changes,
glad we did an RC because indeed one of them turned out to be a problem.

-- 
Konrad 'ktoso’ Malawski
Akka  @ Lightbend 
java.pl / geecon.org / krakowscala.pl / lambdakrk.pl /
sckrk.com

On 4 August 2016 at 00:17:30, Jason B (jason.boutw...@gmail.com) wrote:

Got this error after upgrading Akka versions in sbt build file from 2.4.8
to 2.4.9-RC1, and attempting to integrate JSON Streaming functionality. I'm
not using javadsl in any capacity. Seems related to the migration note on
javadsl, but I am only using scaladsl in my code. An issue with the Maven
artifacts?

[error] missing or invalid dependency detected while loading class file
'JsonEntityStreamingSupport.class'.
[error] Could not access type JsonEntityStreamingSupport in value
akka.http.javadsl.common,
[error] because it (or its dependencies) are missing. Check your build
definition for
[error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath`
to see the problematic classpath.)
[error] A full rebuild may help if 'JsonEntityStreamingSupport.class' was
compiled against an incompatible version of akka.http.javadsl.common.
[error] missing or invalid dependency detected while loading class file
'EntityStreamingSupport.class'.
[error] Could not access type EntityStreamingSupport in value
akka.http.javadsl.common,
[error] because it (or its dependencies) are missing. Check your build
definition for
[error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath`
to see the problematic classpath.)
[error] A full rebuild may help if 'EntityStreamingSupport.class' was
compiled against an incompatible version of akka.http.javadsl.common.


On Tuesday, August 2, 2016 at 1:04:29 PM UTC-6, Konrad 'ktoso' Malawski
wrote:
>
> Dear hAkkers,
>
> We—the Akka committers—are pleased to be able to announce the availability
> of Akka 2.4.9-RC1.
>
> This version is focused on Akka HTTP performance improvements as well as
> introducing the entity streaming feature which we’ll discuss below.
>
> Highlights of the performance improvements include:
>
>
>-
>
>Overall Akka HTTP throughput and transfer rate has been improved by
>30-40%
>-
>
>Performance is on-par or better than Spray.
>-
>   -
>
>   Matching it both in raw throughput as well as latency distribution
>   across a spectrum of request rates.
>   -
>
>   We measured an overall improvement of ~14% over Spray
>   -
>
>Short lived connections throughput, which remains to be the worst-case
>scenario for Akka HTTP thought remains rare in the real world (due to
>connection pooling), has been doubled.
>-
>
>Given our EC2 infrastructure (m4.2xlarge instances) the server
>currently reaches a maximum of ~160.000 “ping / pong” requests per second
>(measured using 100 concurrent connections).
>
>
> While we did not have the chance to benchmark using dedicated boxes this
> time, based on experience from previous Spray benchmark rounds we expect
> the top throughput to be much higher on actual hardware than it is on EC2.
>
> One might want to remind remind oneself the good old post about Spray’s
> benchmarking results  
> back
> in 2013 when it won a benchmarking round, achieving 30k reqs/sec on EC2
> (m1.large) and 197k reqs/sec on dedicated i7 machines (using 256
> connections).
>
> This release also features a new feature that we think Streaming API
> authors will be delighted to see: EntityStreamingSupport.
>
> It makes marshalling of Akka Streams into/from HTTP requests and responses
> as simple as adding enabling streaming and calling complete(tweets), given
> tweets was a Source[Tweet, _].
>
> Learn more about it in the Entity Streaming section of the documentation
> 
> .
>
> We would like to encourage Akka HTTP users to try out this Release
> Candidate and provide feedback or report regressions if you find any.
>
> API has remained largely unchanged, though the usual experimental module
> incompatibility caveat still remains so upgrading should be simple.
>
> You may want to refer to the migration guide
> ,
> as some classes moved to more appropriate places. A stable 2.4.9 should
> follow shortly after we’ve gathered some community feedback.
> Next steps for Akka HTTP
>
> 

Re: [akka-user] Re: How to read XML inputstream (with SAX parser) received by akka-http?

2016-08-02 Thread Konrad Malawski
Yeah, that'd be good to collect usecases and demadn there.
Though with SAX it won't be automagical ever, they always require manually
writing the parsing AFAIR

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 2 August 2016 at 10:29:21, André (andre.ruedi...@gmail.com) wrote:

Maybe you can add your use case to https://github.com/akka/akka/issues/16210
.

On Tuesday, August 2, 2016 at 10:12:13 AM UTC+2, JY wrote:
>
> I am new with AKKA and AKKA HTTP.
>
> I have to write a HTTP server application that reads a lot very big XML
> data flows (via HTTP PUT method) and parses this Data with a SAX parser.
>
> How can I do that with akka-http?
>
> Thanx in advance for your help.
>
--
>> 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] Re: Websockets and Flow.fromSinkAndSource

2016-08-01 Thread Konrad Malawski
Please read the docs on this topic:
http://doc.akka.io/docs/akka/2.4/scala/http/client-side/websocket-support.html#Half-Closed_WebSockets

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 1 August 2016 at 20:17:56, Aditya Prasad (akpra...@gmail.com) wrote:

tl;dr: webSocketClientFlow does not close the websocket (or shut down its
input stream) when the output stream ends, but I think it's supposed to. It
*does* do the reverse (shut down the output when the input terminates).

On Friday, July 29, 2016 at 6:28:14 PM UTC-7, Aditya Prasad wrote:
>
> Hi!
>
> I've got code like this:
>
>> val flow = Http().webSocketClientFlow(WebSocketRequest(s"ws://...")))
>> val sink = Sink.actorRef(actor, EventsComplete)
>> Source.tick[Message](KeepAliveDelay, KeepAliveDelay,
>> KeepAlive).via(flow).runWith(sink)
>
>
> The Source.tick is there because if I use Source.empty, the websocket
> connection gets closed immediately. The docs suggest using Source.maybe 
> instead,
> but then the websocket is still closed after some timeout. I need my client
> to listen forever.
>
> Anyway: if actor finishes (e.g., server requests a hangup and it gets an
> EventsComplete), the websocket does not close. The ticking keeps going,
> sending stuff over the wire.
>
> This is strange because the docs say it doesn't support half-closed
> websockets[1]. Any guesses what's going on, and what I should do about it?
> In my actual code, one method generates the Source, and another piece of
> code creates the Actor and runs with that Source.
>
> For now I've got a nasty (though fun to code!) workaround, with a custom
> TerminationWatcherKillSwitch thing so that Flow.fromSinkAndSource will
> terminate one stream if the other terminates.
>
> Thanks!
>
> [1]
> http://doc.akka.io/docs/akka/2.4.8/scala/http/client-side/websocket-support.html
>
--
>> 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] Default for akka.http.server.remote-address-header

2016-08-01 Thread Konrad Malawski
If you need it, you'll find the option.
Why make everyone pay the price of fabricating that header :-)

Also, it's a bit weird – people are not expecting headers that were not in
the request to show up.
It's a more natural learning curve that you discover the feature and opt
into it.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 1 August 2016 at 19:17:24, Matt Hughes (hughes.m...@gmail.com) wrote:

Was curious why the default configuration for this value is off.  Is it
performance related?  The desire to not modify HTTP headers?
--
>> 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] Re: [akka-streams] Trying to mimic socket level programming , connect client and then send data if connection is available

2016-08-01 Thread Konrad Malawski
Source.single completes the stream (closes the connection) once it has
signalled the data.
Simply put a Source.maybe behind it (a.concat(b)) or use a different
source, like unfold or an iterator).

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 1 August 2016 at 11:24:51, murtuza chhil (chil...@gmail.com) wrote:

Hi Johan,

Thank you very much. Yes indeed stream + tcp is hurting me for sure and I
have tried reading the docs and sample code over and over.

So yes, I made some progress. Please ignore the verbosity of the code, I
just need to familiarize myself with return values and look at the source
of those easily via eclipse.


final ActorSystem system = ActorSystem.create("Client");
final ActorMaterializer mat = ActorMaterializer.create(system);

Tcp tcp = Tcp.get(system);
Flow outgoingConnection = tcp
.outgoingConnection("127.0.0.1", 6000);

Source clientSource = Source.empty();

CompletionStage cs = clientSource.via(outgoingConnection)
.runWith(Sink.ignore(), mat);

cs.exceptionally(ex -> {
ex.printStackTrace();
return null;
});

Source clientSource1 = Source.single(ByteString
.fromString("Chhil"));

NotUsed var = clientSource1.via(outgoingConnection).to(Sink.ignore())
.run(mat);

​

Managed to get a connection made usingSource.empty()​ for the initial
connect.
The CompletionStage kicks in nicely. You mentioned I should be able to get
CompletionStage to determine problems with the
connection, this I don't know how or when it gets returned when the graph
is run. Please do correct me if understanding is wrong.
I use the materialized value from the connect and that works fine, as I
don't see a new connect after the initial connect with the Source.empty().
I assume this is the right way to get the initial connection and then
change the source for regular communication.

*Now the problem I have run into is, that after sending data, the channel
disconnects. What must I do to keep it open?*

-chhil


On Monday, August 1, 2016 at 12:31:08 PM UTC+5:30, Johan Andrén wrote:
>
> Hi Chhil,
>
> The flow returned by outgoingConnection materializes into a
> CompletionStage which will be failed if the
> connection fails, so that is where you can implement your error handling
> for the initial connection. You would have to keep the materialized value
> when you construct the flow though, so that it is returned from run().
>
> You can read more about materialized values here:
> http://doc.akka.io/docs/akka/2.4/java/stream/stream-composition.html#materialized-values
> and TCP with streams here:
> http://doc.akka.io/docs/akka/2.4/java/stream/stream-io.html#stream-io-java
>
>
> In general, read as much of the streams docs as you can to get a good
> understanding of how Akka Streams work, trial and error with streams + tcp
> will hurt!
>
> --
> Johan
> Akka Team
>
> On Monday, August 1, 2016 at 7:20:23 AM UTC+2, murtuza chhil wrote:
>>
>> Hello,
>>
>> I am a newbie trying to understand Akka Streams.
>>
>> Coming from regular socket programming I am trying to mimic a client
>> connection and have the following runnable graph.
>>
>> Flow 
>> flow = Tcp
>> .get(system).outgoingConnection("127.0.0.1", 6000);
>> Source clientSource = Source.single(ByteString
>> .fromString("XYZ"));
>>
>> clientSource.via(flow).to(Sink.ignore()).run(mat);
>>
>> ​
>>
>> This works fine when used with the samples in the doc, where the source
>> is attached that has a list and there is a server listening and we run the
>> source->flow->sink through a materializer.
>>
>> But this is not a typical use case, typically one would attempt to
>> connect to a server,  and either it connects or fails. If connected send
>> data that will be made available and if connection fails, have the ability
>> to backoff.
>>
>>
>> Currently I don't know how to access the error when a server is not
>> available and want to establish a connection before data is available.
>> Don't know how to prevent connections every time data is sent, I
>> understand why it happens, but don't know how to reuse a materialized flow
>> that has already connected.
>> What I am trying to get my head around is how does one run a graph
>> without any source data and get a completable future that tells me if it
>> succeeded or not.
>> Then I want to use the same connection to send data later using the
>> source.
>>
>> I have attempted with a runfold and that give me the akka TCP Exception
>> when the server is not availble, but I simply want to forward the data from
>> the source without manipulation.
>>
>> There was another thread that I had started
>> 

Re: [akka-user] Get ActorSystem as part of a stream materialization process

2016-07-30 Thread Konrad Malawski
(feel free to copy paste the entire impl and use as-is if you want to btw)

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 31 July 2016 at 00:52:56, Konrad Malawski (konrad.malaw...@lightbend.com)
wrote:

I like the idea, this can indeed be very useful!
We'll see what the rest of the team has to say about it.

I took a shot at implementing it actually, so here it is:
https://github.com/akka/akka/pull/21076

No guarantees about bug-free ness, but it seems rather complete ;-)


It also shows of how awesome GraphStage really is, esp. with it's
StageActor feature which we'll blog about more in the near future.
Just yesterday we published a post introducing GraphStage a bit from a
birds view btw:
http://blog.akka.io/streams/2016/07/30/mastering-graph-stage-part-1
Track the blog if you want to learn interesting stuff about internals like
that :-)


Happy hakking!

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 30 July 2016 at 23:19:17, Alexey S (kvr...@gmail.com) wrote:

I'm trying to bind stream life-cycle to an actor life-cycle (let's call it
master actor). In a sense that if the stream is destroyed - the master
actor receives some Termination message but stays alive, but if the actor
is destroyed - the stream has to be shut down as well.
When I construct part of the stream flow, that has to be responsible for
the logic above, I have only an ActorRef of the master actor I want bind
the stream life-cycle to.

Originally I wanted to do the following: during stream materialization I
get its KillSwitch and create an aux actor with KillSwitch and master
ActorRef as parameters. The aux actor will create a watch for the master
actor and kill the stream using KillSwitch, once master actor shuts down.

As an alternative I can probably create a branch in the flow, filter off
all the possible events/messages and attach the master actor as a
Sink.actorRef.

WDYT?

Thanks.

WBR,
Alexey

On Sat, Jul 30, 2016 at 1:41 PM, Konrad Malawski <
konrad.malaw...@lightbend.com> wrote:

> Not using safe APIs.
> But instead I'd turn around the question and ask what you're trying to
> achieve?
> Perhaps there's a cleaner way than reaching out to the ActorSystem.
>
> --
> Konrad `ktoso` Malawski
> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>
> On 30 July 2016 at 22:39:47, oleksiys (kvr...@gmail.com) wrote:
>
> Hi,
>
> is it possible to get access to the ActorSystem, that is being used to
> materialize the stream during materialization?
>
> Something like:
>
> Flow[String].viaMat(*ExposeActorSystemMat.instance*).mapMaterializedValue(actorSystem
> => doSomethingWithActorSystem(actorSystem))
>
> Thanks.
>
> WBR,
> Alexey
> --
> >>>>>>>>>> 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] Get ActorSystem as part of a stream materialization process

2016-07-30 Thread Konrad Malawski
I like the idea, this can indeed be very useful!
We'll see what the rest of the team has to say about it.

I took a shot at implementing it actually, so here it is:
https://github.com/akka/akka/pull/21076

No guarantees about bug-free ness, but it seems rather complete ;-)


It also shows of how awesome GraphStage really is, esp. with it's
StageActor feature which we'll blog about more in the near future.
Just yesterday we published a post introducing GraphStage a bit from a
birds view btw:
http://blog.akka.io/streams/2016/07/30/mastering-graph-stage-part-1
Track the blog if you want to learn interesting stuff about internals like
that :-)


Happy hakking!

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 30 July 2016 at 23:19:17, Alexey S (kvr...@gmail.com) wrote:

I'm trying to bind stream life-cycle to an actor life-cycle (let's call it
master actor). In a sense that if the stream is destroyed - the master
actor receives some Termination message but stays alive, but if the actor
is destroyed - the stream has to be shut down as well.
When I construct part of the stream flow, that has to be responsible for
the logic above, I have only an ActorRef of the master actor I want bind
the stream life-cycle to.

Originally I wanted to do the following: during stream materialization I
get its KillSwitch and create an aux actor with KillSwitch and master
ActorRef as parameters. The aux actor will create a watch for the master
actor and kill the stream using KillSwitch, once master actor shuts down.

As an alternative I can probably create a branch in the flow, filter off
all the possible events/messages and attach the master actor as a
Sink.actorRef.

WDYT?

Thanks.

WBR,
Alexey

On Sat, Jul 30, 2016 at 1:41 PM, Konrad Malawski <
konrad.malaw...@lightbend.com> wrote:

> Not using safe APIs.
> But instead I'd turn around the question and ask what you're trying to
> achieve?
> Perhaps there's a cleaner way than reaching out to the ActorSystem.
>
> --
> Konrad `ktoso` Malawski
> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>
> On 30 July 2016 at 22:39:47, oleksiys (kvr...@gmail.com) wrote:
>
> Hi,
>
> is it possible to get access to the ActorSystem, that is being used to
> materialize the stream during materialization?
>
> Something like:
>
> Flow[String].viaMat(*ExposeActorSystemMat.instance*).mapMaterializedValue(actorSystem
> => doSomethingWithActorSystem(actorSystem))
>
> Thanks.
>
> WBR,
> Alexey
> --
> >>>>>>>>>> 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] Get ActorSystem as part of a stream materialization process

2016-07-30 Thread Konrad Malawski
Not using safe APIs.
But instead I'd turn around the question and ask what you're trying to
achieve?
Perhaps there's a cleaner way than reaching out to the ActorSystem.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 30 July 2016 at 22:39:47, oleksiys (kvr...@gmail.com) wrote:

Hi,

is it possible to get access to the ActorSystem, that is being used to
materialize the stream during materialization?

Something like:

Flow[String].viaMat(*ExposeActorSystemMat.instance*).mapMaterializedValue(actorSystem
=> doSomethingWithActorSystem(actorSystem))

Thanks.

WBR,
Alexey
--
>> 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] Why isn't akka PersistenceQuery using the Event Adapter configuration?

2016-07-29 Thread Konrad Malawski
I believe this was by design actually if I remember correctly, as we
considered the read side may want to operate on the raw events by default.

Let's say that in the same app that needs adapters for the PersistentActors
you want to project a view from historical data,
thus you may not want to apply the adapters for example.

It is possible to apply the adapters manually, as I explained here:
https://github.com/akka/akka/issues/21065

I agree however that it would be nice to make this simpler.
Ideas and contributions how the API could be improved are very welcome :-)



-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 29 July 2016 at 13:22:30, FCristovao (filipe.md.cristo...@gmail.com)
wrote:

Hey there,

  Recently I tried out Akka Persistence, and I used a Event Adapter.
  All works really well on the Journal side, but then I started trying to
use the PersistenceQuery side, and I noticed that the events in the stream
come "un-event-adapted", that is, the method "fromJournal" is never called
on the adapter.
  And since the EventEnvelope doesn't contain the manifest from
PersistentRepr, one can't just map the "fromJournal" over the stream.

  Am I missing something? Maybe I misconfigured something? Or is this on
purpose?

Kind Regards,
  Filipe Cristóvão
--
>> 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] Dose akka suit parallelism?

2016-07-27 Thread Konrad Malawski
Concurrency enables parallelism.
So yes.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 27 July 2016 at 08:11:51, Qr Wang (zodi...@gmail.com) wrote:

Hello everyone,
I know akka is a concurrency framework.But does it fit parallelism
coding?Or just use
--
>> 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] High-level Server-Side API Minimal Example not working

2016-07-26 Thread Konrad Malawski
Hi there,
I just copy pasted the file and have to say "it works here".
Are you sure you have dependencies for akka-http-experimental in your build?

It works since ContentTypes is part of the akka.http.scaladsl.model package,
and that we've imported all the symbols from at the top of the file:

import akka.http.scaladsl.model._


Hope this helps.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 26 July 2016 at 21:14:29, Ajinkya Shukla (ajinkyashukl...@gmail.com)
wrote:

The minimal example give at the following
http://doc.akka.io/docs/akka/2.4.8/scala/http/routing-dsl/index.html does
not work.

It gives an error on line no 19.

Error:(19, 31) not found: value ContentTypes
  complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, "Say
hello to akka-http"))


   1. import akka.actor.ActorSystem
   2. import akka.http.scaladsl.Http
   3. import akka.http.scaladsl.model._
   4. import akka.http.scaladsl.server.Directives._
   5. import akka.stream.ActorMaterializer
   6. import scala.io.StdIn
   7. object WebServer {
   8.  def main(args: Array[String]) {
   9. implicit val system = ActorSystem("my-system")
   10.implicit val materializer = ActorMaterializer()
   11.// needed for the future flatMap/onComplete in the end
   12.implicit val executionContext = system.dispatcher
   13. val route =
   14.  path("hello") {
   15.get {
   16.  complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, "Say
   hello to akka-http"))
   17.}
   18.  }
   19. val bindingFuture = Http().bindAndHandle(route, "localhost", 8080
   )
   20. println(s"Server online at http://localhost:8080/\nPress RETURN
   to stop...")
   21.StdIn.readLine() // let it run until user presses return
   22.bindingFuture
   23.  .flatMap(_.unbind()) // trigger unbinding from the port
   24.  .onComplete(_ => system.terminate()) // and shutdown when done
   25.  }
   26. }



Can you please help me fixing the error ?
--
>> 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] [Cluster] Association failed even though cluster.leave(cluster.selfAddress) was called?

2016-07-25 Thread Konrad Malawski
Well the node leaving does nothing but shut down. The other nodes go on
with life of course.

That's exactly the problem though: You exit the JVM before anyone has the
chance to even receive the Leave message.

You should await the gossip message, basically:

Cluster.subscribe(self, classOf[MemberRemoved])

... case MembreRemoved(address) if address == selfAddress => System.exit()


Replied in a bit of a rush, hope you get the idea :-)

You can also check out my Zen of Akka talk for a bit more wordy explanation
of this.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

-- 
>>  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] [Cluster] Association failed even though cluster.leave(cluster.selfAddress) was called?

2016-07-25 Thread Konrad Malawski
What do you do after you call leave?

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 25 July 2016 at 20:27:29, kraythe (kray...@gmail.com) wrote:

In our code prior to shutting down a node we issue the following call.

val cluster: Cluster = Cluster.get(system)
cluster.leave(cluster.selfAddress)


However, despite that the other node still complains about unreachable
node. Any way I can stop this?

2016-07-25 13:23:33 -0500 - [WARN] - [ReliableDeliverySupervisor] akka.tcp:
//
mysystem@127.0.0.1:2551/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fruckus%40127.0.0.1%3A2552-1
-  Association with remote system [akka.tcp://ruckus@127.0.0.1:2552] has
failed, address is now gated for [5000] ms. Reason: [Association failed
with [akka.tcp://mysystem@127.0.0.1:2552]] Caused by: [Connection refused: /
127.0.0.1:2552]

Thanks in advance!

-- Robert
--
>> 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] Re: akka-http web socket issue

2016-07-21 Thread Konrad Malawski
Yes it works. What's wrong about Streamed?
That's a feature that it's streaming the data – consume it using the
dataBytes contained in the Streamed message.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 21 July 2016 at 10:45:03, allobi...@gmail.com (allobi...@gmail.com)
wrote:

does this work when receiving large json data..? i have problem receiving
large json data because sometimes it returns TextMessage.Streamed instead
of TextMessage.Strict and another issue is when connecting to wss://
s2.ripple.com:443 i can't connect using this url but can connect to other
websocket servers..

On Thursday, July 7, 2016 at 6:34:02 AM UTC+8, Eric Swenson wrote:
>
> I wrote a simple python client:
>
> $ cat ws-test.py
> import os
> from websocket import create_connection
>
> eiid=os.getenv("EIID")
> token=os.getenv("BEARER_TOKEN")
> header="Authorization: Bearer %s" % token
> ws = create_connection("ws://localhost:9000/ws-connect/%s" % eiid,
> header=[header])
> while True:
> x = ws.recv()
> print(x)
>
> And used it with my server.  It does not disconnect and correctly responds
> to all messages sent by the server.  So that rules out problems with the
> akka-http-based server.  it would appear that the issue is with the
> akka-http client (whose code I got from this web page:
>
>
> http://doc.akka.io/docs/akka/2.4.7/scala/http/client-side/websocket-support.html#websocketclientflow
>
>
> Is there some reason why this code does not work?  As mentioned
> previously, the code connects, retrieves and displays one message sent by
> the server just after connection, and then promptly disconnects the
> websocket connection.
>
> Are there known issues with client-side web socket support in 2.4.7?
>
> — Eric
>
> --
>> 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] Error about download akka proj from github and open it as a proj in intellij

2016-07-21 Thread Konrad Malawski
Hi Leo,
what PR are you working on?

But I found out there are lots of errors in build.sbt in every directory.
For instance,

For the most part you can ignore these if intellij doesn't pick them up.

The import into intellij from sbt feature works properly.

And, I create a test.scala in akka.http.scaladsl.server.Directives, but I
found out I can't import akka.http.scaladsl.marshallers.sprayjson because I
can't find the directory below the menu:




"Akka-http" does not depend on "Akka-http-sprayjson", so it's not available
there.
"Akka-http-sprayjson" does depend on "Akka HTTP" though, so in that project
you have all you need to write your test.scala

Hope this helps

-- 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] akka http client only excecute the `max-connections` times ~

2016-07-21 Thread Konrad Malawski
You're not using the data you've requested, thus stalling the connections.
This is by design. Akka HTTP is a *streaming* HTTP Client.

Please read the docs about this:
http://doc.akka.io/docs/akka/2.4/scala/http/implications-of-streaming-http-entity.html


-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 21 July 2016 at 10:09:56, l...@vip.qq.com (l...@vip.qq.com) wrote:


*When I use the pool-client to issue some requests, *

*the program seems only execute only 10 times ,just the value of
`max-connections` ,*

*the remaining 90 requests didn't execute at all;*

*And after a while, *

*the connection in the connection pool are closed ,no more connection alive ~*


*i don't know what happended, thansk for your help ~*



```the scala code ~

val poolFlow = Http().newHostConnectionPool[Int]("www.baidu.com")

(1 to 100).foreach{idx=>
  val futureResponse =
Source.single(httpRequest->1).via(poolFlow).runWith(Sink.head).map(_._1).flatMap(Future.fromTry)
  futureResponse.andThen{
case Success(_) =>
  println(s"${atomicLong.incrementAndGet()} ->
${Thread.currentThread().getName} ")
case Failure(e) =>
  e.printStackTrace()
  println(s"error ${e.getMessage}")
  }

}

```


the application.conf

```

http {
  host-connection-pool {
max-connections = 10
min-connections = 10
max-retries = 0
max-open-requests = 1048576
  }
}

```




the output :

```

after pool ~
after execute !
1 -> httpClient-akka.actor.default-dispatcher-2
4 -> httpClient-akka.actor.default-dispatcher-19
5 -> httpClient-akka.actor.default-dispatcher-12
2 -> httpClient-akka.actor.default-dispatcher-13
6 -> httpClient-akka.actor.default-dispatcher-10
3 -> httpClient-akka.actor.default-dispatcher-8
7 -> httpClient-akka.actor.default-dispatcher-13
8 -> httpClient-akka.actor.default-dispatcher-4
9 -> httpClient-akka.actor.default-dispatcher-4
10 -> httpClient-akka.actor.default-dispatcher-15

```


--
>> 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] How to use WebSockets with ActorPublisher?

2016-07-20 Thread Konrad Malawski
I don't know what your actor publisher was doing inside there. But yeah,
this is even better if you can get away without implementing custom stages.

On Jul 20, 2016 16:51, "Jakub Liska" <liska.ja...@gmail.com> wrote:

> There seems to be a third alternative to ActorPublisher :
>
>  Source.actorRef[User.OutgoingMessage](10, OverflowStrategy.fail).
> mapMaterializedValue
>
> the actorRef can be passed to a different Actor that would feed it
> messages and it would all behave like ActorPublisher, right?
>
> On Wednesday, July 20, 2016 at 4:21:35 PM UTC+2, Konrad Malawski wrote:
>>
>> Glad you resolved it.
>> Related hint is that one really really shouldn't be using ActorPublisher,
>> you should build stages from GraphStage instead,
>> the reason is that a) ActorPublisher is not fusable b) it's really hard
>> to actually implement a *correct* Publisher (even with ActorPublisher's
>> help).
>>
>> Happy hakking.,
>>
>> --
>> Konrad `ktoso` Malawski
>> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>>
>> On 20 July 2016 at 16:19:58, Jakub Liska (liska...@gmail.com) wrote:
>>
>> RESOLVED :
>>
>> I found a way to create Source and consequently ActorPublisher from
>> ActorRef, so that I can obtain the ActorRef upfront, so instead of :
>>
>> val stateChangeSource: Source[PipelineState, ActorRef] = Source.
>> actorPublisher[PipelineState](StateChangePublisher.props)
>>
>> I do :
>>
>> val stateChangePublisher: Publisher[PipelineState] = ActorPublisher[
>> PipelineState](stateChangePublisherRef)
>> val stateChangeSource = Source.fromPublisher(stateChangePublisher)
>>
>> And I can send messages to stateChangePublisherRef and push them to
>> Browser...
>>
>> On Wednesday, July 20, 2016 at 4:07:13 PM UTC+2, Konrad Malawski wrote:
>>>
>>> Could you provide a sample snippet that we could help out with?
>>> Context helps to get quicker help.
>>>
>>> --
>>> Konrad `ktoso` Malawski
>>> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>>>
>>> On 20 July 2016 at 16:03:30, Jakub Liska (liska...@gmail.com) wrote:
>>>
>>> hey,
>>>
>>> I hit a deadend with combination of Websockets and ActorPublisher
>>> because the TextMessage expects Source and one can obtain the underlying
>>> ActorRef from ActorPublisher only by materializing it :
>>>
>>>
>>> https://github.com/akka/akka/blob/29029be31d9198ed45c73efbc2d0212651882a94/akka-http-core/src/main/scala/akka/http/scaladsl/model/ws/Message.scala#L30
>>>
>>> Theoretically one could look it up but then there is a question "when"
>>> it becomes materialized :-/
>>> --
>>> >>>>>>>>>> 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
> >>>>>

Re: [akka-user] Creating Actor w/ Props having Value Class Argument(s)

2016-07-20 Thread Konrad Malawski
This basically demonstrates the core of the problem:

scala> class Meter(val m: Int) extends AnyVal
defined class Meter
// in runtime you have *no way* to check if it's an AnyVal extending
class or not. We would have to use macros. (scala reflection is a bit
iffy...)

scala> val m = new Meter(12)
m: Meter = Meter@c

scala> class Act(m: Meter)
defined class Act

scala> classOf[Act].getDeclaredConstructors.head
res23: java.lang.reflect.Constructor[_] = public Act(int)
// constructor takes int as you can see
// it is the ONLY constructor this class has - you can't pass in a
Meter instance.

scala> classOf[Act].getDeclaredConstructors.head.newInstance(new Integer(12))
res24: Any = Act@572db5ee

scala> classOf[Act].getDeclaredConstructors.head.newInstance(new
Meter(12).asInstanceOf[Object])
java.lang.IllegalArgumentException: argument type mismatch
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  ... 32 elided
// NOPE.


// because if effectively is exactly the same as:
scala> class Act2(m: Int)
defined class Act2

scala> classOf[Act2].getDeclaredConstructors.head
res27: java.lang.reflect.Constructor[_] = public Act2(int)

scala>  classOf[Act].getDeclaredConstructors.head.newInstance(new Integer(12))
res28: Any = Act@50f65fe0

scala>  classOf[Act].getDeclaredConstructors.head.newInstance(new
Meter(12).asInstanceOf[Object])
java.lang.IllegalArgumentException: argument type mismatch
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  ... 32 elided


So we’d be forced into guesswork about “hmmm! it has one field, maybe if we
take the field out of that instance it will work!”. Which is weird, so we
choose not to do this.

If you have a solution to this problem I’d love to hear it :-)



-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 20 July 2016 at 17:29:15, Kevin Meredith (kevin.m.mered...@gmail.com)
wrote:

Hi Konrad -

Could you please give me an example that demonstrates the "so we can't ..."?

>AnyVal is a Scala compiler optimisation, so we can't figure out the right
constructor (always / safely) in runtime.

Thanks

On Wednesday, July 20, 2016 at 9:44:33 AM UTC-4, Konrad Malawski wrote:
>
> Because the type (wrapper) is not there at runtime.
> AnyVal is a Scala compiler optimisation, so we can't figure out the right
> constructor (always / safely) in runtime.
>
> A resolution would be to "if thing has one field, and that value matches
> we use that field" which could lead to very weird behaviour sometimes.
>
> --
> Konrad `ktoso` Malawski
> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>
> On 20 July 2016 at 15:40:08, Kevin Meredith (kevin.m@gmail.com
> ) wrote:
>
> Looking at the Akka docs
> <http://doc.akka.io/docs/akka/current/scala/actors.html> for creating an
> Actor:
>
> The recommended approach to create the actor Props is not supported for
> cases when the actor constructor takes value classes as arguments.
>
> Please explain the "is not supported ..." reason.
>
> Per
> http://stackoverflow.com/questions/38400433/function-to-accept-any-type-but-anyval,
> I'm curious.
>
> 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+...@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

Re: [akka-user] How to use WebSockets with ActorPublisher?

2016-07-20 Thread Konrad Malawski
Glad you resolved it.
Related hint is that one really really shouldn't be using ActorPublisher,
you should build stages from GraphStage instead,
the reason is that a) ActorPublisher is not fusable b) it's really hard to
actually implement a *correct* Publisher (even with ActorPublisher's help).

Happy hakking.,

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 20 July 2016 at 16:19:58, Jakub Liska (liska.ja...@gmail.com) wrote:

RESOLVED :

I found a way to create Source and consequently ActorPublisher from
ActorRef, so that I can obtain the ActorRef upfront, so instead of :

val stateChangeSource: Source[PipelineState, ActorRef] = Source.
actorPublisher[PipelineState](StateChangePublisher.props)

I do :

val stateChangePublisher: Publisher[PipelineState] = ActorPublisher[
PipelineState](stateChangePublisherRef)
val stateChangeSource = Source.fromPublisher(stateChangePublisher)

And I can send messages to stateChangePublisherRef and push them to
Browser...

On Wednesday, July 20, 2016 at 4:07:13 PM UTC+2, Konrad Malawski wrote:
>
> Could you provide a sample snippet that we could help out with?
> Context helps to get quicker help.
>
> --
> Konrad `ktoso` Malawski
> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>
> On 20 July 2016 at 16:03:30, Jakub Liska (liska...@gmail.com )
> wrote:
>
> hey,
>
> I hit a deadend with combination of Websockets and ActorPublisher because
> the TextMessage expects Source and one can obtain the underlying ActorRef
> from ActorPublisher only by materializing it :
>
>
> https://github.com/akka/akka/blob/29029be31d9198ed45c73efbc2d0212651882a94/akka-http-core/src/main/scala/akka/http/scaladsl/model/ws/Message.scala#L30
>
> Theoretically one could look it up but then there is a question "when" it
> becomes materialized :-/
> --
> >>>>>>>>>> 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] How to use WebSockets with ActorPublisher?

2016-07-20 Thread Konrad Malawski
Could you provide a sample snippet that we could help out with?
Context helps to get quicker help.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 20 July 2016 at 16:03:30, Jakub Liska (liska.ja...@gmail.com) wrote:

hey,

I hit a deadend with combination of Websockets and ActorPublisher because
the TextMessage expects Source and one can obtain the underlying ActorRef
from ActorPublisher only by materializing it :

https://github.com/akka/akka/blob/29029be31d9198ed45c73efbc2d0212651882a94/akka-http-core/src/main/scala/akka/http/scaladsl/model/ws/Message.scala#L30

Theoretically one could look it up but then there is a question "when" it
becomes materialized :-/
--
>> 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] Creating Actor w/ Props having Value Class Argument(s)

2016-07-20 Thread Konrad Malawski
Because the type (wrapper) is not there at runtime.
AnyVal is a Scala compiler optimisation, so we can't figure out the right
constructor (always / safely) in runtime.

A resolution would be to "if thing has one field, and that value matches we
use that field" which could lead to very weird behaviour sometimes.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 20 July 2016 at 15:40:08, Kevin Meredith (kevin.m.mered...@gmail.com)
wrote:

Looking at the Akka docs
 for creating an
Actor:

The recommended approach to create the actor Props is not supported for
cases when the actor constructor takes value classes as arguments.

Please explain the "is not supported ..." reason.

Per
http://stackoverflow.com/questions/38400433/function-to-accept-any-type-but-anyval,
I'm curious.

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.

-- 
>>  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: Make HTTPS request using akka-http to jenkins server

2016-07-20 Thread Konrad Malawski
Pretty sure there's a stack trace there though?
What happens on default settnigs – dont manually set the JVM default
context.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 20 July 2016 at 14:13:39, Ajinkya Shukla (ajinkyashukl...@gmail.com)
wrote:

I get the following exception in DEBUG mode.

disconnected after javax.net.ssl.SSLHandshakeException: General SSLEngine
problem

On Wednesday, July 20, 2016 at 8:01:04 AM UTC-4, Ajinkya Shukla wrote:
>
> How can i make the following HTTPS request using akka-http to a jenkins
> server?
>
> curl -v -k --user "$USERNAME:$API_TOKEN" https://HOSTNAME.com/api/json
>
> The curl produces the following HTTPS request:
>
> Connected to HOST.com
> * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
> * Server certificate: Default Company Ltd
> * Server auth using Basic with user 'USERNAME'
> > GET /api/json HTTP/1.1
> > Host: HOSTNAME
> > Authorization: Basic API_TOKEN
> > User-Agent: curl/7.43.0
> > Accept: */*
>
> However I am not able to make the above request using akka-http. I get a
> SSL certificate error. Here is my code:
>
>
> import javax.net.ssl.SSLContext
>
> import akka.actor.{Actor, ActorLogging, ActorSystem}
> import akka.http.scaladsl.model._
> import akka.http.scaladsl.model.headers.{Authorization,
> BasicHttpCredentials}
> import akka.http.scaladsl.{Http, HttpsConnectionContext}
> import akka.stream.{ActorMaterializer, ActorMaterializerSettings,
> Materializer}
> import akka.util.ByteString
> import com.typesafe.sslconfig.akka.AkkaSSLConfig
> import com.typesafe.sslconfig.ssl.{SSLConfigSettings, SSLParametersConfig}
>
> import scala.concurrent.Future
>
> class Main extends Actor
>   with ActorLogging {
>
>   import akka.pattern.pipe
>   import context.dispatcher
>
>   implicit val system = ActorSystem("HelloSystem")
>
>   final implicit val materializer: ActorMaterializer =
> ActorMaterializer(ActorMaterializerSettings(context.system))
>
>   val modernHttpsConnectionContext: HttpsConnectionContext = new
> HttpsConnectionContext(
> SSLContext.getDefault,
> enabledProtocols = Some("TLSv1.2" :: "TLSv1.1" :: Nil)
>   )
>
>   class HttpClientSingleCustomHttps(connectionContext:
> HttpsConnectionContext)
>(implicit val system: ActorSystem, val
> mat: Materializer) {
> def sendHttpReq(req: HttpRequest): Future[HttpResponse] =
>   Http().singleRequest(req, connectionContext =
> connectionContext).pipeTo(self)
>   }
>
>   override def preStart() = {
> log.info("Making request")
> val client = new
> HttpClientSingleCustomHttps(modernHttpsConnectionContext)
> val jenkinsRequest: HttpRequest = HttpRequest(
>   uri = "https://HOSTNAME.com/api/json;,
>   headers = List(
> Authorization(BasicHttpCredentials("USERNAME","PASSWORD"))
>   )
> )
> client.sendHttpReq(jenkinsRequest)
>   }
>
>   def receive = {
> case HttpResponse(StatusCodes.OK, headers, entity, _) =>
>   log.info("Got response, body: " +
> entity.dataBytes.runFold(ByteString(""))(_ ++ _))
> case HttpResponse(code, _, _, _) =>
>   log.info("Request failed, response code: " + code)
>   }
>
> }
>
> --
>> 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] Make HTTPS request using akka-http to jenkins server

2016-07-20 Thread Konrad Malawski
Please read:
http://doc.akka.io/docs/akka/2.4.8/scala/http/client-side/client-https-support.html#clientsidehttps
and: http://typesafehub.github.io/ssl-config/

Note that you're using SSLContext.getDefault, pretty sure that's not a good
idea for you.

Also, what's the error? Please post the exception. "Does not work on my
machine" is hard to reproduce or help out with.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 20 July 2016 at 14:00:56, Ajinkya Shukla (ajinkyashukl...@gmail.com)
wrote:

How can i make the following HTTPS request using akka-http to a jenkins
server?

curl -v -k --user "$USERNAME:$API_TOKEN" https://HOSTNAME.com/api/json

The curl produces the following HTTPS request:

Connected to HOST.com
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: Default Company Ltd
* Server auth using Basic with user 'USERNAME'
> GET /api/json HTTP/1.1
> Host: HOSTNAME
> Authorization: Basic API_TOKEN
> User-Agent: curl/7.43.0
> Accept: */*

However I am not able to make the above request using akka-http. I get a
SSL certificate error. Here is my code:


import javax.net.ssl.SSLContext

import akka.actor.{Actor, ActorLogging, ActorSystem}
import akka.http.scaladsl.model._
import akka.http.scaladsl.model.headers.{Authorization,
BasicHttpCredentials}
import akka.http.scaladsl.{Http, HttpsConnectionContext}
import akka.stream.{ActorMaterializer, ActorMaterializerSettings,
Materializer}
import akka.util.ByteString
import com.typesafe.sslconfig.akka.AkkaSSLConfig
import com.typesafe.sslconfig.ssl.{SSLConfigSettings, SSLParametersConfig}

import scala.concurrent.Future

class Main extends Actor
  with ActorLogging {

  import akka.pattern.pipe
  import context.dispatcher

  implicit val system = ActorSystem("HelloSystem")

  final implicit val materializer: ActorMaterializer =
ActorMaterializer(ActorMaterializerSettings(context.system))

  val modernHttpsConnectionContext: HttpsConnectionContext = new
HttpsConnectionContext(
SSLContext.getDefault,
enabledProtocols = Some("TLSv1.2" :: "TLSv1.1" :: Nil)
  )

  class HttpClientSingleCustomHttps(connectionContext:
HttpsConnectionContext)
   (implicit val system: ActorSystem, val
mat: Materializer) {
def sendHttpReq(req: HttpRequest): Future[HttpResponse] =
  Http().singleRequest(req, connectionContext =
connectionContext).pipeTo(self)
  }

  override def preStart() = {
log.info("Making request")
val client = new
HttpClientSingleCustomHttps(modernHttpsConnectionContext)
val jenkinsRequest: HttpRequest = HttpRequest(
  uri = "https://HOSTNAME.com/api/json;,
  headers = List(
Authorization(BasicHttpCredentials("USERNAME","PASSWORD"))
  )
)
client.sendHttpReq(jenkinsRequest)
  }

  def receive = {
case HttpResponse(StatusCodes.OK, headers, entity, _) =>
  log.info("Got response, body: " +
entity.dataBytes.runFold(ByteString(""))(_ ++ _))
case HttpResponse(code, _, _, _) =>
  log.info("Request failed, response code: " + code)
  }

}

--
>> 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] Re: Akka WebSocket as an Api

2016-07-19 Thread Konrad Malawski
Wanted to ask about your considerations for tradeoffs for using Play vs
straight Akka-Http-Stream and Websockets?

Akka is a toolkit. Play is a framework. If it's a "web app" Play would be
better. If it's "raw api" I would recommend Akka HTTP though quite honestly
it's a personal preference thing (either way).

Streaming is more of a 1st class citizen in Akka, it's "somewhat" in Play.


Is this the best forum for such a question; or Quora, or elsewhere?

Yes this is the right forum (or gitter.im/akka/akka) for such light
discussion.


-- 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] Re: actor lookup and restart

2016-07-19 Thread Konrad Malawski
Don't do static global state, it's a bad code smell in general.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 19 July 2016 at 10:05:11, James (breath...@gmail.com) wrote:

Thank you Rob,

Another way is to pass the actorRef  to a static object, which can be
referenced by other instances later. I am wondering which way is better:
pass the actoreRef to a class instance or assign the actoreRef to a static
attribute in an object.

Best,

James



On Tuesday, July 19, 2016 at 4:29:28 AM UTC+8, Rob Crawford wrote:
>
> If the Actor gets restarted, the ActorRef will still be valid. That's one
> of the reasons for ActorRef.
>
> On Monday, July 18, 2016 at 3:16:13 PM UTC-4, James wrote:
>>
>> Hi,
>>
>> The document saying
>>
>> "It is always preferable to communicate with other Actors using their
>> ActorRef instead of relying upon ActorSelection.
>> In all other cases ActorRefs can be provided during Actor creation or
>> initialization, passing them from parent to child or introducing Actors by
>> sending their ActorRefs to other Actors within messages"
>>
>>
>> I am trying to follow this design pattern to pass an actorRef to another
>> class instance. But my question is what happens if this actor gets
>> restarted? Can the class instance get the new actoreRef automatically?
>> What would be the best approach  to handle this issue to have the class
>> instance got the new restarted actorRef automatically?
>>
>> Thank you very much!
>>
>> James
>>
> --
>> 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] Akks in Scala console

2016-07-17 Thread Konrad Malawski
You're missing a bunch of dependencies, you also need akka-actor,
akka-http-experimental, akka-http-core etc.
Please use a proper build tool, like sbt in which you can add:

in build.sbt:

libraryDependencies += "com.typesafe.akka" %%
"akka-http-spray-json-experimental" % "2.4.8"

this will resolve dependencies and you'll be able to say

*sbt console*


happy hakking.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 16 July 2016 at 07:55:49, Sarah Yin (smile.sarah@gmail.com) 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.

-- 
>>  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 Graph Editor tool

2016-07-17 Thread Konrad Malawski
You may enjoy these Omnigraffle stencils:
https://www.graffletopia.com/stencils/1493 by Derek Wyatt

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 16 July 2016 at 17:44:18, Sergey Sopin (sopin1...@gmail.com) wrote:

Hi,

Is there any tool which allows to draw graphs as they were shown in akka
docs? I mean that allows using the same blocks and elements.

Thanks a lot!

Best regards,
Sergey
--
>> 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] SBT dependencies for Akka Sample Twitter Streaming Activator Template

2016-07-17 Thread Konrad Malawski
I'd propose you open a ticket in that persons / projects github repo:
https://github.com/vrcod/akka-sample-twitter-streaming#master

It's more likely to result in some response the nearer to the project this
is communicated.
You also can submit a PR updating the deps, I'm sure the guy would be happy
about such initiative.


SBT dependencies look like they need to be updated for this Activator
Template:
http://www.lightbend.com/activator/template/akka-sample-twitter-streaming

2) The other project libraries need to be available at global Maven repo
which are compiled with Scala v2.12.x to include this bugfix:

https://github.com/akka/akka/issues/19418

1) why do you need Scala 2.12?

2) we do have published those artifacts for 2.12-M5:
http://search.maven.org/#artifactdetails%7Ccom.typesafe.akka%7Cakka-http-experimental_2.12.0-M5%7C2.4.8%7Cjar

2.1) I would not expect many libraries closely follow Milestone releases –
again, looping back to 1) why do you think you need Scala 2.12?

3) I've posted my troubleshooting process to reach that theory in the
comments section here for more details:

http://www.lightbend.com/activator/template/akka-sample-twitter-streaming

Hopefully someone maintaining this template can comment on how to cleanup
the build.sbt?

I'd propose moving this to the repo's github.


-- 

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

-- 
>>  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] problem connecting with TCP for file IO

2016-07-16 Thread Konrad Malawski
Not very online today, may look into it in more depth tomorrow but at a
glance it seems that you complete the connection too eagerly: instead of
Source.empty use Source.maybe (does not immediately send completion;
completion == closing the connection).

Also, you don't need the GraphDSL, you can simply from.via(thingy) etc.

Hope that's it, if not let me know and will have a proper look tomorrow.
Cheers

-- 
Konrad Malawski

From: debasish <ghosh.debas...@gmail.com> <ghosh.debas...@gmail.com>
Reply: akka-user@googlegroups.com <akka-user@googlegroups.com>
<akka-user@googlegroups.com>
Date: 16 July 2016 at 21:59:30
To: Akka User List <akka-user@googlegroups.com> <akka-user@googlegroups.com>
Subject:  [akka-user] problem connecting with TCP for file IO

Hi -
>
> I am using akka-stream 2.4.8 for a use case which used to work properly
> with earlier version of akka-stream (1.x). It has a client that connects
> over TCP, streams a csv file to a server. The server receives the stream,
> parses the csv record and builds some domain object.
>
> The issue that I am facing right now is that the server starts
> successfully. But when I run the client I get exceptions like 
> Failure(akka.stream.StreamTcpException:
> The connection closed with error: Connection reset by peer).
>
> Here's the client code ..
>
> object Client extends App with Logging {
>   implicit val system = ActorSystem("client")
>   val serverConnection = Tcp().outgoingConnection("127.0.0.1", 9982)
>   val path =
> "/Users/debasishghosh/projects/frdomain/src/main/resources/transactions.csv"
>   val readLines =
>   FileIO.fromPath(Paths.get(path))
> .via(Framing.delimiter(ByteString(System.lineSeparator),
> maximumFrameLength = 512, allowTruncation = true))
>   val logWhenComplete = Sink.onComplete(r => logger.info("Transfer
> complete: " + r))
>   val graph = RunnableGraph.fromGraph(GraphDSL.create() { implicit b =>
> import GraphDSL.Implicits._
> readLines ~> serverConnection ~> logWhenComplete
> ClosedShape
>   })
>   implicit val mat = ActorMaterializer()
>   graph.run()
> }
>
> ..and here's the server code ..
>
> class Server(host: String, port: Int)(implicit val system: ActorSystem)
> extends Logging {
>   def run(): Unit = {
> implicit val mat = ActorMaterializer()
> logger.info(s"Receiver: binding to $host:$port")
> Tcp().bind(host, port).runForeach { conn =>
>   val receiveSink =
> conn.flow
> .via(Framing.delimiter(ByteString(System.lineSeparator),
> maximumFrameLength = 512, allowTruncation = true)).map(_.utf8String)
> .map(_.split(","))
> .mapConcat(Transaction(_).toList)
> .to(Sink.foreach[Transaction](println(_)))
>   receiveSink.runWith(Source.empty)
> }
>   }
> }
>
> object Server extends App {
>   implicit val system = ActorSystem("processor")
>   new Server("127.0.0.1", 9982).run()
> }
>
>
> Any help will be appreciated. I have attached the full files for client
> and server in case you want to run. The file path is currently hardcoded
> and needs to be changed there.
>
> 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.
> --
>

-- 
>>>>>>>>>>  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: CORS Support Akka-http

2016-07-14 Thread Konrad Malawski
Use the community provided ones.
There's no need for us to ship one if community has stepped up and provided
libraries, as is the case here I believe :-)

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 14 July 2016 at 15:26:04, Matan Safriel (dev.ma...@gmail.com) wrote:

Any built-in support for CORS by now?

On Friday, September 25, 2015 at 5:20:07 PM UTC+3, Patrik Nordwall wrote:
>
> Thanks for sharing, Patrick.
>
> On Tue, Sep 22, 2015 at 1:42 PM, Patrick Ting  > wrote:
>
>> Hi Everyone,
>>
>> I ended up porting and modifying Ganta's original CORS support with an
>> existing one I had that I pulled from the Spray mailing list awhile back
>> and posted it here: https://gist.github.com/pcting/2e65c36f868c5cee7d6a
>>
>> The most frustrating part was finding a way around the loss of
>> RequestContext.withRouteResponseHandling and
>> RequestContext.withHttpResponseHeadersMapped.
>>
>> Please fork it, poke holes int it, and send feedback!
>>
>> Cheers,
>> Patrick
>>
>> On Monday, August 17, 2015 at 1:40:42 PM UTC-7, Austin Guest wrote:
>>>
>>> Hi Yar. Thanks for getting back! The error message was regarding headers
>>> missing from the *server's* response to the actual POST request (it handled
>>> the "pre-flight" OPTIONS request just fine, which is why I was puzzled.
>>>
>>> I've since resolved the question, as it was a matter (as the blog you
>>> linked to helpfully pointed out) of the wildcard `*` as a value for the
>>> `Allow-Access-Origin` header being incompatible with setting
>>> `Allow-Access-Credentials` to `true`. I temporarily resolved the issue by
>>> disabling access credentials. Thanks for pointing me in the right
>>> direction! :)
>>>
>>> Not the best long-term fix, but necessary for the time being as a
>>> workaround for running locally (since I will always have the origin
>>> 'localhost'. As a longer term fix, I plan on using Chrome's 
>>> Allow-Access-Origin
>>> Dev Tools add-on
>>> ,
>>> which spoofs a '*' header for running locally -- just as soon as I can
>>> figure out how to get my webpack dev server
>>>  to disable
>>> credentials so the the Allow-Access headers won't conflict.
>>>
>>> If anyone's stuck on a similar problem and is interested in results, I'm
>>> happy to post them here. (Though that set of problem solving would belong
>>> more properly on a React mailing list than one pertaining to akka-http! :P)
>>>
>>> /a/
>>>
>>> On Sunday, August 16, 2015 at 5:12:29 AM UTC-4, Yar Ilich wrote:

 Hi,

 pleasure to be of use. I got confused: did client part omit headers
 from POST request? Where did you get the message "No
 'Access-Control-Allow-Origin' header is present on the requested resource."
 from? The problem may be some caveats of using Access-Control-Allow-Origin.
 See http://www.webdavsystem.com/ajax/programming/cross_origin_requests,
 specifically the first Important! box.

 On 16 August 2015 at 10:07, Austin Guest  wrote:

> Great implementation `yar...`!
>
> Question: I borrowed this code in my own implementation but ran into
> an odd problem where it worked just fine on the preflight `OPTIONS`
> request, but then omitted the CORS headers from the subsequent `POST` that
> was getting preflighted, causing the request to be rejected with a 400
> Error. ("No 'Access-Control-Allow-Origin' header is present on the
> requested resource.' etc...)
>
> Here's my version of your impl:
>
> https://github.com/the-learning-collective/whereat-server/blob/dev/src/main/scala/routes/CorsSupport.scala
>
> And here's me using it:
>
> https://github.com/the-learning-collective/whereat-server/blob/master/src/main/scala/routes/Routes.scala#L24
>
> Any idea why I'm getting this error?
>
> I'm using superagent  on
> the client side (which someone had this CORS-related issue
>  with, but I
> think that's a red-herring, since I very much want/need my `content-type`
> to be `application/json`, unlike this user and the proposed solution he
> winds up being offered.)
>
>
>
> On Thursday, June 18, 2015 at 12:23:50 PM UTC-4, yar@gmail.com
> wrote:
>>
>> Hi,
>>
>> I didn't find a counterpart of mapRequestContext in akka-http, so I
>> just allow all the methods I have in my route. Here is my shot at CORS in
>> akka-http:
>>
>> import akka.http.scaladsl.model.HttpMethods._
>> import akka.http.scaladsl.model.HttpResponse
>> import akka.http.scaladsl.model.headers._
>> import akka.http.scaladsl.server.Directives._
>> import 

Re: [akka-user] akka-http receiving file upload without copying the file to memory

2016-07-13 Thread Konrad Malawski
Please check the docs:
http://doc.akka.io/docs/akka/2.4/scala/http/routing-dsl/directives/file-upload-directives/fileUpload.html
And the impl of this directive to gain some more understanding how it works.

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 13 July 2016 at 16:04:14, Simao Mata (sima...@gmail.com) wrote:

Ah, that explains it then.

I am using `formFields('file.as[StrictForm.FileData])` to extract the file
from the form. So is there a way I can get that data and not put it in
memory?

Thanks!


On Wed, Jul 13, 2016, at 16:00, Konrad Malawski wrote:

`Strict` indicates "the entire thing is in memory. (run away before it
blows up!!!)".

How did you get this entity? Normally we don't expose Strict entities, you
likely have converted to it explicitly => thus, loading the entire upload
into memory.
Don't do toStrict or any of these operations, just stream directly into a
file.

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>


On 13 July 2016 at 15:58:22, Simão Mata (sima...@gmail.com) wrote:




Hi,

I would like to ask for a clarification on how `mapMaterializedValue`
works, I think this might be the cause for this problem.

I am trying to receive a large file upload, and I am copying to the file
system using something like:

val sink = FileIO
.toPath(path)
.mapMaterializedValue(_.map(result => (uri, result.count)))

val source = fileData.entity.dataBytes // fileData is a StrictForm.FileData

val f = source.to(sink).run()

This somehow causes the file to be copied to memory, which causes the jvm
to stop with an out of memory exception.

Can `mapMaterializedValue` be the cause for this behaviour?

Thank you,
Simao
--
>>>>>>>>>> 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] General Question on AKKA

2016-07-11 Thread Konrad Malawski
Like we explained many times, Akka Streams is NOT competing with Spark nor
Flink–it's complementing them.
Those are distributed stream processing engines.
Akka Streams is a building block, that could be used to build such.

So the question asked here can be translated as "Hadoop or Iterator?",
where we're Iterator.
And one might be surprised how often a small, focused and fast tool can get
the job done on small to medium data :-)

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 11 July 2016 at 16:51:22, Maatary Okouya (maatarioko...@gmail.com) wrote:

Hi,

I like Akka, Akka Stream and its programing model. I like it better than,
Apache Sparks or Flink, I find it way more flexible. However i wonder if
there is a future plan, to have a framework on top of Akka Stream, that
would allow to manage jobs, submit job and so on, including coming with a
visual interface, working as a service and so on, such as in both flink and
Sparks.

One can definitely build is own framework with Akka. It is a lot of work on
your own, especially with delivery semantics, recovery and so on but it is
not either a monumental task.


I wonder if there is any project in that direction.
--
>> 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] Using WithoutSizeLimit of akka-http on specific route entity than using max-content-length setting at config level

2016-07-11 Thread Konrad Malawski
All directives have proper documentation, please read it:
http://doc.akka.io/docs/akka/2.4.8/scala/http/routing-dsl/directives/misc-directives/withoutSizeLimit.html#example


Happy hakking

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 11 July 2016 at 09:23:56, Narayana Reddy Y (narayana1...@iiitd.ac.in)
wrote:

Hi Akka Members,
  Has any used withoutSizeLimit() of Http entity to
lift the size limit for any specific route than using max-context length
setting at configuration level.

Wish someone provides an example of how to use it.
--
>> 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] Exception during Actor construction

2016-07-11 Thread Konrad Malawski
Please read the cluster docs:
http://doc.akka.io/docs/akka/2.4/java/cluster-usage.html#A_Simple_Cluster_Example

as the error hints at.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 11 July 2016 at 09:23:56, Drisha Roy (drish...@gmail.com) wrote:

hi,
I am getting exception like this. Cant understand why i am getting this
please help.
my akkaVersion = "2.4.4",play 2.5.0

[MQReceiver-akka.actor.default-dispatcher-7]
[akka://MQReceiver/user/TOPIC;actionExchange] null
akka.actor.ActorInitializationException:
akka://MQReceiver/user/TOPIC;actionExchange: exception during
creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:174)
at akka.actor.ActorCell.create(ActorCell.scala:606)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:461)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:483)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
at akka.dispatch.Mailbox.run(Mailbox.scala:223)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at akka.util.Reflect$.instantiate(Reflect.scala:65)
at
akka.actor.ArgsReflectConstructor.produce(IndirectActorProducer.scala:96)
at akka.actor.Props.newActor(Props.scala:213)
at akka.actor.ActorCell.newActor(ActorCell.scala:562)
at akka.actor.ActorCell.create(ActorCell.scala:588)
... 7 more
Caused by: akka.ConfigurationException: ActorSystem [akka://MQReceiver]
needs to have a 'ClusterActorRefProvider' enabled in the configuration,
currently uses [akka.actor.LocalActorRefProvider]
at akka.cluster.Cluster.(Cluster.scala:71)
at akka.cluster.Cluster$.createExtension(Cluster.scala:34)
at akka.cluster.Cluster$.createExtension(Cluster.scala:29)
at
akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:755)
at akka.actor.ExtensionId$class.apply(Extension.scala:79)
at akka.cluster.Cluster$.apply(Cluster.scala:29)
at akka.actor.ExtensionId$class.get(Extension.scala:91)
at akka.cluster.Cluster$.get(Cluster.scala:30)
at akka.cluster.Cluster.get(Cluster.scala)
at controllers.RecvArgv.(RecvArgv.java:42)
... 16 more

[INFO] [07/08/2016 11:32:38.092]
[MQReceiver-akka.actor.default-dispatcher-7]
[akka://MQReceiver/user/TOPIC;actionExchange] Message
[java.lang.String] from
Actor[akka://MQReceiver/user/TOPIC;actionExchange#1160606344]
to
Actor[akka://MQReceiver/user/TOPIC;actionExchange#1160606344]
was not delivered. [1] dead letters encountered. This logging can be turned
off or adjusted with configuration settings 'akka.log-dead-letters' and
'akka.log-dead-letters-during-shutdown'.
--
>> 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] ANNOUNCE: Akka 2.4.8 released!

2016-07-08 Thread Konrad Malawski


Dear hakkers,

we—the Akka committers—are proud to announce a new patch release of Akka 
2.4.

This release contains a number of fixes and improvements spread out across 
many of the Akka modules and the documentation. As usual, this version is a 
drop-in replacement for any previous 2.4.x series version and maintains 
binary compatibility according to the rules outlined here 
<http://doc.akka.io/docs/akka/2.4/common/binary-compatibility-rules.html>.

Some noteworthy changes in the 2.4.8 release are:

   - 
   
   HTTP Connection Pools don’t cache a resolved DNS address forever anymore 
   (which is useful for DNS based service location) (#20690 
   <https://github.com/akka/akka/issues/20690>)
   - 
   
   HTTP Connection Pools can be configured to keep a “hot” number of 
   connections open eagerly, to decrease first-request-on-pool latency 
   significantly (20456 <https://github.com/akka/akka/issues/20456>)
   - 
   
   Ported “Handling Blocking operations” document from an excellent 
   StackOverflow answer 
   
<http://stackoverflow.com/questions/34641861/akka-http-blocking-in-a-future-blocks-the-server/34645097#34645097>
 
   (#20469 <https://github.com/akka/akka/pull/20469>)
   - 
   
   Distributed Data now takes advantage of the WeaklyUp state (#18399 
   <https://github.com/akka/akka/issues/18399>)
   

The full list of changes since the last milestone is available under the 
2.4.8 <https://github.com/akka/akka/milestone/89?closed=1> milestone on 
github for your reference.


Akka Team Blog


As already announced over various other channels earlier this week–we're 
re-launching the Akka Team Blog – “Let it Crash!” <http://blog.akka.io/>! 
If you're interested in some top notch technical content straight from the 
team, we recommend to give it a look (and subscribe).


The content on the blog will be more 'lose', while we keep the news section 
of the page for... news. Please look forward to our new tech posts on the 
blog, and more upcoming release announcements on the news part of the site 
(on http://akka.io/news).


Credits

Thanks to the Community! For this release we had the help of 40 committers.

Especially we would like to thanks the various hakkers who helped migrate 
the Akka Streams internals to the new and awesome GraphStage in a great 
<https://github.com/akka/akka/issues/20466> collaborative 
<https://github.com/akka/akka/issues/20288> effort 
<https://github.com/akka/akka/issues/19361> over the last month. Thanks 
@Hawstein, @gosubpl, @RichardImaoka, @fagossa, @Zhxiaogg, @danxmoran and 
everyone contributing to this effort!

We also would like to give a special thanks to 4 of scalac 
<http://scalac.io>‘s developers (Patryk, Michał, Piotr and Krzysztof) for 
collaborating with us more closely this month. While learning the ropes of 
Akka HTTP internals they were able to contribute some useful and 
challenging features–we’re hoping to see more of those in the future. 
Thanks a lot!


Credits:

commits added removed

  121292 176 Konrad Malawski

   71251  41 Hawstein

   5 314  41 Patrik Nordwall

   4  81  23 Endre Sándor Varga

   4 758  35 gosubpl

   3  97  10 Richard Imaoka

   3 317  46 Patryk Jażdżewski (scalac)

   3 603  78 Michal Sitko (scalac)

   2 692  12 Felix Satyaputra

   2 251 190 Kam Kasravi

   2 101  17 Johan Andrén

   2 121 115 Daniel Moran

   2 312   6 Alexander Golubev

   2 222   6 Piotr Krzemiński (scalac)

   2  18   4 Martynas Mickevicius

   1  22   1 kbrowder

   1  15   2 netcomm

   1  32  17 Chris Birchall

   1  21   0 Jan Ypma

   1  18   8 miaoqian

   1   2   2 Arnout Engelen

   1  32  27 monkey-mas

   1   6   0 Christian Hoffmeister

   1  63   0 Simão Martins

   1   6   6 Nafer Sanabria

   1 147   1 Krzysztof Wyczesany (scalac)

   1   5   5 Stefano Bonetti

   1 135  81 zhxiaog

   1  42   0 Robert Budźko

   1  47  18 Bernard Leach

   1  23   8 poojadshende

   1   2   1 Richard S. Imaoka

   1  38   6 Ben Barnard

   1  14   3 Tobias Pfeifer

   1 334  12 Fabian Gutierrez

   1   5   1 Kevin Deng

   1  21  21 Andrea Peruffo

   1  40  29 Michał Płachta

   1  31   1 Denis Rosca


Happy hakking!


-- The Akka Team





-- 
>>>>>>>>>>  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 &qu

Re: [akka-user] Re: [ANNOUNCE] Announcing the new Akka Team Blog (Let it Crash!)

2016-07-06 Thread Konrad Malawski
I added some rel links, that's likely it.
Thanks for rasing the issue :)
On Jul 6, 2016 19:59, "Andrew Gaydenko"  wrote:

> Thanks!
> At that moment for some reason Firefox hasn't found the refs. Now it does.
> Sorry for noise.
>
> --
> >> 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/_t8E0khAnJ8/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.


[akka-user] [ANNOUNCE] Announcing the new Akka Team Blog (Let it Crash!)

2016-07-06 Thread Konrad Malawski
Dear hakkers,
We're very excited to be able to introduce the new and fresh Akka Team Blog!

It's available here: blog.akka.io

And we've already kick started it with 2 posts:
- An Akka Community Update (July 2016)
 in
which we discuss the way forward for various Akka related projects, and our
ambitions to grow the community even even stronger than it is now (you're
all awesome, thanks!)
- And the first in a series of upcoming "internals and details" posts about
Akka Streams: Threading & Concurrency in Akka Streams Explained (part I)



The blog will mostly feature technical high quality content straight from
the core team.
We also have plans to keep blogging on it as part of our routine, so expect
some "feature spotlights" and other posts in the future.


The blog's sources are hosted here: http://github.com/akka/blog so if you
see anything that needs fixing please let us know there or submit a PR
right away.


Happy hakking!

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

-- 
>>  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/Spray CPU usage is 100%

2016-06-06 Thread Konrad Malawski
I'd suggest moving over to Akka HTTP (as Spray hasn't been developed since 
2 years or so).
See Akka documentation for using Akka HTTP

-- Konrad

On Monday, 6 June 2016 18:45:03 UTC+2, abhishek jain wrote:
>
> I have created a very basic Restful service in Spary. Locally it is all 
> working fine.
>
>
> But when I deployed it onto the server (2 core), I am seeing CPU usage at 
> 100%.
>
>
> The usage peaks to 100% for a few seconds when I try to start the 
> application. An d when I post any request to the service end-point, the CPU 
> usage peaks to 100% for a few minutes.
>
>
> Please see the below code
>
>
> object Boot {
>  def main(args: Array[String]): Unit = {
>  implicit val system = ActorSystem("on-spray-can")
>  val service = system.actorOf(Props[AuditorServiceActor], "AuditorActor")
>  val config = ConfigFactory.load()
>  implicit val timeout = Timeout(120.seconds)
>  IO(Http) ? Http.Bind(service, config.getString("http.interface"),  
> config.getInt("http.port"))
>   }}
>
> class AuditorServiceActor extends Actor with AuditorService {
>  def actorRefFactory = context
>  def receive = runRoute(myRoute)}
>
>

-- 
>>  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: Akka-Http perf difference chunked vs non-chunked

2016-06-03 Thread Konrad Malawski
Right we have a ticket that sounds rather similar I believe (auto
toStricting up unto a given limit), I agree it's a good idea.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 3 June 2016 at 11:21:00, daleksan (david.aleksandrow...@gmail.com) wrote:

I can confirm that changing the HTTP client to curl does fix the issue. I
can see much bigger buffers used in this case.

This answers my question however I would say Akka-Http still should be
guarded from such case (i.e. never emit such small buffers, due to profound
performance degradation, no matter how client is sending the data).

Thank you so much for you help!

 David


--
>> 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] Considerations when pushing millions of messages through DistributedPubSub?

2016-06-02 Thread Konrad Malawski
(Which is the reason we're currently re-implementing remoting, to be able
to survive rates of up to a million per second - more on
github.com/akka/akka-meta).

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 2 June 2016 at 22:20:24, loe...@posteo.de (loe...@posteo.de) wrote:

I think with 100.000 msg/sec you are going to overload Akka Remote. You
might want to consider accumulating events thereby reducing the frequency.

Heiko

--

*Heiko Seeberger*
Home: heikoseeberger.de
Twitter: @hseeberger 
Public key: keybase.io/hseeberger

On 02 Jun 2016, at 21:09, kraythe  wrote:

Greetings,

I am wiring together some actors using distributed pub-sub. Basically I
have actors that are broadcasting their state change. These updates will be
in the millions and be received by multiple actor subscribers per node.
Given that there are millions of these potential updates per minute, are
there any considerations that I should keep in mind when implementing the
system? Thanks in advance.

-- Robert

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

-- 
>>  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] Using Akka HTTP and another lib that also requires an ActorSystem

2016-06-02 Thread Konrad Malawski
Don't use objects ;-)

Use classes, and pass the system around to those who need it.

class MyRepo(system: ActorSystem) { ... }

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 2 June 2016 at 12:33:23, Luciano Molinari (lucmolin...@gmail.com) wrote:

Hi all,

I'm creating a small project using Akka Http and I'm creating an Actor
System for it, as per documentation.

In this project, I'm also using another lib (rediscala) that requires an
Actor System instance as well. So, more or less like this:

MyRest.scala
trait MyRest extends MyJsonProtocol {

  val route: Route = ...

MyRepository.dosomething(..)

MyRepository.scala
object MyRepository {

  implicit val system = ActorSystem("repository-system")

  val redis = RedisClient()
  ...

MyAppServer.scala
object MyAppServer extends App with MyRest {

  implicit val system = ActorSystem("my-system")
  implicit val materializer = ActorMaterializer()
  implicit val executionContext = system.dispatcher

  val bindingFuture = Http().bindAndHandle(route, "localhost", 8080)

  println(s"The server is ready to handle HTTP requests")
  StdIn.readLine
  bindingFuture
.flatMap(_.unbind())
.onComplete(_ => system.terminate())

}


In this situation 2 actor systems are being created, one for Akka Http and
one for RedisClient. I'm aware ActorSystem is a heavy object to be created,
so I'm wondering if there's some alternate approach/pattern of this is OK.

Thanks and regards,
Luciano

--
>> 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 directive for uploading multiple files

2016-06-02 Thread Konrad Malawski
Look into the implementation of the directive and extend it for multiple
I'd say.
We'd be very happy to accept a PullRequest with such feature!

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 2 June 2016 at 08:25:43, Leo Wolf (leo.lai.w...@gmail.com) wrote:

Hi, I'm using akka http for file uploading as bellow:
formFields('json.as[String]) { json =>

  uploadedFile("file") {

...

}


And it works fine if I upload one file at a time. But I want to upload
multiple different files in a http request, and how can I get it with the
uploadedFile("file") directive? As now I always got the last file for
uploading while multiple files are sent to the server by rest client.

Thank you.


--
>> 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] Am I Reinventing the Wheel?

2016-06-01 Thread Konrad Malawski
I was working on a supervisor that lazy creates actors based on some key
and then will forward messages to that actor.

That's Cluster Sharding :-)

http://doc.akka.io/docs/akka/snapshot/scala/cluster-sharding.html

Technically you can use it on one node too, yeah.


Happy hAkking!
-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

-- 
>>  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] spray cache and akka http

2016-06-01 Thread Konrad Malawski
I made a ticket for it, we'd happily someone do the porting / contribution:
https://github.com/akka/akka/issues/20679

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 1 June 2016 at 09:48:12, Mohnish Kodnani (mohnish.kodn...@gmail.com)
wrote:

Hi,
We have a project where we need to talk to hadoop/hdfs to download some
files from it. This requires that we have protobuf 2.5.0. This is a new
cluster for us and before this the older hadoop version was using protobuf
2.4.0
We were using spray 1.3 and akka 2.3 and things were working fine. But now
the same service is failing due to incompatible protobuf dependencies.
I tried to upgrade our project to akka 2.4.6 because I read that akka 2.4.x
allows clients to specify their own protobuf version.
However, our service was using spray cache on top of the routes and I have
not seen any example of caching directives in akka http and if I include
spray cache dependency along with akka-http it doesnt go well, because the
cache directive expect spray.routing.RequestContext => Unit, while the
internal route that we have is akka.http.scaladsl.server.RequestContext =>
akka.http.scaladsl.RouteResult

Is spray cache migrating to akka-http ?


Thanks
Mohnish

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


<    1   2   3   4   5   6   7   8   9   10   >