[akka-user] Re: Reasons why Logback is recommended for Akka logging

2015-05-21 Thread monika singhal
Anyone tried log4j2 with Akka ? 

Thanks,
Monika


-- 
>>  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] Re: Reasons why Logback is recommended for Akka logging

2015-05-21 Thread Patrik Nordwall
I have not tried it, but here is something that you might find useful:
https://github.com/hseeberger/akka-log4j

An alternative is to use log4j2 with the slf4j binding and the Akka slf4j
logger.

/Patrik

On Thu, May 21, 2015 at 9:54 AM, monika singhal 
wrote:

> Anyone tried log4j2 with Akka ?
>
> Thanks,
> Monika
>
>
>  --
> >> 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.
>



-- 

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


[akka-user] Can an ActorPublisher put back pressure on the sender?

2015-05-21 Thread Jeroen Rosenberg
I'm using Akka-Http 1.0-RC2 and I'm building a simple streaming server 
(Chunked HTTP) and client using reactive streams / flow graphs. 

My server looks like this (simplified version):

object Server extends App {

  implicit val system = ActorSystem("Server")
  implicit val ec = system.dispatcher
  val (address, port) = ("127.0.0.1", 6000)

  implicit val materializer = 
ActorFlowMaterializer(ActorFlowMaterializerSettings(system))

  val publisher = Source.actorPublisher(Props(new MyAwesomePublisher))

  val handler = Sink.foreach[Http.IncomingConnection] { con =>
  con handleWith Flow[HttpRequest].map { req =>
  HttpResponse(200).withEntity(Chunked(`application/json`, 
publisher))
  }
  }

  (Http() bind (address, port) to handler run)
}

I can now consume this stream with my akka http client implementation and 
'slow down the stream' by applying backpressure. I deliberately slow down 
my client side processing to trigger the backpressuring. Here's a 
simplified version:

class Client(processor: ActorRef) extends Actor {

  private implicit val executionContext = context.system.dispatcher
  private implicit val flowMaterializer: FlowMaterializer = 
ActorFlowMaterializer(ActorFlowMaterializerSettings(context.system))

  val client =
Http(context.system).outgoingConnection(host, port, settings = 
ClientConnectionSettings(context.system))

  val decompress = Flow[ByteString].map {
data => gunzip(data.toArray)
  }

  val buff = Flow[ByteString].buffer(1000, OverflowStrategy.backpressure)

  val slowFlow = Flow[ByteString].mapAsync(1) { x => after(20 millis, 
context.system.scheduler)(Future.successful(x)) }

  val consumer = Flow[HttpResponse].map {
data =>
  FlowGraph.closed() { implicit b =>
import FlowGraph.Implicits._
data.entity.dataBytes ~> slowFlow ~> buff ~> Sink.ignore
  }.run()
  }

  override def receive: Receive = {
case query: String =>
  val req = HttpRequest(GET, "http://localhost:6000/api";)
.withHeaders(
  Connection("Keep-Alive")
)
  Source.single(req).via(client).via(consumer).to(Sink.onComplete {
case Success(_) => println("Success!")
case Failure(e) => println(s"Error: $e")
  }).run()
  }

Because of 'slowFlow', I can see that my server 'slows down the stream' 
(i.e. less throughput for this connected client). So, great!

However, I wanted to handle the flow processing in another Actor, so I used 
ActorPublisher and pipe the stream to it, using akka.pattern.pipe:

class Client(processor: ActorRef) extends Actor {
  ...

