Re: [akka-user] Re: Akka Streams Merge variance

2015-05-19 Thread Viktor Klang
Thinking about it perhaps it makes sense to have a MergeWith, where Merge
is using the identity function?

-- 
Cheers,
√
On 19 May 2015 02:10, Andrey Kuznetsov f...@loathing.in wrote:

 I asked myself the same question when I faced to the problem of merging
 elements from Source[A] and Source[B] where A and B are children of the
 same trait C. Had to make both sources a Source[C].

 On Saturday, May 16, 2015 at 4:47:51 PM UTC+3, Oliver Winks wrote:

 If you look at the implementation of Merge you find that it is a generic
 type, but without any defined variance:

 classMerge[T] extends Graph
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-RC2/akka/stream/Graph.html
 [UniformFanInShape
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-RC2/akka/stream/UniformFanInShape.html
 [T, T], Unit http://www.scala-lang.org/api/2.10.5/index.html#scala.Unit
 ]

 Is there any reason for this? Would it not make sense to define it as a
 covariant type? e.g:

 classMerge[+T] extends Graph
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-RC2/akka/stream/Graph.html
 [UniformFanInShape
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-RC2/akka/stream/UniformFanInShape.html
 [T, T], Unit http://www.scala-lang.org/api/2.10.5/index.html#scala.Unit
 ]

  --
  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] Replay akka durable mailbox's transaction log

2015-05-19 Thread Patrik Nordwall
Durable mailboxes are deprecated and will be removed. Take a look at Akka
Persistence instead:
http://doc.akka.io/docs/akka/2.3.11/java/lambda-persistence.html

Regards,
Patrik

On Sat, May 16, 2015 at 2:50 AM, Pranas Baliuka pranas.bali...@algoteq.com
wrote:

 Dear Akka experts,

 I am very new in Akka, but it is one of possible frameworks to simplify
 development in my project.
 The Java 8 API looks very valuable and practical for my purposes.

 I am doing prototype of storing events in Cloudera Impalla and want to
 know if it is possible to replay transaction log using Java.
 All practical experience of accessing transaction log using API/directly
 appreciated.


 Thank you!


 Visit our website at http://www.algoteq.com

 Privileged/Confidential information may be contained in this message and
 may be subject to legal privilege. Access to this e-mail by anyone other
 than the intended is unauthorised. If you are not the intended recipient
 (or responsible for delivery of the message to such person), you may not
 use, copy, distribute or deliver to anyone this message (or any part of its
 contents) or take any action in reliance on it. In such case, you should
 destroy this message, and notify us immediately. If you have received this
 email in error, please notify us immediately by e-mail and delete the
 e-mail from your computer. If you or your employer does not consent to
 internet e-mail messages of this kind, please notify us immediately. All
 reasonable precautions have been taken to ensure no viruses are present in
 this e-mail. As Algoteq Pty Ltd cannot accept responsibility for any loss
 or damage arising from the use of this e-mail or attachments we recommend
 that you subject these to your virus checking procedures prior to use. The
 views, opinions, conclusions and other informations expressed in this
 electronic mail are not given or endorsed by the company unless otherwise
 indicated by an authorised representative independent of this 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 http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




-- 

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


[akka-user] Advantages and disadvantages of using 2 ActorSystem

2015-05-19 Thread Gabriele Favaretto
In a Play application, would be the advantages of using a different 
ActorSystem respect the Play one?
Are there any production environments where using another ActorSystem was 
useful or necessary?

-- 
  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] couchbase persistence plugin for akka

2015-05-19 Thread Patrik Nordwall
Hi Yousef,

Thanks for sharing. It looks like the repository is not public or the link
is wrong.

Please open a pull request with the plugin added to the Community Projects
http://akka.io/community/ page when you have released the first version.

Regards,
Patrik

On Tue, May 19, 2015 at 12:28 PM, Yousef Fadila yo...@octsol.com wrote:

 Hi All,

 Today, I have published the akka couchbase persistence plugin

 https://github.com/yousef-fadila/couchbase-persistence-plugin

 The next update will include the usage of couhbase append operation
 http://docs.couchbase.com/developer/java-2.1/documents-atomic.html
 and removing the usage of json. encode64 before persisting.

 will be glad to receive your feedback...

 Yousef

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


[akka-user] couchbase persistence plugin for akka

2015-05-19 Thread Yousef Fadila
Hi All, 

Today, I have published the akka couchbase persistence plugin

