Re: [akka-user] AtLeastOnceDelivery - mapping my own messageId to deliveryId possible?

2015-02-15 Thread Paweł Kaczor
I created a ticket: https://github.com/akka/akka/issues/16874 
and pull request: https://github.com/akka/akka/pull/16877

Cheers,
Pawel

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/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] streams - Source that emits only 1 (or no) element

2015-02-15 Thread Giovanni Alberto Caporaletti
Hi,
I was wondering, is Source[T] an abstraction only useful when you can 
possibly have more than 1 element? 
Is Future[T] still the way to represent a source that will emit exactly 1 
element or an error? 

What about 0 or 1? Future[Option[T]] vs Source[T]? In rxjava they are 
proposing a Task 
abstraction: https://github.com/ReactiveX/RxJava/issues/1594

what do you think?


Cheers
G

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/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: going from using akka in a play application to scaling the akka to multiple nodes, what to plan for?

2015-02-15 Thread Jim Hazen
Take a look at cluster sharding.  By far the easiest way to get started 
with clustered/distributed actors.

http://doc.akka.io/docs/akka/2.3.9/contrib/cluster-sharding.html#cluster-sharding

On Sunday, February 15, 2015 at 7:58:02 AM UTC-8, gitted wrote:

 Currently I am a play application that I use akka with.  All is fine since 
 my application is running on a single server.

 If I want to have multiple nodes, how exactly do I go about scaling my 
 akka side of things?  Currently it assumes all akka actors are on the same 
 node.


-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/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] shutdown camel route in an akka actor

2015-02-15 Thread hfaouaz

Hello,
  I am trying to leverage akka to initiate one single camel route 
execution, as such once the actor gets a message, it initiates the camel 
route, and upon completion, shutdown the route.  Example below, though I am 
not able to achieve it.  Either the camel route stays and if I try to shut 
it down, the route is never complete.  Any ideas I would appreciate...

class CamelRouteExecutor extends Actor with ActorLogging {

  implicit val system = context.system

  val camel = CamelExtension(system)

  def receive = {

case work:Any =

  val route = work.asInstanceOf[java.lang.String]
  log.debug(Executing camel route {}, route)
  val is = new ByteArrayInputStream(route.toString().getBytes())
  val routesDef = camel.context.loadRoutesDefinition(is)
  camel.context.addRouteDefinition(routesDef.getRoutes.get(0))
  log.debug(stopping route Id {} from camel context, 
routesDef.getRoutes.get(0).getId)
  camel.context.stopRoute(routesDef.getRoutes.get(0).getId)
  camel.context.removeRoute(routesDef.getRoutes.get(0).getId)

  sender() ! Worker.WorkComplete(work status: )


case _ =
  log.warning(got a message, which I don't understand)
  }
}

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/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 threads prevents jvm from existing

2015-02-15 Thread George Lu
Dear all,

I searched on Google but cannot find any similar topics. I am a Akka newbie 
and used Akka to start some workers to process time consuming tasks.
I used system.AwaitTermination() and system.shutdown() to shutdown Akka.
My Akka used RoundRobinRouter and schedules 10 workers.
But, the JVM does not exit. Then I print all running threads.

MapThread, StackTraceElement[] threads =  Thread.getAllStackTraces();
for(Thread t:threads.keySet()){

System.out.println();
System.out.println(t.getId()+:+t.getName()+ is 
daemon:+t.isDaemon());
for(StackTraceElement stackTrace: threads.get(t)){

System.out.println(stackTrace.getFileName());
System.out.println(stackTrace.getClassName());
System.out.println(stackTrace.getMethodName());
System.out.println(stackTrace.isNativeMethod());
}

System.out.println();
}

The following is the output.
Can anyone give me any hint whether is Akka prevent the JVM from exiting 
and if it is, how to prevent that?

Thanks!
George


2:Reference Handler is daemon:true
Object.java
java.lang.Object
wait
true
Object.java
java.lang.Object
wait
false
Reference.java
java.lang.ref.Reference$ReferenceHandler
run
false


27:CreationSystem-akka.actor.default-dispatcher-6 is daemon:false
Unsafe.java
sun.misc.Unsafe
park
true
ForkJoinPool.java
scala.concurrent.forkjoin.ForkJoinPool
idleAwaitWork
false
ForkJoinPool.java
scala.concurrent.forkjoin.ForkJoinPool
scan
false
ForkJoinPool.java
scala.concurrent.forkjoin.ForkJoinPool
runWorker
false
ForkJoinWorkerThread.java
scala.concurrent.forkjoin.ForkJoinWorkerThread
run
false


20:pool-3-thread-1 is daemon:false
Unsafe.java
sun.misc.Unsafe
park
true
LockSupport.java
java.util.concurrent.locks.LockSupport
park
false
AbstractQueuedSynchronizer.java
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject
await
false
ScheduledThreadPoolExecutor.java
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue
take
false
ScheduledThreadPoolExecutor.java
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue
take
false
ThreadPoolExecutor.java
java.util.concurrent.ThreadPoolExecutor
getTask
false
ThreadPoolExecutor.java
java.util.concurrent.ThreadPoolExecutor
runWorker
false
ThreadPoolExecutor.java
java.util.concurrent.ThreadPoolExecutor$Worker
run
false
Thread.java
java.lang.Thread
run
false


18:CreationSystem-akka.actor.default-dispatcher-4 is daemon:false
Unsafe.java
sun.misc.Unsafe
park
true
ForkJoinPool.java
scala.concurrent.forkjoin.ForkJoinPool
scan
false
ForkJoinPool.java
scala.concurrent.forkjoin.ForkJoinPool
runWorker
false
ForkJoinWorkerThread.java
scala.concurrent.forkjoin.ForkJoinWorkerThread
run
false


12:C3P0PooledConnectionPoolManager[identityToken-1hge24797149gw291ezhx58|6badc6a5]-HelperThread-#0
 
is daemon:true
Object.java
java.lang.Object
wait
true
ThreadPoolAsynchronousRunner.java
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread
run
false


22:pool-3-thread-3 is daemon:false
Unsafe.java
sun.misc.Unsafe
park
true
LockSupport.java
java.util.concurrent.locks.LockSupport
park
false
AbstractQueuedSynchronizer.java
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject
await
false
ScheduledThreadPoolExecutor.java
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue
take
false
ScheduledThreadPoolExecutor.java
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue
take
false
ThreadPoolExecutor.java
java.util.concurrent.ThreadPoolExecutor
getTask
false
ThreadPoolExecutor.java
java.util.concurrent.ThreadPoolExecutor
runWorker
false
ThreadPoolExecutor.java
java.util.concurrent.ThreadPoolExecutor$Worker
run
false
Thread.java
java.lang.Thread
run
false


28:Keep-Alive-Timer is daemon:true
Thread.java
java.lang.Thread
sleep
true
KeepAliveCache.java
sun.net.www.http.KeepAliveCache
run
false
Thread.java
java.lang.Thread
run
false


4:Signal Dispatcher is daemon:true