  override def receive: Receive = {
case query: String =>
  val req = HttpRequest(GET, endpoint)
.withHeaders(
  `Accept-Encoding`(gzip),
  Connection("Keep-Alive")
) ~> authorize
  Source.single(req).via(client).runWith(Sink.head) pipeTo self
case response: HttpResponse =>
  response.entity.dataBytes.map { dataByte =>
 processor ! dataByte
  }.to(Sink.ignore).run()
  }
}

class StreamProcessor extends ActorPublisher[ByteString] with Actor {
  override def receive: Actor.Receive = {
case data: ByteString =>
  if (isActive && totalDemand > 0)
onNext(data)
  }
}

...
// elsewhere I'm consuming this publisher


val src = Source(ActorPublisher[ByteString](streamProcessor))

FlowGraph.closed() { implicit b =>
import FlowGraph.Implicits._

val decompress = Flow[ByteString].map {
   data => gunzip(data.toArray)
}

val buff = Flow[ByteString].buffer(1000, OverflowStrategy.backpressure)
 val slowFlow = Flow[ByteString].mapAsync(1) { x => after(20 millis, 
context.system.scheduler)(Future.successful(x)) }

src ~> slowFlow ~> buff ~> Sink.ignore
}.run()


This works fine, however in StreamProcessor (the ActorPublisher) it seems 
if I'm getting more data then I demand the only thing I can do is drop the 
messages. Can I apply backpressure here to the sender / upstream?

Thnx for any pointers!



-- 
>>  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] Need help with getting an Akka application to run inside a Docker container

2015-05-21 Thread Roland Kuhn
Thanks for letting us know, and don't worry, things happen :-)

Sent from my iPhone