https://github.com/yousef-fadila/couchbase-persistence-plugin 

The next update will include the usage of couhbase append operation 
http://docs.couchbase.com/developer/java-2.1/documents-atomic.html 
and removing the usage of json. encode64 before persisting. 
 
will be glad to receive your feedback...

Yousef 

-- 
  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: Could you explain idResolver

2015-05-19 Thread Wolfgang Friedl
Well we do have a similar scenario and we do it that way. Simply assigning 
the name to the persitenceId.

  val persistenceId: String   = self.path.name // userId

I guess you mean the idExtractor (idResolver), it could look like this

 val idExtractor: ShardRegion.IdExtractor = {
 case um:UserMsg ⇒ (s${um.Id}, um)
  }


Regards

Wolfgang


-- 
  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-19 Thread Dragisa Krsmanovic
I got Docker working for Akka app by having this in build.sbt:

mainClass := Some(my.project.Main)
dockerBaseImage := dockerfile/java:oracle-java8
maintainer := myself
bashScriptConfigLocation := Some(${app_home}/../conf/jvmopts)
dockerExposedPorts := Seq(2553, 8080)
dockerRepository := Some(mydockerid)


I had all custom JVM opts in: universal/conf.jvmopts. For example my
cluster seed config or db connection settings.


On Tue, May 19, 2015 at 9:19 AM, Josh F jof...@gmail.com wrote:

 Hi all,

 I have written a Scala web application using Akka+Spray, and am now trying
 to run it inside a Docker container - but am really struggling to get it to
 work.

 It looks like the problem is that Akka messages are not being delivered. I
 have read some info about needing to set
 akka.remote.netty.tcp.bind-hostname and akka.remote.netty.tcp.bind-port 
 settings
 IF using remote actors, however I am not using remote actors... at the
 moment I just have a standalone actor system inside a single docker
 container. So I have not set these properties.

 The logs and errors that I'm seeing are:

 2015-05-19 16:01:18 INFO
  
 [myservice-akka.actor.default-dispatcher-6:a.e.s.Slf4jLogger$$anonfun$receive$1$$anonfun$applyOrElse$3@74]
 - Message [akka.dispatch.sysmsg.DeathWatchNotification] from
 Actor[akka://myservice/user/IO-HTTP/listener-0#-697002067] to
 Actor[akka://myservice/user/IO-HTTP/listener-0#-697002067] 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'.
 2015-05-19 16:01:18 ERROR
 [myservice-akka.actor.default-dispatcher-4:a.e.s.Slf4jLogger$$anonfun$receive$1$$anonfun$applyOrElse$1@66]
 - Error during selector management task:
 [java.nio.channels.ClosedChannelException]
 java.nio.channels.ClosedChannelException: null
 at
 java.nio.channels.spi.AbstractSelectableChannel.register(AbstractSelectableChannel.java:194)
 ~[na:1.7.0_75]
 at
 akka.io.SelectionHandler$ChannelRegistryImpl$$anon$4.tryRun(SelectionHandler.scala:157)
 ~[akka-actor_2.11-2.3.9.jar:na]
 at
 akka.io.SelectionHandler$ChannelRegistryImpl$Task.run(SelectionHandler.scala:215)
 ~[akka-actor_2.11-2.3.9.jar:na]

 I think this exception is caused when I try to bind to a port for HTTP:

 IO(Http) ! Http.Bind(service, interface = 0.0.0.0, port = 8080)


 I have exposed port 8080 and ran the container with a port mapping, -p 
 8080:8080 ... and I have also tried using different a different port than 
 8080, so I don't think the problem is related to the binding itself, but 
 rather I think perhaps the Akka message is not being delivered.


 Does anyone have any idea what the problem might be? Have been trying to get 
 this to work all day!


 Thanks for any help,

 Josh

  --
  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] Configuring Akka to run as a job server using Play framework

2015-05-19 Thread Michael Frank

On 05/18/15 14:09, Mark Joslin wrote:
Hi guys, I was hoping you could point me in the right direction. I 
have an API server with the Play framework that uses actors. Right 
now, these are just local actors but their workload is growing and 
since I'm beginning to introduce more  more scheduled background 
jobs, I would like it to be its own stand-alone job server.


I believe the difficulty lies in differentiating who is the API server 
and who is the job server and how that relates to actor creation / 
selection. Naturally, I just want the API server(s) to target the 
actor systems on the job server(s). Does anyone have any experience 
with this kind of job? My original thought was just to use environment 
variables and say Ok, I'm an API server, don't spin up this actor 
system OR Ok, I'm a job server, join this actor system cluster. I 
tried looking around for some resources, but didn't find anything and 
was hoping you guys could help me out.


it seems like this would fit well with cluster sharding 
(http://doc.akka.io/docs/akka/2.3.11/scala/cluster-usage.html#Cluster_Sharding) 
and persistence 
(http://doc.akka.io/docs/akka/2.3.11/scala/persistence.html).  your jobs 
could be cluster shard entities.  on the API side, you can use sharding 
proxy-only mode to route the requests from the API server to the job server.


alternatively, with some extra plumbing, you can use regular akka 
cluster and give each node in the cluster a role 
(http://doc.akka.io/docs/akka/2.3.11/scala/cluster-usage.html#Node_Roles). 
On the API side, you can listen for cluster membership events, and 
maintain a router that routes requests to the current job servers.


of the two, the first choice would be the easier one.

-Michael

--

 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 RC-2 are there easy combinators for unmarshall request entity to 'T', I'm overlooking something

2015-05-19 Thread dnvriend
Hi,

 Is there any way easy way to unmarshal XML to a case class. Compared to 
the spray API, the solution I found is too verbose, but I don't seem to 
find a good combinator to use.

I have the following route:

pathEnd {
  post {
entity(as[ProcessCommandsRequest]) { req =
  onComplete(oorStub ?  req) {
case Success(msg: ProcessCommandsResponse) = complete(msg)
case _ = 
complete(StatusCodes.InternalServerError - )
  }
}
  }


The marshaller trait is the following. Everything works, but the API is too 
verbose. A whole lot of unmarshallers, and marshallers for that matter are 
defined in implicit scope. Is there any combinator or construction 
off-the-shelf available in akka-http that can reduce the amount of 
boilerplate, the chain of flatmaps. Compared to goold-ol' Spray, this is a 
whole lot of code. Somebody have any ideas? Regards, Dennis

import akka.actor.ActorSystem
import akka.event.LoggingAdapter
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import akka.http.scaladsl.marshallers.xml.ScalaXmlSupport
import akka.http.scaladsl.marshalling.{Marshaller, Marshalling}
import akka.http.scaladsl.model._
import akka.http.scaladsl.unmarshalling.{FromEntityUnmarshaller, 
FromRequestUnmarshaller, Unmarshaller}
import akka.stream.FlowMaterializer
import com.example.ProcessCommandsRequest
import spray.json.DefaultJsonProtocol

import scala.concurrent.{ExecutionContext, Future}
import scala.xml.NodeSeq

trait StubMarshallers extends ScalaXmlSupport with DefaultJsonProtocol with 
SprayJsonSupport {
  implicit def system: ActorSystem
  implicit def ec: ExecutionContext
  implicit def materializer: FlowMaterializer
  implicit def log: LoggingAdapter

  // unmarshallers
  implicit val pcUnmarshaller = Unmarshaller[NodeSeq, ProcessCommandsRequest] { 
xml =
Future(ProcessCommandsRequest(, Nil))
  }

  implicit val pcrUnmarshaller: FromRequestUnmarshaller[ProcessCommandsRequest] 
= Unmarshaller[HttpRequest, ProcessCommandsRequest] { req =
fruReqToEntity(req).flatMap(httpEntity = 
defaultNodeSeqUnmarshaller(materializer, ec)(httpEntity)).flatMap(nodeSeq = 
pcUnmarshaller(nodeSeq))
  }

  implicit val fruReqToEntity: FromRequestUnmarshaller[HttpEntity] = 
Unmarshaller[HttpRequest, HttpEntity] { req =
import scala.concurrent.duration._
req.entity.toStrict(10.seconds).map { strict =
  HttpEntity(ContentType(MediaTypes.`text/xml`), strict.data)
}
  }

  // marshallers
  implicit val pcrMarshaller = Marshaller[OorStub.ProcessCommandsResponse, 
HttpResponse] { pcr =
Future(List(
  Marshalling.Opaque { () =
pcr.error.map { _ =
  HttpResponse().withEntity(ContentType(MediaTypes.`text/xml`), 
OorStubXml.optInFailureResponse)

}.getOrElse {
  HttpResponse().withEntity(ContentType(MediaTypes.`text/xml`), 
OorStubXml.optInSuccessResponse)
}
  }
))
  }

  implicit val futureMarshaller = 
Marshaller.futureMarshaller[OorStub.ProcessCommandsResponse, HttpResponse]
}



-- 
  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] How to handle long GC in AKKA Actor model system

2015-05-19 Thread Michael Frank
patrik answered this much better than i could have :)  i was thinking 
that your experience would be better if you could tune the JVM to be 
more responsive.  but you're right, it didn't directly address your 
original question, sorry for the confusion.


i will note, since you're on java7, you might look into the G1 collector 
in order to reduce your GC pauses: 
http://www.oracle.com/technetwork/java/javase/tech/g1-intro-jsp-135488.html.


some documentation on tuning G1: 
http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/G1GettingStarted/index.html


-Michael

On 05/18/15 12:19, seetaramayya vadali wrote:


  * We are using Java 7
  * 32 cores I guess ( I am not sure though )
  * Considering Azul

I didnt understand how come GC tuning matters with node joining the 
cluster. Is there any relation ?




On Mon, May 18, 2015 at 9:12 PM, Michael Frank syntaxjoc...@gmail.com 
mailto:syntaxjoc...@gmail.com wrote:


On 05/18/15 11:48, seetaramayya vadali wrote:

Hi Martynas,

 After adding acceptable-heartbeat-pause and removing
auto-down-unreachable-after both nodes formed different clusters.
I am still exploring failure-detector configuration part. If any
one have any other suggestions I can save some time :) .

 Thanks a lot to every response to this thread.


* What java version are you using?
* How many cpu cores are available to you?
* What sort of garbage collection tuning have you done and what
are your current GC parameters?

a 30 minute stop-the-world GC pause seems crazy, but i've never
seen a host with 1TB of memory :)

-Michael
-- 
 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/9ZSFvxegNUY/unsubscribe.
To unsubscribe from this group and all its topics, send an email
to akka-user+unsubscr...@googlegroups.com
mailto:akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com
mailto: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.




--
Regards,
Seeta Ramayya Vadali
--
 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 
mailto:akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com 
mailto: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] Advantages and disadvantages of using 2 ActorSystem

