[akka-user] Akka Java Future onSuccess and onFail run on which thread context

2014-12-04 Thread Wanghong Li
dear all,
I have two actor A and B. When A send a message to B and must wait for 
response. And I know I can use ask to implement this. But it will block the 
thread. So future.onSuccess and future.onFailure must be a good way. I 
don't know the callback onSuccess or onFailure runs on A or B's thread 
context, even I should invoke  akka.pattern.Patterns.pipe(future, system.
dispatcher()).to(actor) to switch to A's context.

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] erlang OTP tracing improvements, doc

2014-12-04 Thread Konrad Malawski
A friend sent me this design doc about tracing changes in erlang:
https://github.com/erlang/otp/blob/maint/erts/emulator/internal_doc/Tracing.md

Might be interesting to us

-- 
Cheers,
Konrad 'ktoso' Malawski
hAkker @ 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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Maven, scala, akka - version mismatch

2014-12-04 Thread David
Yes, thanks very much.

On Thursday, December 4, 2014 2:03:38 AM UTC-5, Adam wrote:

 Try running mvn dependency:tree (before and after commenting out). 
 It will show you exactly how you get each library. 
 Most probably you're getting akka 2.3.X for scala 2.11 as a transitive 
 dependency.

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Akka HTTP client closing connection early