> On 19 May 2015, at 23:55, Josh F  wrote:
> 
> Never mind, problem solved!
> 
> It wasn't related to the binding or firewalls after all... it was just that I 
> had configured the app to terminate if it receives a line from stdin and I 
> guess Docker must be writing something to stdin after it launches the app, so 
> the actor system was being terminated while it was still loading! :|
> 
>> On Tuesday, May 19, 2015 at 8:19:15 PM UTC+1, Josh F wrote:
>> By the way, when I run the application without using Docker, I get the 
>> following log message:
>> 
>> [myservice-akka.actor.default-dispatcher-4] spray.can.server.HttpListener - 
>> Bound to /0.0.0.0:8080
>> 
>> but when I run with Docker, I just get:
>> 
>> Message [akka.io.Tcp$Bound] from 
>> Actor[akka://myservice/system/IO-TCP/selectors/$a/0#-1126741174] to 
>> Actor[akka://myservice/user/IO-HTTP/listener-0#-1015798983] was not 
>> delivered.
>> 
>> So it looks like the binding was successful, but Akka is not working 
>> properly so it couldn't deliver the Bound message...?
>> 
>> I've tried running the container with --net=host (sharing the host machine's 
>> networking stack) instead of --net=bridge but it made no difference.
> 
> -- 
> >> 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.


Re: [akka-user] BalancingPool - ConfigException$BadPath

2015-05-21 Thread Przemek Piotrowski
Is there some workaround to use actors under BalancingPool in Akka 2.3.x ? 
The issue says that bug activates when actors are children of Router. 
Should I create them externally from the router and then add them to the 
pool?

W dniu sobota, 14 marca 2015 18:29:01 UTC+1 użytkownik sinel napisał:
>
>
> Oops, I didn't pay attention to the milestone on the right. Thanks.
>
>
> On Saturday, March 14, 2015 at 12:03:53 AM UTC+2, Patrik Nordwall wrote:
>>
>>
>>
>> On Wed, Mar 11, 2015 at 8:27 AM, sinel  wrote:
>>
>>> Hi,
>>>
>>> In my code, I am creating a pool in the following standard manner:
>>>
>>> private lazy val scriptProcessor: ActorRef = 
>>> context.actorOf(BalancingPool(poolSize).props(ScriptProcessor.props()), 
>>> "scriptProcessor")
>>>
>>> If I use RoundRobinPool or SmallestMailboxPool, my code works fine. 
>>> However, for BalancingPool, I get the following error:
>>>
>>> com.typesafe.config.ConfigException$BadPath: path parameter: Invalid 
>>> path 
>>> 'BalancingPool-/scriptBroker/connio-dev$acc315007900463911240$sp/scriptProcessor':
>>>  
>>> Token not allowed in path expression: 'a' ('$' not followed by {, 'a' not 
>>> allowed after '$') (you can double-quote this token if you really want it 
>>> here)
>>>
>>> It might be related to issue #13981, but apparently this was fixed and 
>>> closed back in April, 2014. I'm using Scala 2.11.5 and Akka 2.3.9.
>>>
>>
>> Right, but it was fixed for 2.4-M1, which has not been released yet. It 
>> is not fixed in 2.3.9.
>>
>> /Patrik
>>  
>>
>>>
>>> Any ideas?
>>>
>>> Thanks,
>>>
>>> Sinan
>>>
>>>
>>>  -- 
>>> >> 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 http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>>
>> Patrik Nordwall
>> Typesafe  -  Reactive apps on the JVM
>> Twitter: @patriknw
>>
>> [image: Scala Days] 
>>
>> 

-- 
>>  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-http] Can I get the last rejection and request context at the same time?

2015-05-21 Thread yar . ilich
It turns out it is, I wish examples in documentation depicted that:

val routeRejectionHandler = RejectionHandler.newBuilder().handle{ 
  case MalformedRequestContentRejection(msg, _) ⇒ ctx ⇒ {
val method = ctx.request.method
val uri = ctx.request.getUri()
val entity = Await.result(ctx.request.entity.toStrict(1.second), 
1.second).data.decodeString("UTF-8")
val msg = s"Malformed request body $entity in request $method $uri"
ctx.log.error(msg)
ctx.complete(BadRequest -> s"Could not deserialize request body")
  }
}.result



On Friday, May 15, 2015 at 2:59:14 PM UTC+3, yar@gmail.com wrote:
>
> Hi, hakkers!
>
> I have a route like the following,
>
> post {
>   entity(as[Profile]) { profile =>
> ...
>   }
> }
>
>
> and if entity is malformed or absent altogether, I want to give back a 
> BadRequest with a useful body containing request details (which I need a 
> request context for) and error messages from Unmarshaller (which I can get 
> from rejection). Is it possible to get the last rejection and 
> RequestContext at the same time?
>

-- 
>>  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 2.3.11 Released!

2015-05-21 Thread Olaf Bergner
Welcome news, indeed. I have to admit, though, that I was starting to 
suspect akka were dormant because the official release date of 2.3.11 is 
May 12 2014, *not* 2015. You may want to correct that.

Best,
Olaf  

Am Dienstag, 12. Mai 2015 09:14:05 UTC+2 schrieb Martynas Mickevičius:
>
> *Dear hAkkers,*
>
> We—the Akka committers—are pleased to be able to announce the availability 
> of Akka 2.3.11. This is the eleventh maintenance release of the 2.3 branch. 
> This release contains a few important fixes:
>
>- a fix for BatchingExecutor (#16327 
>; symptom is a requirement 
>failure when using blocking{} in Future callbacks)
>- a fix for a performance regression caused by a previous bugfix in IO 
>(#17391 )
>- a revert of a performance optimization in 2.3.9 that caused actor 
>starvation when multiple dispatchers were involved (#17341 
>; critical)
>
> This release also adds an additional configuration parameter 
>  for ForkJoinPool as well as a 
> fix for a wrong setting path  in 
> Pinned Dispatcher configuration.
>
> Akka 2.3.11 is released for Scala 2.10.4 and 2.11.5. This release is 
> backwards binary compatible with all previous 2.3.x versions which means 
> that the new JARs are a drop-in replacement for the old one (but not the 
> other way around) as long as your build does not enable the inliner 
> (Scala-only restriction). Always make sure to use at least the latest 
> version required by any of your project’s dependencies.
> Migrating from Older Relases
>
> When migrating an existing project from Akka 2.2.x please have a look at 
> the migration guide 
> 
> .
> Additional Release Details
>
> The artifacts comprising this release have been published to 
> https://oss.sonatype.org/content/repositories/releases/ and also to Maven 
> Central. In addition, we adopted the sbt standard of encoding the Scala 
> binary version in the artifact name, i.e. the core actor package’s 
> artifactId is “akka-actor_2.10” or “akka-actor_2.11”, respectively.
>
> The complete list of closed tickets can be found in the 2.3.11 github 
> issues milestone 
> .
> Credits
>
> commits added removed
>   581  73 Patrik Nordwall
>   2   175 133 Endre Sándor Varga
>   1 1   1 Konrad Malawski
>   143  22 hepin
>   133   6 Roland Kuhn
>
> *Happy hAkking!*
>
> -- 
> Martynas Mickevičius
> Typesafe  – Reactive 
>  Apps on the JVM
>  

-- 
>>  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] Re: Akka 2.3.11 Released!

2015-05-21 Thread Patrik Nordwall
On Thu, May 21, 2015 at 5:27 PM, Olaf Bergner  wrote:

> Welcome news, indeed. I have to admit, though, that I was starting to
> suspect akka were dormant because the official release date of 2.3.11 is
> May 12 2014, *not* 2015. You may want to correct that.
>

Thanks, fixed.
/Patrik


>
> Best,
> Olaf
>
>
> Am Dienstag, 12. Mai 2015 09:14:05 UTC+2 schrieb Martynas Mickevičius:
>>
>> *Dear hAkkers,*
>>
>> We—the Akka committers—are pleased to be able to announce the
>> availability of Akka 2.3.11. This is the eleventh maintenance release of
>> the 2.3 branch. This release contains a few important fixes:
>>
>>- a fix for BatchingExecutor (#16327
>>; symptom is a requirement
>>failure when using blocking{} in Future callbacks)
>>- a fix for a performance regression caused by a previous bugfix in
>>IO (#17391 )
>>- a revert of a performance optimization in 2.3.9 that caused actor
>>starvation when multiple dispatchers were involved (#17341
>>; critical)
>>
>> This release also adds an additional configuration parameter
>>  for ForkJoinPool as well as a
>> fix for a wrong setting path  in
>> Pinned Dispatcher configuration.
>>
>> Akka 2.3.11 is released for Scala 2.10.4 and 2.11.5. This release is
>> backwards binary compatible with all previous 2.3.x versions which means
>> that the new JARs are a drop-in replacement for the old one (but not the
>> other way around) as long as your build does not enable the inliner
>> (Scala-only restriction). Always make sure to use at least the latest
>> version required by any of your project’s dependencies.
>> Migrating from Older Relases
>>
>> When migrating an existing project from Akka 2.2.x please have a look at
>> the migration guide
>> 
>> .
>> Additional Release Details
>>
>> The artifacts comprising this release have been published to
>> https://oss.sonatype.org/content/repositories/releases/ and also to
>> Maven Central. In addition, we adopted the sbt standard of encoding the
>> Scala binary version in the artifact name, i.e. the core actor package’s
>> artifactId is “akka-actor_2.10” or “akka-actor_2.11”, respectively.
>>
>> The complete list of closed tickets can be found in the 2.3.11 github
>> issues milestone
>> .
>> Credits
>>
>> commits added removed
>>   581  73 Patrik Nordwall
>>   2   175 133 Endre Sándor Varga
>>   1 1   1 Konrad Malawski
>>   143  22 hepin
>>   133   6 Roland Kuhn
>>
>> *Happy hAkking!*
>>
>> --
>> Martynas Mickevičius
>> Typesafe  – Reactive
>>  Apps on the JVM
>>
>  --
> >> 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.
>



-- 

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


[akka-user] hundreds of thousands of instances for akka.dispatch.AbstractNodeQueue$Node - why?

2015-05-21 Thread Eugene Dzhurinsky
Hello!

I recently tried to analyze some crashes of our application, and the heap 
dump revealed that top classes of most instances are:

807286 instances  of class 
akka.dispatch.AbstractNodeQueue$Node 
 
807116 instances  of class 
akka.actor.LightArrayRevolverScheduler$TaskQueue 
 

I'm just curious - what may cause those numbers?

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


Re: [akka-user] hundreds of thousands of instances for akka.dispatch.AbstractNodeQueue$Node - why?

2015-05-21 Thread Endre Varga
Hi Eugene,

These relate to queue slots, so if you see these in large numbers then you
are very likely overloading your application and therefore queues grow out
of bounds, taking more and more memory, eventually dominating the heap,
then OOME. You need to properly backpressure the necessary parts of your
application.

-Endre

On Thu, May 21, 2015 at 6:35 PM, Eugene Dzhurinsky 
wrote:

> Hello!
>
> I recently tried to analyze some crashes of our application, and the heap
> dump revealed that top classes of most instances are:
>
> 807286 instances  of class
> akka.dispatch.AbstractNodeQueue$Node
> 
> 807116 instances  of class
> akka.actor.LightArrayRevolverScheduler$TaskQueue
> 
>
> I'm just curious - what may cause those numbers?
>
> 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 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.


Re: [akka-user] hundreds of thousands of instances for akka.dispatch.AbstractNodeQueue$Node - why?

2015-05-21 Thread Eugene Dzhurinsky
Cool, thanks for the quick reply!

-- 
>>  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] Backpressure and bounded mailbox

2015-05-21 Thread Vadim Bobrov
Hello all!

I am thinking of using bounded mailbox as a simple solution to backpressure 
implementation. My app basically consumes messages from a queue (kafka), 
unpacks and processes them and sends to HBase storage. The birds-eye 
overview of the principal actors is:

W - writes to Hbase
C - consumes from Kafka and sends to W and a number of processors P1...Pn
P1-Pn - do various processing, generating a lot of derived stuff and send 
all to W

so I want to propagate backpressure all the way from W (through P1-Pn, 
because they are the primary generators of load) to C. Should I or should I 
not use message timeouts? I don't like the idea that I would have to figure 
out exactly what message and from what actor timed out - it'll make things 
too complicated. On the other hand not using timeouts will block actors 
which is a bad idea. Is it really in this case? I can't see why if the 
actor has to wait anyway

Thanks
Vadim

-- 
>>  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] Documentation Question

