Re: [akka-user] Akka remoting and Docker

2015-11-15 Thread Heiko Seeberger
Alex,

Indeed you are overlooking something: the loopback interface (localhost aka 
127.0.0.1) is only for local access, i.e. from the local machine. Why don’t you 
bind to 0.0.0.0 instead?

Cheers
Heiko

--

Heiko Seeberger
Home: heikoseeberger.de 
Twitter: @hseeberger 
Public key: keybase.io/hseeberger 
> On 15 Nov 2015, at 14:33, Alex Wouda  wrote:
> 
> Hi,
> 
> I'm trying to get a simple app running in docker, this works. But then I'm 
> not able to access the remote akka system from the host. 
> 
> 
> Using scala 2.11.7 and Akka 2.4.0
> Whole project is available here: https://github.com/awouda/akka-docker.git
> 
> 
> My 'server system'  configuration:
> 
> akka {
>   actor {
> provider = "akka.remote.RemoteActorRefProvider"
>   }
>   remote {
>   enabled-transports = ["akka.remote.netty.tcp"]
>   netty.tcp {
>hostname = ${dockerIp}
>port = 9100
> 
>bind-hostname = "localhost" # internal (bind) hostname
>bind-port = 2551  # internal (bind) port
> 
>   }
> }
>   }
> 
> dockerIp is provided by a start.sh script.
> 
> The provided ip is resolved in the host and passed to the client application.
> 
> Also the port in docker is exposed by putting -p 9100:9100.
> 
> I must overlook something, or still have misconfiguration, if anyone has some 
> pointers; appreciated.
> 
> tia,
> 
> Alex
> 
> 
> -- 
> >> 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] Re: I get strange error with 2.0-M1

2015-11-15 Thread Konrad Malawski
Hi all,
thanks for trying out the early Milestone and reporting the problem!
We believe there is a bug in how the idle timeout was added, not sure if that 
specific problem is a manifestation of it,
but we'll add more tests and fixes for idle timeouts in M2 (coming out soon), 
please keep an eye out for it.

-- 
Cheers,
Konrad 'ktoso’ Malawski
Akka @ Typesafe

On 15 November 2015 at 11:21:15, Richard Grossman (richie...@gmail.com) wrote:

Thanks
Is there any impact on serving ?


On Sunday, November 15, 2015 at 8:53:05 AM UTC+2, Ryan Brozo wrote:
I am also getting the exact same error in 2.0-M1.

I tried some logging using the logRequestResult directive to see which requests 
are getting the InternalServerError. But it seems none of the requests I'm 
making are getting a 500 status code.




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

2015-11-15 Thread Alex Wouda
Thanks. 

Also I needed the bind-port and port to be the same. I do not get actually 
get why yet, but for now my app is working.


This config works.


akka {
  actor {
provider = "akka.remote.RemoteActorRefProvider"
  }
  remote {
  enabled-transports = ["akka.remote.netty.tcp"]
  netty.tcp {
   port = 9100

   bind-hostname = ${dockerIp} # internal (bind) hostname // or remote 
ip
   bind-port = 9100  # internal (bind) port // must be same 
as it seems to port

  }
}
  }


regards,

Alex