2014-12-04 Thread Tom Eccles
I'm trying to use Akka HTTP to write an HttpClient to send a single request 
and receive a response. My current approach is the following method, having 
set up an OutgoingConnection:

  private def sendRequest(request: HttpRequest, connection: 
Http.OutgoingConnection): Future[HttpResponse] = {
Source(List(request - 
'NoContext)).runWith(Sink(connection.requestSubscriber))

Source(connection.responsePublisher).map(_._1).runWith(Sink.head[HttpResponse])
  }

In the resulting TCP stream, I see the client send the HTTP request as 
expected, immediately followed by a TCP [FIN, ACK] packet. This causes the 
server to immediately reply with its own [FIN, ACK], closing the connection 
without sending a response.

Am I using the OutgoingConnection wrong, or is this a problem 
with Akka HTTP?

Strangely, I do get an HttpResponse when making requests to servers running 
with Akka HTTP - they respond despite the early FIN.

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] akka - zeromq - cannot run even a simple toy program.

2014-12-04 Thread Akka Team
Hi Ankit,

It seems like your VM exits prematurely, and have some issue with loading
the native library. Akka zeroMQ now has this dependency:

org.spark-project.zeromq %% zeromq-scala-binding % 0.0.7-spark //
ApacheV2

I guess that your zeroMQ scala-binding version simply clashes with this
dependency.

-Endre

On Wed, Dec 3, 2014 at 6:30 AM, ankit master ankit.mas...@gmail.com wrote:

 Thank you again for you reply Victor. I referred the tests you pointed me
 at and I also consulted the Akka docs but none seem to help me in
 troubleshooting my issue.

 I even tried downloading some examples from github (apparently these
 examples are working examples) when I run these examples I land in the same
 situation, where my output is  Connecting (akka.zeromq.Connecting)



 On Tue, Dec 2, 2014 at 1:27 PM, √iktor Ҡlang viktor.kl...@gmail.com
 wrote:

 Hi Ankit,

 have a look at this section of the 0mq Akka tests:
 https://github.com/akka/akka/blob/release-2.3/akka-zeromq/src/test/scala/akka/zeromq/ConcurrentSocketActorSpec.scala#L49

 Did you consult this part of the Akka documentation:
 http://doc.akka.io/docs/akka/2.3.7/scala/zeromq.html#Publisher-Subscriber_Connection

 On Tue, Dec 2, 2014 at 10:19 PM, ankit master ankit.mas...@gmail.com
 wrote:

 Hello,

 Thank you very much for all your help, I was earlier using zeromq
 version 4.1 but downgraded it to 2.2 yesterday. Now my problem is that
 everytime when I run my example it always enters the case of connecting.
 Please advise if more information is needed.

 import akka.util.ByteString
 import akka.zeromq._
 import akka.actor._
 import scala.concurrent.duration._
 import scala.concurrent.ExecutionContext.Implicits.global


 class Sub extends Actor{
   def receive  = {
 //case m:ZMQMessage if m.frames(0).utf8String == hello =
 println(m.frames(1).toString())
 case m:ZMQMessage = println(* from subscriber
 *) //;println(m.frames(1).toString())

 case ss :String = println (  some string appeared )

 case Connecting = println(connection issue)

 case default = println(sRunning default case -- Unexpected value
 $default)

 }
 }


 class Pub extends Actor{

   //creates a publisher socket bound to host at port 1235
   val pubSocket =
 ZeroMQExtension(context.system).newSocket(SocketType.Pub, Bind(tcp://
 127.0.0.1:1234))

   def receive={
 case msg:String =
   //println(sGot Message $msg)
   pubSocket ! ZMQMessage(ByteString(hello), ByteString(this is
 test message))
   }
 }

 object main extends App {

   println(Starting App.)

   val system = ActorSystem(system)

   val pubActor = system.actorOf(Props[Pub])
   val subActor = system.actorOf(Props[Sub])

   val subSocket = ZeroMQExtension(system).newSocket(SocketType.Sub,
 Listener(subActor), Connect(tcp://127.0.0.1:1234), SubscribeAll)

   system.scheduler.schedule(10 seconds, 0 minutes)(pubActor ! Message
 to Pub)

   println(Exiting main.)
 }



 
 my build.sbt

 name := Akka ZeroMQ Example

 version := 1.0

 scalaVersion := 2.10.4


 val akkaV = 2.3.6

 resolvers += Typesafe Repository at 
 http://repo.typesafe.com/typesafe/releases/;

 resolvers += Sonatype (releases) at 
 https://oss.sonatype.org/content/repositories/releases/;

 libraryDependencies += org.zeromq %% zeromq-scala-binding % 0.0.6

 libraryDependencies += com.typesafe.akka %% akka-actor % akkaV

 libraryDependencies += com.typesafe.akka %% akka-zeromq % akkaV

 libraryDependencies += com.typesafe.akka %% akka-remote % akkaV



 
 output of the above program,

 info] Running main
 Starting App.
 [DEBUG] [12/02/2014 13:18:48.481] [run-main]
 [EventStream(akka://system)] logger log1-Logging$DefaultLogger started
 [DEBUG] [12/02/2014 13:18:48.482] [run-main]
 [EventStream(akka://system)] Default Loggers started
 OpenJDK 64-Bit Server VM warning: You have loaded library
 /tmp/jna7595689729881225335.tmp which might have disabled stack guard. The
 VM will try to fix the stack guard now.
 It's highly recommended that you fix the library with 'execstack -c
 libfile', or link it with '-z noexecstack'.
 Exiting main.
 connection issue
  Output



 On Tuesday, December 2, 2014 12:10:44 AM UTC-8, √ wrote:

 Hi Ankit,

 You omitted the version of 0mq you are using, did you check the docs
 for supported versions?

 Cheers,
 V
 On 1 Dec 2014 23:02, ankit master ankit@gmail.com wrote:

 

Re: [akka-user] Mixing akka 2.10 and 2.11 builds in a remoting context

2014-12-04 Thread Akka Team
Hi Steffen,

If the JavaSerializer is not used for remoting serialization I think it
will work (given that the two systems has the same Akka version). Java
serialization formats change between scala releases, but everything that is
serialized through protocol buffers should work. Currently this is not
officially supported and even if it happens to work, we have not tests that
would prevent us from breaking it. We are planning to support such
heterogeneous systems in the future.

-Endre

On Wed, Dec 3, 2014 at 2:09 PM, Steffen Kram s...@kram.io wrote:

 Hi hAkkers,

 is it possible to mix the scala 2.10 and 2.11 builds of akka 2.3.7 in a
 remoting context?

 My application uses scala 2.11 and hence I included the 2.11 build of akka
 2.3. Now, I want to use an embedded neo4j, that is build against scala
 2.10.4. However neo4j will only be used in a remote part as a separate
 analysis worker. It would be no problem to build only this part against
 2.10 and leave the rest of the application on 2.11.

 Is this going to work or do I run into (de)serialization issues? Has
 anyone already done something like this?

 Cheers, Steffen

 --
   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 http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




-- 
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Akka Java Future onSuccess and onFail run on which thread context

2014-12-04 Thread Akka Team
Hi,

onSuccess or onFailure runs on any of the threads that are available in the
underlying ExecutionContext. An actor does not have a thread, although it
gets one for execution when there are messages to process, but then it
gives back that thread to the underlying pool. You should definitely not
Await on the future you have, but you should use the pipe mechanism to send
the result to the actor: myFuture.pipeTo(self)

Then the actor will get the result as a message when the future has been
completed. If there was a faillure, it will get an akka.actor.Failure
message with the failure cause included (
http://doc.akka.io/api/akka/2.3.7/#akka.actor.Status$$Failure).

In general it is recommended to use message sends instead of ask. Actor A
can simply send a message: B ! RequestSomething
Then actor A can handle the reply as a normal message in the receive block.

-Endre

On Thu, Dec 4, 2014 at 10:41 AM, Wanghong Li yuanhong1...@gmail.com wrote:

 dear all,
 I have two actor A and B. When A send a message to B and must wait for
 response. And I know I can use ask to implement this. But it will block the
 thread. So future.onSuccess and future.onFailure must be a good way. I
 don't know the callback onSuccess or onFailure runs on A or B's thread
 context, even I should invoke  akka.pattern.Patterns.pipe(future, system.
 dispatcher()).to(actor) to switch to A's context.

 --
  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 http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




-- 
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] [ANNOUNCE] Akka Streams HTTP 1.0 MILESTONE 1

2014-12-04 Thread Roland Kuhn
Dear hakkers,

we are very pleased to announce the availability of the first milestone release 
of the upcoming Akka Streams and Akka HTTP modules. The significance of this 
milestone is that we have roughly reached feature parity with Spray (sans 
spray-servlet that we will not port) and the underlying streams are mature 
enough to take a closer look at their API.

It is important to note that we have focused entirely on the API and its 
semantics, performance has not yet been optimized. Any benchmarks done at this 
point are likely to be invalidated within weeks as we continue to work on these 
projects. (Nevertheless we find it performant enough to play around with, so 
don’t hold back!)

So, what is it that we are so excited about? Place a dependency on 
com.typesafe.akka % akka-stream-experimental_2.11 % 1.0-M1 (also 
available for Scala 2.10) into your build definition and you can write an echo 
server implementation like so:

val toUppercase = Flow[ByteString].map(bs = 
bs.map(_.toChar.toUpper.asInstanceOf[Byte]))

StreamTcp().bind(serverAddress).connections.foreach { conn =
  println(Client connected from:  + conn.remoteAddress)
  conn handleWith toUppercase
}

and then you can connect to this server and use it as an uppercase service:

val result: Future[ByteString] =
  Source(testInput)
  .via(StreamTcp().outgoingConnection(serverAddress).flow)
  .fold(ByteString()) { (acc, in) ⇒ acc ++ in }

This will of course return a Future in order to keep everything nicely 
asynchronous and non-blocking. For more details you can take a look at the API 
docs (for Java 
http://doc.akka.io/japi/akka-stream-and-http-experimental/1.0-M1/ and Scala 
http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-M1/#package). On 
the HTTP front we kept the routing DSL very close to the one you know from 
spray-routing, and we supplemented it with a nice Java DSL as well (for the 
full program see here 
https://github.com/akka/akka/blob/akka-stream-and-http-experimental-1.0-M1/akka-http-java-tests/src/main/java/akka/http/server/japi/examples/simple/SimpleServerApp.java,
 you’ll need to add akka-http-java-experimental_2.11 as dependency):

route(
// matches the empty path
pathSingleSlash().route(
getFromResource(web/calculator.html)
),
// matches paths like this: /add?x=42y=23
path(add).route(
handleWith(addHandler, x, y)
),
// matches paths like this: /multiply/{x}/{y}
path(multiply, xSegment, ySegment).route(
// bind handler by reflection
handleWith(SimpleServerApp.class, multiply, xSegment, ySegment)
)
)

You can find examples also in Activator templates (for Java 
https://typesafe.com/activator/template/akka-stream-java8 and Scala 
https://typesafe.com/activator/template/akka-stream-scala).

Over the next weeks we will continue to work on smoothing out kinks and edges, 
in particular those that you—dear reader—report, either on this mailing list or 
via github issues https://github.com/akka/akka/issues/new. Prominent features 
that are yet to be done are SSL support and WebSockets, for an exhaustive list 
you can check our ticket list 
https://github.com/akka/akka/issues?q=is:open+is:issue+milestone:streams-1.0. 
The plan is to reach feature completeness and adequate performance around 
February 2015, so stay tuned!

Regards,

Dr. Roland Kuhn
Akka Tech Lead
Typesafe http://typesafe.com/ – Reactive apps on the JVM.
twitter: @rolandkuhn
 http://twitter.com/#!/rolandkuhn

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: [akka-dev] [ANNOUNCE] Akka Streams HTTP 1.0 MILESTONE 1

2014-12-04 Thread Jonas Bonér
Awesome. This is huge. Great job guys.

On Thu, Dec 4, 2014 at 6:08 PM, Roland Kuhn goo...@rkuhn.info wrote:

 Dear hakkers,

 we are very pleased to announce the availability of the first milestone
 release of the upcoming Akka Streams and Akka HTTP modules. The
 significance of this milestone is that we have roughly reached feature
 parity with Spray (sans spray-servlet that we will not port) and the
 underlying streams are mature enough to take a closer look at their API.

 *It is important to note that we have focused entirely on the API and its
 semantics, performance has not yet been optimized. Any benchmarks done at
 this point are likely to be invalidated within weeks as we continue to work
 on these projects.* (Nevertheless we find it performant enough to play
 around with, so don’t hold back!)

 So, what is it that we are so excited about? Place a dependency on
 com.typesafe.akka % akka-stream-experimental_2.11 % 1.0-M1 (also
 available for Scala 2.10) into your build definition and you can write an
 echo server implementation like so:

 val toUppercase = Flow[ByteString].map(bs = bs
 .map(_.toChar.toUpper.asInstanceOf[Byte]))

 StreamTcp().bind(serverAddress).connections.foreach { conn =
   println(Client connected from:  + conn.remoteAddress)
   conn handleWith toUppercase
 }

 and then you can connect to this server and use it as an uppercase service:

 val result: Future[ByteString] =
   Source(testInput)
   .via(StreamTcp().outgoingConnection(serverAddress).flow)
   .fold(ByteString()) { (acc, in) ⇒ acc ++ in }

 This will of course return a Future in order to keep everything nicely
 asynchronous and non-blocking. For more details you can take a look at the
 API docs (for Java
 http://doc.akka.io/japi/akka-stream-and-http-experimental/1.0-M1/ and
 Scala
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-M1/#package).
 On the HTTP front we kept the routing DSL very close to the one you know
 from spray-routing, and we supplemented it with a nice Java DSL as well (for
 the full program see here
 https://github.com/akka/akka/blob/akka-stream-and-http-experimental-1.0-M1/akka-http-java-tests/src/main/java/akka/http/server/japi/examples/simple/SimpleServerApp.java,
 you’ll need to add akka-http-java-experimental_2.11 as dependency):

 route(
 // matches the empty path
 pathSingleSlash().route(
 getFromResource(web/calculator.html)
 ),
 // matches paths like this: /add?x=42y=23
 path(add).route(
 handleWith(addHandler, x, y)
 ),
 // matches paths like this: /multiply/{x}/{y}
 path(multiply, xSegment, ySegment).route(
 // bind handler by reflection
 handleWith(SimpleServerApp.class, multiply, xSegment,
 ySegment)
 )
 )

 You can find examples also in Activator templates (for Java
 https://typesafe.com/activator/template/akka-stream-java8 and Scala
 https://typesafe.com/activator/template/akka-stream-scala).

 Over the next weeks we will continue to work on smoothing out kinks and
 edges, in particular those that you—dear reader—report, either on this
 mailing list or via github issues
 https://github.com/akka/akka/issues/new. Prominent features that are
 yet to be done are SSL support and WebSockets, for an exhaustive list you
 can check our ticket list
 https://github.com/akka/akka/issues?q=is:open+is:issue+milestone:streams-1.0.
 The plan is to reach feature completeness and adequate performance around
 February 2015, so stay tuned!

 Regards,

 *Dr. Roland Kuhn*
 *Akka Tech Lead*
 Typesafe http://typesafe.com/ – Reactive apps on the JVM.
 twitter: @rolandkuhn
 http://twitter.com/#!/rolandkuhn

  --
 You received this message because you are subscribed to the Google Groups
 Akka Developer List group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to akka-dev+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
*Jonas Bonér*
Home: jonasboner.com
Twitter: @jboner https://twitter.com/jboner
Public Key: keybase.io/jonas

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Akka HTTP client closing connection early

2014-12-04 Thread Akka Team
Hi Tom,

There wasn't a fully operating Http Client in 0.11 only some initial parts.
Please wait for the 1.0-M1 version which comes with a fresh new API and a
proper client. The new version is just around the corner ;)

-Endre

On Thu, Dec 4, 2014 at 4:27 PM, Tom Eccles eccles@gmail.com wrote:

 I'm trying to use Akka HTTP to write an HttpClient to send a single
 request and receive a response. My current approach is the following
 method, having set up an OutgoingConnection:

   private def sendRequest(request: HttpRequest, connection:
 Http.OutgoingConnection): Future[HttpResponse] = {
 Source(List(request -
 'NoContext)).runWith(Sink(connection.requestSubscriber))

 Source(connection.responsePublisher).map(_._1).runWith(Sink.head[HttpResponse])
   }

 In the resulting TCP stream, I see the client send the HTTP request as
 expected, immediately followed by a TCP [FIN, ACK] packet. This causes the
 server to immediately reply with its own [FIN, ACK], closing the connection
 without sending a response.

 Am I using the OutgoingConnection wrong, or is this a problem
 with Akka HTTP?

 Strangely, I do get an HttpResponse when making requests to servers
 running with Akka HTTP - they respond despite the early FIN.

 --
  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 http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




-- 
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Akka HTTP client closing connection early

2014-12-04 Thread Konrad 'ktoso' Malawski
And one minute afterwards… 1.0-M1 released!

See details in the announcement email :-)


Happy hakking!

-- 
Konrad 'ktoso' Malawski
hAkker @ typesafe
http://akka.io

On 4 December 2014 at 18:11:17, Akka Team (akka.offic...@gmail.com) wrote:

Hi Tom,

There wasn't a fully operating Http Client in 0.11 only some initial parts. 
Please wait for the 1.0-M1 version which comes with a fresh new API and a 
proper client. The new version is just around the corner ;)

-Endre

On Thu, Dec 4, 2014 at 4:27 PM, Tom Eccles eccles@gmail.com wrote:
I'm trying to use Akka HTTP to write an HttpClient to send a single request and 
receive a response. My current approach is the following method, having set up 
an OutgoingConnection:

  private def sendRequest(request: HttpRequest, connection: 
Http.OutgoingConnection): Future[HttpResponse] = {
    Source(List(request - 
'NoContext)).runWith(Sink(connection.requestSubscriber))
    
Source(connection.responsePublisher).map(_._1).runWith(Sink.head[HttpResponse])
  }

In the resulting TCP stream, I see the client send the HTTP request as 
expected, immediately followed by a TCP [FIN, ACK] packet. This causes the 
server to immediately reply with its own [FIN, ACK], closing the connection 
without sending a response.

Am I using the OutgoingConnection wrong, or is this a problem with Akka HTTP?

Strangely, I do get an HttpResponse when making requests to servers running 
with Akka HTTP - they respond despite the early FIN.
--
 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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam
--
 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 http://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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: [akka-dev] [ANNOUNCE] Akka Streams HTTP 1.0 MILESTONE 1

2014-12-04 Thread √iktor Ҡlang
Congrats everyone,
it looks awesome!

On Thu, Dec 4, 2014 at 6:08 PM, Roland Kuhn goo...@rkuhn.info wrote:

 Dear hakkers,

 we are very pleased to announce the availability of the first milestone
 release of the upcoming Akka Streams and Akka HTTP modules. The
 significance of this milestone is that we have roughly reached feature
 parity with Spray (sans spray-servlet that we will not port) and the
 underlying streams are mature enough to take a closer look at their API.

 *It is important to note that we have focused entirely on the API and its
 semantics, performance has not yet been optimized. Any benchmarks done at
 this point are likely to be invalidated within weeks as we continue to work
 on these projects.* (Nevertheless we find it performant enough to play
 around with, so don’t hold back!)

 So, what is it that we are so excited about? Place a dependency on
 com.typesafe.akka % akka-stream-experimental_2.11 % 1.0-M1 (also
 available for Scala 2.10) into your build definition and you can write an
 echo server implementation like so:

 val toUppercase = Flow[ByteString].map(bs = bs
 .map(_.toChar.toUpper.asInstanceOf[Byte]))

 StreamTcp().bind(serverAddress).connections.foreach { conn =
   println(Client connected from:  + conn.remoteAddress)
   conn handleWith toUppercase
 }

 and then you can connect to this server and use it as an uppercase service:

 val result: Future[ByteString] =
   Source(testInput)
   .via(StreamTcp().outgoingConnection(serverAddress).flow)
   .fold(ByteString()) { (acc, in) ⇒ acc ++ in }

 This will of course return a Future in order to keep everything nicely
 asynchronous and non-blocking. For more details you can take a look at the
 API docs (for Java
 http://doc.akka.io/japi/akka-stream-and-http-experimental/1.0-M1/ and
 Scala
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-M1/#package).
 On the HTTP front we kept the routing DSL very close to the one you know
 from spray-routing, and we supplemented it with a nice Java DSL as well (for
 the full program see here
 https://github.com/akka/akka/blob/akka-stream-and-http-experimental-1.0-M1/akka-http-java-tests/src/main/java/akka/http/server/japi/examples/simple/SimpleServerApp.java,
 you’ll need to add akka-http-java-experimental_2.11 as dependency):

 route(
 // matches the empty path
 pathSingleSlash().route(
 getFromResource(web/calculator.html)
 ),
 // matches paths like this: /add?x=42y=23
 path(add).route(
 handleWith(addHandler, x, y)
 ),
 // matches paths like this: /multiply/{x}/{y}
 path(multiply, xSegment, ySegment).route(
 // bind handler by reflection
 handleWith(SimpleServerApp.class, multiply, xSegment,
 ySegment)
 )
 )

 You can find examples also in Activator templates (for Java
 https://typesafe.com/activator/template/akka-stream-java8 and Scala
 https://typesafe.com/activator/template/akka-stream-scala).

 Over the next weeks we will continue to work on smoothing out kinks and
 edges, in particular those that you—dear reader—report, either on this
 mailing list or via github issues
 https://github.com/akka/akka/issues/new. Prominent features that are
 yet to be done are SSL support and WebSockets, for an exhaustive list you
 can check our ticket list
 https://github.com/akka/akka/issues?q=is:open+is:issue+milestone:streams-1.0.
 The plan is to reach feature completeness and adequate performance around
 February 2015, so stay tuned!

 Regards,

 *Dr. Roland Kuhn*
 *Akka Tech Lead*
 Typesafe http://typesafe.com/ – Reactive apps on the JVM.
 twitter: @rolandkuhn
 http://twitter.com/#!/rolandkuhn

  --
 You received this message because you are subscribed to the Google Groups
 Akka Developer List group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to akka-dev+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
Cheers,
√

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


[akka-user] Re: [ANNOUNCE] Akka Streams HTTP 1.0 MILESTONE 1

2014-12-04 Thread Ivan Topolnjak
Congratulations guys! I'm super excited to see this out and to start 
playing with it :), keep rocking!

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.