2015-05-21 Thread Chanan Braunstein
Hello,

More and more teams are adopting Akka at my company and now that we need to 
work with Actors written by others (and since Roland's Typed actors isn't 
ready yet :) ), we find that we need to document the actors and the 
messages that are available to them. When we do REST, we use Swagger for 
this. Has anyone come accross a useful tool to generate message 
documentation or does everyone just use ScalaDoc/JavaDoc?

Chanan

-- 
>>  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] Backpressure and bounded mailbox

2015-05-21 Thread Endre Varga
Hi Vadim,

Why don't you look at Akka Streams first? It is all about handling
backpressure in a simple way.

-Endre

On Thu, May 21, 2015 at 7:39 PM, Vadim Bobrov  wrote:

> Hello all!
>
> I am thinking of using bounded mailbox as a simple solution to
> backpressure implementation. My app basically consumes messages from a
> queue (kafka), unpacks and processes them and sends to HBase storage. The
> birds-eye overview of the principal actors is:
>
> W - writes to Hbase
> C - consumes from Kafka and sends to W and a number of processors P1...Pn
> P1-Pn - do various processing, generating a lot of derived stuff and send
> all to W
>
> so I want to propagate backpressure all the way from W (through P1-Pn,
> because they are the primary generators of load) to C. Should I or should I
> not use message timeouts? I don't like the idea that I would have to figure
> out exactly what message and from what actor timed out - it'll make things
> too complicated. On the other hand not using timeouts will block actors
> which is a bad idea. Is it really in this case? I can't see why if the
> actor has to wait anyway
>
> Thanks
> Vadim
>
> --
> >> 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.