On Sunday, November 15, 2015 at 2:59:16 PM UTC+1, Heiko Seeberger wrote:
>
> Alex,
>
> Indeed you are overlooking something: the loopback interface (localhost 
> aka 127.0.0.1) is only for local access, i.e. from the local machine. Why 
> don’t you bind to 0.0.0.0 instead?
>
> Cheers
> Heiko
>
> --
>
> *Heiko Seeberger*
> Home: heikoseeberger.de
> Twitter: @hseeberger 
> Public key: keybase.io/hseeberger
>
> On 15 Nov 2015, at 14:33, Alex Wouda  
> wrote:
>
> Hi,
>
> I'm trying to get a simple app running in docker, this works. But then I'm 
> not able to access the remote akka system from the host. 
>
>
> Using scala 2.11.7 and Akka 2.4.0
> Whole project is available here: https://github.com/awouda/akka-docker.git
>
>
> My 'server system'  configuration:
>
> akka {
>   actor {
> provider = "akka.remote.RemoteActorRefProvider"
>   }
>   remote {
>   enabled-transports = ["akka.remote.netty.tcp"]
>   netty.tcp {
>hostname = ${dockerIp}
>port = 9100
>
>bind-hostname = "localhost" # internal (bind) hostname
>bind-port = 2551  # internal (bind) port
>
>   }
> }
>   }
>
> dockerIp is provided by a start.sh script.
>
> The provided ip is resolved in the host and passed to the client 
> application.
>
> Also the port in docker is exposed by putting -p 9100:9100.
>
> I must overlook something, or still have misconfiguration, if anyone has 
> some pointers; appreciated.
>
> tia,
>
> Alex
>
>
> -- 
> >> 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] Akka remoting and Docker

2015-11-15 Thread Alex Wouda
Hi,

I'm trying to get a simple app running in docker, this works. But then I'm 
not able to access the remote akka system from the host. 


Using scala 2.11.7 and Akka 2.4.0
Whole project is available here: https://github.com/awouda/akka-docker.git


My 'server system'  configuration:

akka {
  actor {
provider = "akka.remote.RemoteActorRefProvider"
  }
  remote {
  enabled-transports = ["akka.remote.netty.tcp"]
  netty.tcp {
   hostname = ${dockerIp}
   port = 9100

   bind-hostname = "localhost" # internal (bind) hostname
   bind-port = 2551  # internal (bind) port

  }
}
  }

dockerIp is provided by a start.sh script.

The provided ip is resolved in the host and passed to the client 
application.

Also the port in docker is exposed by putting -p 9100:9100.

I must overlook something, or still have misconfiguration, if anyone has 
some pointers; appreciated.

tia,

Alex

-- 
>>  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: I get strange error with 2.0-M1

2015-11-15 Thread Richard Grossman
Thanks
Is there any impact on serving ?


On Sunday, November 15, 2015 at 8:53:05 AM UTC+2, Ryan Brozo wrote:
>
> I am also getting the exact same error in 2.0-M1.
>
> I tried some logging using the logRequestResult directive to see which 
> requests are getting the InternalServerError. But it seems none of the 
> requests I'm making are getting a 500 status code.
>
>
>
>
>

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


[akka-user] Re: microservices multi actor persistence and sharding question.

2015-11-15 Thread sd d
Log
---
I am seeing the defEventStoreSupervisorCoordinator and 
defEventStoreActorCoordinator but these are not storing into the cassandra 
db and when this microservice recevies the event it tries to register the 
coordinators dynamically.

---

ith configuration settings 'akka.log-dead-letters' and 
'akka.log-dead-letters-during-shutdown'.Worker Startup 
###