2015-05-19 Thread Dragisa Krsmanovic
Play already has two actor systems. One called play for internal use of
Play framework and one called application that you can access via
play.api.libs.concurrent.Akka for you to use.



On Tue, May 19, 2015 at 1:42 AM, Gabriele Favaretto 
gabriele.favare...@databiz.it wrote:

 In a Play application, would be the advantages of using a different
 ActorSystem respect the Play one?
 Are there any production environments where using another ActorSystem was
 useful or necessary?

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

2015-05-19 Thread Josh F
Hi Dragisa, 

Thanks for the reply. I have tried with similar config, but it doesn't seem 
to fix my problem.

Anyway, since I'm not using Akka remoting, I think I shouldn't need any 
cluster config or to expose any port other than 8080 for the HTTP binding.

Josh

On Tuesday, May 19, 2015 at 6:02:08 PM UTC+1, Dragisa Krsmanovic wrote:

 I got Docker working for Akka app by having this in build.sbt:

 mainClass := Some(my.project.Main)
 dockerBaseImage := dockerfile/java:oracle-java8
 maintainer := myself
 bashScriptConfigLocation := Some(${app_home}/../conf/jvmopts)
 dockerExposedPorts := Seq(2553, 8080)
 dockerRepository := Some(mydockerid)


 I had all custom JVM opts in: universal/conf.jvmopts. For example my 
 cluster seed config or db connection settings.


 On Tue, May 19, 2015 at 9:19 AM, Josh F jof...@gmail.com javascript: 
 wrote:

 Hi all,

 I have written a Scala web application using Akka+Spray, and am now 
 trying to run it inside a Docker container - but am really struggling to 
 get it to work.

 It looks like the problem is that Akka messages are not being delivered. 
 I have read some info about needing to set 
 akka.remote.netty.tcp.bind-hostname and akka.remote.netty.tcp.bind-port 
 settings 
 IF using remote actors, however I am not using remote actors... at the 
 moment I just have a standalone actor system inside a single docker 
 container. So I have not set these properties.

 The logs and errors that I'm seeing are:

 2015-05-19 16:01:18 INFO 
  
 [myservice-akka.actor.default-dispatcher-6:a.e.s.Slf4jLogger$$anonfun$receive$1$$anonfun$applyOrElse$3@74]
  
 - Message [akka.dispatch.sysmsg.DeathWatchNotification] from 
 Actor[akka://myservice/user/IO-HTTP/listener-0#-697002067] to 
 Actor[akka://myservice/user/IO-HTTP/listener-0#-697002067] 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'.
 2015-05-19 16:01:18 ERROR 
 [myservice-akka.actor.default-dispatcher-4:a.e.s.Slf4jLogger$$anonfun$receive$1$$anonfun$applyOrElse$1@66]
  
 - Error during selector management task: 
 [java.nio.channels.ClosedChannelException]
 java.nio.channels.ClosedChannelException: null
 at 
 java.nio.channels.spi.AbstractSelectableChannel.register(AbstractSelectableChannel.java:194)
  
 ~[na:1.7.0_75]
 at 
 akka.io.SelectionHandler$ChannelRegistryImpl$$anon$4.tryRun(SelectionHandler.scala:157)
  
 ~[akka-actor_2.11-2.3.9.jar:na]
 at 
 akka.io.SelectionHandler$ChannelRegistryImpl$Task.run(SelectionHandler.scala:215)
  
 ~[akka-actor_2.11-2.3.9.jar:na]

 I think this exception is caused when I try to bind to a port for HTTP:

 IO(Http) ! Http.Bind(service, interface = 0.0.0.0, port = 8080)


 I have exposed port 8080 and ran the container with a port mapping, -p 
 8080:8080 ... and I have also tried using different a different port than 
 8080, so I don't think the problem is related to the binding itself, but 
 rather I think perhaps the Akka message is not being delivered.


 Does anyone have any idea what the problem might be? Have been trying to get 
 this to work all day!


 Thanks for any help,

 Josh

  -- 
  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 javascript:.
 To post to this group, send email to akka...@googlegroups.com 
 javascript:.
 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] Need help with getting an Akka application to run inside a Docker container

2015-05-19 Thread Josh F
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.


[akka-user] Need help with getting an Akka application to run inside a Docker container

2015-05-19 Thread Josh F
Hi all,

I have written a Scala web application using Akka+Spray, and am now trying 
to run it inside a Docker container - but am really struggling to get it to 
work.

It looks like the problem is that Akka messages are not being delivered. I 
have read some info about needing to set akka.remote.netty.tcp.bind-hostname
 and akka.remote.netty.tcp.bind-port settings IF using remote actors, 
however I am not using remote actors... at the moment I just have a 
standalone actor system inside a single docker container. So I have not set 
these properties.

The logs and errors that I'm seeing are:

2015-05-19 16:01:18 INFO 
 
[myservice-akka.actor.default-dispatcher-6:a.e.s.Slf4jLogger$$anonfun$receive$1$$anonfun$applyOrElse$3@74]
 
- Message [akka.dispatch.sysmsg.DeathWatchNotification] from 
Actor[akka://myservice/user/IO-HTTP/listener-0#-697002067] to 
Actor[akka://myservice/user/IO-HTTP/listener-0#-697002067] 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'.
2015-05-19 16:01:18 ERROR 
[myservice-akka.actor.default-dispatcher-4:a.e.s.Slf4jLogger$$anonfun$receive$1$$anonfun$applyOrElse$1@66]
 
- Error during selector management task: 
[java.nio.channels.ClosedChannelException]
java.nio.channels.ClosedChannelException: null
at 
java.nio.channels.spi.AbstractSelectableChannel.register(AbstractSelectableChannel.java:194)
 
~[na:1.7.0_75]
at 
akka.io.SelectionHandler$ChannelRegistryImpl$$anon$4.tryRun(SelectionHandler.scala:157)
 
~[akka-actor_2.11-2.3.9.jar:na]
at 
akka.io.SelectionHandler$ChannelRegistryImpl$Task.run(SelectionHandler.scala:215)
 
~[akka-actor_2.11-2.3.9.jar:na]

I think this exception is caused when I try to bind to a port for HTTP:

IO(Http) ! Http.Bind(service, interface = 0.0.0.0, port = 8080)


I have exposed port 8080 and ran the container with a port mapping, -p 
8080:8080 ... and I have also tried using different a different port than 8080, 
so I don't think the problem is related to the binding itself, but rather I 
think perhaps the Akka message is not being delivered.


Does anyone have any idea what the problem might be? Have been trying to get 
this to work all day!


Thanks for any help,

Josh

-- 
  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-19 Thread Josh F
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.