Re: [akka-user] Backpressure and bounded mailbox

2015-05-21 Thread Vadim Bobrov
Endre,

I did. However this is a multiple-thousand lines app and a complete 
rewriting of its backbone is out of question in the nearest future. However 
a proper and transparent backpressure handling will certainly help moving 
toward streams. Currently what I have is a rather awkward pull pattern

On Thursday, May 21, 2015 at 2:25:50 PM UTC-4, drewhk wrote:
>
> Hi Vadim,
>
> Why don't you look at Akka Streams first? It is all about handling 
> backpressure in a simple way.
>
> -Endre
>
> On Thu, May 21, 2015 at 7:39 PM, Vadim Bobrov  > wrote:
>
>> Hello all!
>>
>> I am thinking of using bounded mailbox as a simple solution to 
>> backpressure implementation. My app basically consumes messages from a 
>> queue (kafka), unpacks and processes them and sends to HBase storage. The 
>> birds-eye overview of the principal actors is:
>>
>> W - writes to Hbase
>> C - consumes from Kafka and sends to W and a number of processors P1...Pn
>> P1-Pn - do various processing, generating a lot of derived stuff and send 
>> all to W
>>
>> so I want to propagate backpressure all the way from W (through P1-Pn, 
>> because they are the primary generators of load) to C. Should I or should I 
>> not use message timeouts? I don't like the idea that I would have to figure 
>> out exactly what message and from what actor timed out - it'll make things 
>> too complicated. On the other hand not using timeouts will block actors 
>> which is a bad idea. Is it really in this case? I can't see why if the 
>> actor has to wait anyway
>>
>> Thanks
>> Vadim
>>
>> -- 
>> >> 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 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: Reasons why Logback is recommended for Akka logging