[INFO] [11/15/2015 14:24:12.704] 
[ClusterSystem-akka.actor.default-dispatcher-16] 
[akka.tcp://ClusterSystem@127.0.0.1:2552/system/sharding/defEventStoreSupervisorCoordinator]
 
ClusterSingletonManager state change [Start -> Younger]

[INFO] [11/15/2015 14:24:12.704] 
[ClusterSystem-akka.actor.default-dispatcher-18] 
[akka.tcp://ClusterSystem@127.0.0.1:2552/system/sharding/defEventStoreActorCoordinator]
 
ClusterSingletonManager state
change [Start -> Younger]
ShardId --->36
[WARN] [11/15/2015 14:24:46.816] 
[ClusterSystem-akka.actor.default-dispatcher-25] 
[akka.tcp://ClusterSystem@127.0.0.1:2552/system/sharding/defEventStoreSupervisor]
 
Trying to register to coordinator at
 [Some(ActorSelection[Anchor(akka.tcp://ClusterSystem@127.0.0.1:2550/), 
Path(/system/sharding/defEventStoreSupervisorCoordinator/singleton/coordinator)])],
 
but no acknowledgement. Total [1] buffered m
essages.

[WARN] [11/15/2015 14:24:48.816] 
[ClusterSystem-akka.actor.default-dispatcher-18] 
[akka.tcp://ClusterSystem@127.0.0.1:2552/system/sharding/defEventStoreSupervisor]
 
Trying to register to coordinator at
 [Some(ActorSelection[Anchor(akka.tcp://ClusterSystem@127.0.0.1:2550/), 
Path(/system/sharding/defEventStoreSupervisorCoordinator/singleton/coordinator)])],
 
but no acknowledgement. Total [1] buffered m
essages.

On Sunday, November 15, 2015 at 2:08:54 PM UTC-5, sd d wrote:
>
> *Hello,*
>
>
> *Source Code:*
>
> https://github.com/sdab75/spring-boot-akka-cluster-sharding
>
>
> *Scenario:*
>
>
>1. Abc and Def are 2 micro services and they communicates with each 
>other through their respective Async Event Listeners ( these are 2 
> services 
>are in the same cluster because they need to communicate with each other).
>2. Each microservice set up the following way.
>- Akka-PubSub-Listener to consume event topic.
>   - And the Listener uses EventStoreSupervisor sharded region to hand 
>   over the request to the  respective EventStoreActor which stores the 
>   validated event and further publish event for other microservice.
>   
> *Issue:*
>
>
>1. Since these micro services (Abc and Def) does different things I 
>need to have to corresponding message extractors and sharded regions. But 
>when I start these micro services in the same cluster, only the first seed 
>node corresponding sharded region and coordinator gets created and started.
>- Example:
>  - If Abc service is on 2550 and Def on 2551. I only see sharded 
>  region and coordinator created for Abc microservice.
>  - If I put Def on 2550 then I can see Def corresponding 
>  coordinator and region created.
>   
> The only way to create different sharded regions and coordinators is to 
> put them on different clusters (i.e) each microservice will have its own 
> cluster setup. If I do this then microsevice’s can’t communicate with each 
> because they are not part of the same cluster.
>
>
> How do I resolve this issue? I need persistence for my received events. 
> What is recommended paradigms in akka for this scenario. I am relatively 
> new to the akka world, please let me know if my understanding is incorrect 
> on akka cluster sharding.
>
>
> Thanks,
>
> SD
>
>
>

-- 
>>  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] 1.3.5 The finer points of stream materialization

2015-11-15 Thread Gary Struthers
2.0 M1 doc "Note: This is not yet implemented as stated here, this document 
illustrates intent." 
OK, things will change but how do I bind an object reference to a Flow or 
PushStage at materialization time in the current implementation?

Gary

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


[akka-user] Re: Example for change in 2.0-M1 stream

2015-11-15 Thread Tim Harper
As you've probably noticed in the migration documentation, the migration 
path for GraphStage is not yet documented.

http://doc.akka.io/docs/akka-stream-and-http-experimental/2.0-M1/scala/migration-guide-1.0-2.x-scala.html#FlexiMerge_an_FlexiRoute_has_been_replaced_by_GraphStage

If I were you, I'd start with the implementation of Broadcast, 
here: 
https://github.com/akka/akka/blob/releasing-akka-stream-and-http-experimental-2.0-M1/akka-stream/src/main/scala/akka/stream/scaladsl/Graph.scala#L254

Then, replace with your custom shape, etc.

Hope that helps.

On Thursday, November 12, 2015 at 1:46:48 PM UTC-7, tigerfoot wrote:
>
> Hello,
>
> I have a "switch" code shown below in Akka stream 1.0.  I'll be totally 
> honest, I don't understand 100% of what's going on here--I reworked it from 
> a sample found someplace.  Is there an example somewhere of what an 
> equivalent structure would look like in 2.0-M1?
>
> Thanks for any hints!
>
> import FanOutShape._
> class CommandShape(_init: Init[QM[Command]] = 
> Name[QM[Command]]("CommandRouter")) extends FanOutShape[QM[Command]](_init) 
> {
> val outMsg  = newOutlet[QM[MessageCommand]]("message")
> val outFallthru = newOutlet[QM[Command]]("fallthru")  // unknown message
> protected override def construct(i: Init[QM[Command]]) = new 
> CommandShape(i)
> }
>
> // This next bit is the Flow (FlexiRoute) that does the "smart fanout" 
> based on the switch logic
> // using the FanOutShape designed above.
> case class CommandRouter() extends FlexiRoute[QM[Command], 
> CommandShape](new CommandShape, Attributes.name("CommandRouter")) {
> import FlexiRoute._
>
> override def createRouteLogic(p: PortT) = new RouteLogic[QM[Command]] {
> override def initialState = State[Any](DemandFromAll(p.outMsg, 
> p.outFallthru)) { (ctx, _, element) =>
> element.body match {
> case c: MessageCommand => ctx.emit(p.outMsg){
> val mc = element.body.asInstanceOf[MessageCommand]
> element.copy(
> metaTags = List(  // Add meaningful metatags to message for error output
> mc.recipient.firstName,
> mc.recipient.lastName
> ) ++ mc.recipient.contacts.map{case(k,v) => k+":"+v}.toList,
> body = mc
> )
> }
> // case other commands here...
> case unknown=> ctx.emit(p.outFallthru)(element)
> }
> SameState
> }
>
> override def initialCompletionHandling = eagerClose
> }
> }
>
> To use it in a flow I would do something like:
>
> val commandSwitch  = builder.add(CommandRouter())
>

-- 
>>  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: 1.3.5 The finer points of stream materialization

2015-11-15 Thread Tim Harper
Gary,

I might be lacking necessary context; if not, your question seems a little 
vague.

Some of the Source factory methods, such as `actorPublisher` or `actorRef`, 
yield the instantiated `ActorRef` as the materialized value for the stream. 
You can use `mapMaterializedValue` to modify the value. You could also set 
an external value using mapMaterializedValue, but that would be unwise 
since a stream definition can be materialized multiple times.

Hope that helps. Otherwise, clarify your question?

On Sunday, November 15, 2015 at 8:21:07 PM UTC-7, Gary Struthers wrote:
>
> 2.0 M1 doc "Note: This is not yet implemented as stated here, this 
> document illustrates intent." 
> OK, things will change but how do I bind an object reference to a Flow or 
> PushStage at materialization time in the current implementation?
>
> Gary
>

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


[akka-user] Re: Akka Stream and Http 2.0-M1 Released!

2015-11-15 Thread Tim Harper
Excellent work!!!

On Friday, November 6, 2015 at 6:19:49 AM UTC-7, Martynas Mickevičius wrote:
>
> *Dear Hakkers*
>
> we—the Akka committers—are very pleased to announce Akka Streams & HTTP 
> 2.0-M1, the first milestone of the upcoming 2.0 release. The overarching 
> theme of this milestone is unification, both in internals and API. Thanks 
> go to all of you who tried out Streams & HTTP 1.0, your feedback—both 
> direct and indirect—has been instrumental in making this library more 
> accessible and intuitive to use.
>
> There have been several changes in user facing APIs mostly driven by two 
> goals. First, reducing the number of overloaded methods helps IDEs and 
> compilers for both Scala and Java (especially Java 8), leads to more 
> meaningful error messages, and also makes discovery of methods easier via 
> API documentation or code completion. Second, we reduced the different ways 
> certain tasks can be achieved by reducing the number of helper methods, 
> taking away potentially confusing choices. While this means that in certain 
> cases the amount of boilerplate has grown slightly, the APIs reflect more 
> directly the underlying uniform model and hence feel more consistent than 
> before. Some highlights of these changes are (for the full list see the 
> migration guide for Java 
> 
>  and Scala 
> 
> ):
>
>- Methods for creating Flows, Sources etc. from Graphs are now called 
>fromGraph instead of wrap.
>- The number of FlowGraph builder methods has been reduced to the 
>necessary minimum.
>- In the Scala DSL the only graph building API is the arrow ~> 
>notation, the edge-based alternative (more klunky) API has been removed.
>- Creating Flows, Sources, etc. from Graphs now can be only done in 
>two steps, first creating the Graph, then using fromGraph to turn it into 
>the desired target type. The second step is only necessary when 
>subsequently using the combinators defined on the Source/Flow types, reuse 
>of processing setups is better done using the language-agnostic Graph type.
>
> *For the full list of changes see the Github milestone 
>  and 
> http-2.0-M1 
> *
>
> On the internals front the most important change is that we removed almost 
> all of the custom actor-based stage implementations, thanks to a new 
> abstraction called *GraphStage*. GraphStage is a new user API that 
> replaces FlexiMerge, FlexiRoute and AsyncStage. Compared to the previous 
> abstractions GraphStage is capable of modeling a stage with any number of 
> input and output ports and asynchronous notifications and without the 
> limitations that the FlexiMerge/FlexiRoute implementations suffered. A 
> testament to the flexibility and usefulness of this new stage design is 
> that nearly all of the built-in stages are now GraphStage based 
> implementations (with the remaining ones being scheduled to be 
> rewritten—there is no reason why dedicated actors are still needed given 
> the expressive power of GraphStage). A fun fact is that this rewrite also 
> resulted in 29% jar size reduction compared to the 1.0 artifact while 
> having more features than ever before.
>
> The new GraphStage already enabled us to unify and simplify a large amount 
> of internal code, it also provides a richer customization API for users for 
> building new stages, but this is just the beginning! This new abstraction 
> is the first step towards a very important goal we have, which is called 
> *fusing*. This feature will allow declarative demarcation of actor 
> boundaries backing a streaming graph, i.e. it will be now possible to 
> execute multiple stream processing steps inside one actor, reducing the 
> number of thread-hops where they are not necessary. This is also the 
> feature that will increase performance for various use cases, including 
> HTTP.
>
> On the Akka HTTP front much has happened as well. The documentation is now 
> mostly complete and several API, marshalling as well as configuration 
> improvements have been merged as well.
>
> We hope that this evolution of Akka Streams & HTTP goes into the right 
> direction, enabling Java and Scala developers to pick up this library as a 
> tool that is universally useful in their day to day coding. To this end we 
> continue to depend on all your excellent and honest feedback, so please try 
> it out!
>
> We would like to give our special thanks and kudos to Alexander Golubev, 
> who has been contributing a steady stream of high quality, and often 
> non-trivial pull requests to Akka Streams. Thanks!
>
> Similarly, we would like to give a huge thanks and kudos to @2beaucoup, a 
> 

[akka-user] Re: Is it possible to use a the stream materialized value to dictate the HTTP response status code?

2015-11-15 Thread Tim Harper
I read enough source code to be able to answer my own question:

The stream still isn't materialized at this point, where the StatusCode and 
headers are already known.

https://github.com/akka/akka/blob/releasing-akka-stream-and-http-experimental-2.0-M1/akka-http-core/src/main/scala/akka/http/impl/engine/rendering/HttpResponseRendererFactory.scala#L59

Reasoning about it further, allowing the materialized type of the 
HttpEntity.Chunked stream to inform the status code would problematic, 
considering that some status codes (like, 204 - No Content) don't allow for 
response entities.

So, I'll plan around this.

Akka is simply great, great, great. Thanks for doing such thoughtful design 
and caring about correctness.

On Saturday, November 14, 2015 at 12:54:04 PM UTC-7, Tim Harper wrote:
>
> Hi,
>
> TLDR: I'd like to use the materialized value of a stream to decide the 
> HttpResponse code.
>
> Presently, I use a ToEntityMarshaller which marshals to:
> HttpEntity.Chunked(_, Source[Chunk, Future[Boolean]])
>
> The Materialized Future[Boolean] indicates whether the stream was 
> completely empty which is knowable as soon as an instance of the Source is 
> run.
>
> Since streams can be transformed multiple ways, and run multiple times, 
> I'd prefer to have the state which indicates whether the stream is empty 
> come from a materialized stream.
>
> So, what I'd like to know, is if it's possible to use the stream 
> materialized value to inform the response headers / code in a 
> ToResponseMarshallable. As far as I can tell, from reading the source 
> code of akka-http, it doesn't seem possible (a layer later in the process 
> materializes the Source[Chunk, Any] AFTER an HttpResponse (containing the 
> code, headers, and entity) is fully generated.
>
> If this is possible, can someone point me to an example?
>
> By the way, the stream integration for Akka HTTP is really, really 
> amazing! Great work on it, Akka devs! I'm planning to blog about this and 
> do a little walk-through tutorial on how to content-negotiated streaming of 
> either JSON or protocol buffers.
>
> Thanks!
>
> Tim
>

-- 
>>  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] microservices multi actor persistence and sharding question.

2015-11-15 Thread sd d


*Hello,*


*Source Code:*

https://github.com/sdab75/spring-boot-akka-cluster-sharding


*Scenario:*


   1. Abc and Def are 2 micro services and they communicates with each 
   other through their respective Async Event Listeners ( these are 2 services 
   are in the same cluster because they need to communicate with each other).
   2. Each microservice set up the following way.
   - Akka-PubSub-Listener to consume event topic.
  - And the Listener uses EventStoreSupervisor sharded region to hand 
  over the request to the  respective EventStoreActor which stores the 
  validated event and further publish event for other microservice.
  
*Issue:*


   1. Since these micro services (Abc and Def) does different things I need 
   to have to corresponding message extractors and sharded regions. But when I 
   start these micro services in the same cluster, only the first seed node 
   corresponding sharded region and coordinator gets created and started.
   - Example:
 - If Abc service is on 2550 and Def on 2551. I only see sharded 
 region and coordinator created for Abc microservice.
 - If I put Def on 2550 then I can see Def corresponding 
 coordinator and region created.
  
The only way to create different sharded regions and coordinators is to put 
them on different clusters (i.e) each microservice will have its own 
cluster setup. If I do this then microsevice’s can’t communicate with each 
because they are not part of the same cluster.


How do I resolve this issue? I need persistence for my received events. 
What is recommended paradigms in akka for this scenario. I am relatively 
new to the akka world, please let me know if my understanding is incorrect 
on akka cluster sharding.


Thanks,

SD


-- 
>>  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] Is it possible to use a the stream materialized value to dictate the HTTP response status code?

2015-11-15 Thread Tim Harper
So sorry about the double post on this one :(. I had an early send and thought 
if I deleted it in time maybe it wouldn't send. 

Sent from my iPhone

> On Nov 14, 2015, at 12:54, Tim Harper  wrote:
> 
> Hi,
> 
> TLDR: I'd like to use the materialized value of a stream to decide the 
> HttpResponse code.
> 
> Presently, I use a ToEntityMarshaller which marshals to:
> HttpEntity.Chunked(_, Source[Chunk, Future[Boolean]])
> 
> The Materialized Future[Boolean] indicates whether the stream was completely 
> empty which is knowable as soon as an instance of the Source is run.
> 
> Since streams can be transformed multiple ways, and run multiple times, I'd 
> prefer to have the state which indicates whether the stream is empty come 
> from a materialized stream.
> 
> So, what I'd like to know, is if it's possible to use the stream materialized 
> value to inform the response headers / code in a ToResponseMarshallable. As 
> far as I can tell, from reading the source code of akka-http, it doesn't seem 
> possible (a layer later in the process materializes the Source[Chunk, Any] 
> AFTER an HttpResponse (containing the code, headers, and entity) is fully 
> generated.
> 
> If this is possible, can someone point me to an example?
> 
> By the way, the stream integration for Akka HTTP is really, really amazing! 
> Great work on it, Akka devs! I'm planning to blog about this and do a little 
> walk-through tutorial on how to content-negotiated streaming of either JSON 
> or protocol buffers.
> 
> Thanks!
> 
> Tim
> -- 
> >> 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/HSz9Ld-J-oc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at 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.