2015-05-21 Thread Adam
Hi,

Where I work, we're using Akka with log4j2 (through slf4j binding) in 
production.
We're handling billions of daily requests and so far it works flawlessly :-)

On Thursday, May 21, 2015 at 10:55:22 AM UTC+3, monika singhal wrote:
>
> Anyone tried log4j2 with Akka ? 
>
> Thanks,
> Monika
>
>
>

-- 
>>  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] hundreds of thousands of instances for akka.dispatch.AbstractNodeQueue$Node - why?

2015-05-21 Thread Viktor Klang
Hi Eugene,

Those two correspond to usage of the Scheduler to defer things for a
specified amount of time.
IIRC there was recently a discussion whether there could be a memory leak
related to this.

On Thu, May 21, 2015 at 6:35 PM, Eugene Dzhurinsky 
wrote:

> Hello!
>
> I recently tried to analyze some crashes of our application, and the heap
> dump revealed that top classes of most instances are:
>
> 807286 instances  of class
> akka.dispatch.AbstractNodeQueue$Node
> 
> 807116 instances  of class
> akka.actor.LightArrayRevolverScheduler$TaskQueue
> 
>
> I'm just curious - what may cause those numbers?
>
> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Cheers,
√

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


Re: [akka-user] hundreds of thousands of instances for akka.dispatch.AbstractNodeQueue$Node - why?

2015-05-21 Thread Eugene Dzhurinsky
Hello!

I wonder if this is my case, because I'm not using any kind of heavy 
scheduling with the actors.

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


[akka-user] Akka-Streams (RC2) Read lines from file into a string, help?!?

2015-05-21 Thread David Hooker
Hi all-

Seems like it should be simple, so I'm just missing something obvious.  The 
various pages around the Internet are no help (for instance, FoldSink seems 
to be gone in RC2).

My entire code is here:
https://gist.github.com/dudehook/c92541a353293eb36a9e

The relevant portion is:

  def run = {
val f = new File("dave.test")
val filePub = Source.synchronousFile(f, 512)
val fs = SynchronousFileSource(f, 512)
val ftes= Flow[ByteString].transform { () => parseLines("/n", 1024 ) }
val output = new StringBuilder
val sink = Sink.fold(output)((acc: StringBuilder, s:String) => {
  println(s"s: $s")
  acc.append(s) 
  })
val all = fs.via(ftes).runWith(sink).map[String] { b: StringBuilder => 
b.toString() }
Await.ready(all, 5 seconds)
(all.value, output.toString())
  }


When I run on REPL, I get a *(Option[scala.util.Try[String]], String) = 
(Some(Success()),"")*
The strings are always empty.
The "Got chunk" message within the parseLines function does print once, so 
I know it's processing something.

Any ideas?  Seems like akka-streams is a moving target, but I really want 
to use it for this... could end up being core to something bigger.


-- 
>>  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] [Recommendations]: Migrating one Big Java Application to Akka

2015-05-21 Thread Harit Himanshu
Hello there!

I have been reading a lot about akka lately (with one weekend playing). The 
ability to supervise and recover from crash is exactly what I need for my 
current project.

*About current project*

   1. It is written in Java.
   2. It is deployed on client’s machine.
   3. This has one project that does many things - processing log files, 
   responds to web request, run scheduled jobs amongst other things.
   4. This project uses executors when possible to spawn threads as needed 
   to parallelize the effort.


*Why I think it is better candidate for akka*

   1. As deployed on client’s box it’s not trivial to know if its is up and 
   running. Supervisor hierarchy would help the project to recover from 
   errors if possible, or else inform us (in some way, messaging, email)
   2. Better Monitoring, with different monitoring actors, better 
   hierarchies and separation of concerns
   3. Log Processing with akka-streams and back-pressure (I realized a 
   recent customer issue could have been avoided if we had akka-streams in 
   place)
   4. Help thinking in actors and staying away from synchronize and locks.


*Recommendation Needed*

   1. There are many parts where I believe that re-writing in akka would be 
   useful and better but its better to take baby steps at a time as we are 
   still learning.
   2. Also, we (team of 2 are planning to pick Scala) plan to create a 
   scaffolding around current project.
   3. 
  1. The scaffolding is Parent/ApplicationActor which calls our current 
  project
  2. We plan to achieve to this one level of abstraction so as to get 
  flexibility for doing more things with Scala and Akka
   

I am looking our for advices/criticism/suggestions from all of you to make 
sure I that either this plan is worthless or I have enough ideas to make an 
informed decision.

Please enlighten!
Thank you
+ Harit Himanshu

-- 
>>  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-Streams (RC2) Read lines from file into a string, help?!?

2015-05-21 Thread Konrad Malawski
Hi David,
seems we worked out that one on gitter during the evening accidentally :-)

// Note for others, notice the */n* typo in the separator :-)

Happy hakking!

On Thu, May 21, 2015 at 11:48 PM, David Hooker  wrote:

> Hi all-
>
> Seems like it should be simple, so I'm just missing something obvious.
> The various pages around the Internet are no help (for instance, FoldSink
> seems to be gone in RC2).
>
> My entire code is here:
> https://gist.github.com/dudehook/c92541a353293eb36a9e
>
> The relevant portion is:
>
>   def run = {
> val f = new File("dave.test")
> val filePub = Source.synchronousFile(f, 512)
> val fs = SynchronousFileSource(f, 512)
> val ftes= Flow[ByteString].transform { () => parseLines("/n", 1024 ) }
> val output = new StringBuilder
> val sink = Sink.fold(output)((acc: StringBuilder, s:String) => {
>   println(s"s: $s")
>   acc.append(s)
>   })
> val all = fs.via(ftes).runWith(sink).map[String] { b: StringBuilder =>
> b.toString() }
> Await.ready(all, 5 seconds)
> (all.value, output.toString())
>   }
>
>
> When I run on REPL, I get a *(Option[scala.util.Try[String]], String) =
> (Some(Success()),"")*
> The strings are always empty.
> The "Got chunk" message within the parseLines function does print once, so
> I know it's processing something.
>
> Any ideas?  Seems like akka-streams is a moving target, but I really want
> to use it for this... could end up being core to something bigger.
>
>
>  --
> >> 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.
>



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


Re: [akka-user] hundreds of thousands of instances for akka.dispatch.AbstractNodeQueue$Node - why?

2015-05-21 Thread Endre Varga
On Thu, May 21, 2015 at 9:18 PM, Viktor Klang 
wrote:

> Hi Eugene,
>
> Those two correspond to usage of the Scheduler to defer things for a
> specified amount of time.
> IIRC there was recently a discussion whether there could be a memory leak
> related to this.
>

Which one are you thinking of? I don't think there is a leak here.

-Endre


>
> On Thu, May 21, 2015 at 6:35 PM, Eugene Dzhurinsky 
> wrote:
>
>> Hello!
>>
>> I recently tried to analyze some crashes of our application, and the heap
>> dump revealed that top classes of most instances are:
>>
>> 807286 instances  of class
>> akka.dispatch.AbstractNodeQueue$Node
>> 
>> 807116 instances  of class
>> akka.actor.LightArrayRevolverScheduler$TaskQueue
>> 
>>
>> I'm just curious - what may cause those numbers?
>>
>> 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 http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Cheers,
> √
>
> --
> >> Read the docs: http://akka.io/docs/
> >> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at 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.