[akka-user] Upgrade to 2.5.3 Cluster Nodes can't Connect.

2017-07-11 Thread kraythe
I am trying to upgrade our system to 2.5.3 and play 2.6 and when we do so 
the cluster nodes can no longer connect to each other. We get logs like 
this: 

Jul 07 16:25:38 jp-6.mycompany.com application-9001.log:  2017-07-07 
21:25:38 + - [WARN] - [ReliableDeliverySupervisor] 
akka.tcp://play-akka@127.0.0.1:2551/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fplay-akka%4010.8.1.142%3A2551-1
 
-  Association with remote system [akka.tcp://play-akka@10.8.1.142:2551] 
has failed, address is now gated for [5000] ms. Reason: [Association failed 
with [akka.tcp://play-akka@10.8.1.142:2551]] Caused by: [Connection 
refused: /10.8.1.142:2551]

Jul 07 16:25:42 jp-6.mycompany.com application-9001.log:  2017-07-07 
21:25:42 + - [WARN] - [JoinSeedNodeProcess] 
akka.tcp://play-akka@127.0.0.1:2551/system/cluster/core/daemon/joinSeedNodeProcess-1
 
-  Couldn't join seed nodes after [317] attempts, will try again. 
seed-nodes=[akka.tcp://play-akka@10.8.1.249:2551, 
akka.tcp://play-akka@10.8.1.142:2551]

Jul 07 16:25:42 jp-6.mycompany.com application-9001.log:  2017-07-07 
21:25:42 + - [WARN] - [NettyTransport] NettyTransport(akka://play-akka) 
-  *Remote connection to [null] failed* with java.net.ConnectException: 
Connection refused: /10.8.1.142:2551

This goes on until the VM actually dies. I am at a loss to explain why this 
happens only with the upgrade when we changed very little other code. All 
of this is happening inside the Amazon AWS cluster when we find the seed 
nodes with code like the following: 

final String awsEnabled = System.getenv(GlobalConstants.AWS_ENABLED);
final String environment = System.getenv(GlobalConstants.AWS_ENVIRONMENT_NAME);
final String seedNodes = System.getenv(GlobalConstants.TCP_MEMBERS);
final String protocol = "akka.tcp";
final String system = actorSystem.name();
final int port = 
Optional.ofNullable(System.getProperty("akka.cluster.port")).map(Integer::parseInt).orElse(2551);

if (awsEnabled != null && awsEnabled.equalsIgnoreCase("true")) {
final AutoScalingGroup group = AwsUtils.getAutoScalingClient()
.describeAutoScalingGroups(new DescribeAutoScalingGroupsRequest()

.withAutoScalingGroupNames(environment)).getAutoScalingGroups().get(0);
return group.getInstances().stream()
.map(i -> Address.apply(protocol, system,

SystemStartupActor.findInstanceFromId(i.getInstanceId()).getPrivateIpAddress(), 
port)).collect(Collectors.toList());



You an see that this is pretty standard code and nothing has changed other 
than the upgrade. The code above has been working fine for ages. 

Can anyone clue me in as to what may be going on here? 

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


Re: [akka-user] Re: withSupervisionStrategy passed a japi Function but compiler complains that its expecting a scala Function1

2017-07-11 Thread Konrad “ktoso” Malawski
As I replied above, it has been fixed in later versions of Akka - you have
not stated what version you’re using.
Please upgrade to the latest, they’re all binary backwards compatible so
you can bump the Akka version.

— Konrad


On 26 October 2016 at 21:31:29, Konrad Malawski (
konrad.malaw...@lightbend.com) wrote:

Well that's exactly the thing we fixed.
As you've found in the docs.

We'll release a stable this week, please upgrade then.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 26 October 2016 at 13:29:52, murtuza chhil (chil...@gmail.com) wrote:

Still looking for an answer to this, if anyone can point out whats wrong
and how to get it done.
I was looking at some HTTP docs and there was a fix in there and wonder if
the problem is related

http://doc.akka.io/docs/akka-http/current/java/http/migration-guide/migration-guide-2.4.x-3.0.x.html#akka-http-2-4-11-3-0-0

"The Java DSL for the following directives pathPrefixText,
rawPathPrefixTest, rawPathPrefix, pathSuffix
accidentally used the Scala function type instead of the
java.util.function.Function"

-chhil

On Thursday, October 20, 2016 at 10:33:03 PM UTC+5:30, murtuza chhil wrote:
>
> Having trouble setting up withSupervisionStrategy for the materializer.
>
> I get a compile time error of
>
>   Error:(30, 23) java: no suitable method found for 
> withSupervisionStrategy(akka.japi.function.Function)
> method 
> akka.stream.ActorMaterializerSettings.withSupervisionStrategy(scala.Function1)
>  is not applicable
>   (argument mismatch; 
> akka.japi.function.Function
>  cannot be converted to 
> scala.Function1)
> method 
> akka.stream.ActorMaterializerSettings.withSupervisionStrategy(akka.japi.function.Function)
>  is not applicable
>   (argument mismatch; 
> akka.japi.function.Function
>  cannot be converted to 
> akka.japi.function.Function)
>
> It for some reason is confusing the method that would be used for scala
> (expecting a function1).
> How do I get this to compile using java?
>
> import akka.NotUsed;import akka.actor.ActorSystem;import 
> akka.actor.SupervisorStrategy;import akka.japi.function.Function;import 
> akka.stream.ActorAttributes;import akka.stream.ActorMaterializer;import 
> akka.stream.IOResult;import akka.stream.Supervision;import 
> akka.stream.javadsl.*;import akka.util.ByteString;import scala.Function1;
> import java.io.File;import java.util.concurrent.CompletionStage;
> /**
>  * Created by Murtuza on 10/19/2016.
>  */public class EventFilter {
>
> public static void main(String[] args) {
>
> State filteredState = new State("ok");
> ActorSystem system = ActorSystem.create("system");
> ActorMaterializer mat = ActorMaterializer.create(system);
> Function decider = thr 
> ->SupervisorStrategy.resume();
>
> mat.settings().withSupervisionStrategy(decider);
>
> }
>
> Below supervisionStrategy expects a Function1 unlike for the mat which
> expects a japi function
>
>
> Flow parse = Flow.of(String.class)
> .map(x -> {
> //System.out.println(LogStreamProcessor.parseLineEx(x).get());
> return LogStreamProcessor.parseLineEx(x).get();
>
> }).withAttributes(ActorAttributes.supervisionStrategy(...));
>
> So I am kinda confused on passing the strategy.
>
> Any help will be greatly appreciated.
>
> -chhil
> ​
>
--
>> 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 https://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.

[akka-user] Akka Camel and Akka Streams

2017-07-11 Thread 'Andreas Gies' via Akka User List
Hello HAkkers, 

we are maintaining an integration framework (OSGi) project built on top of 
ActiveMQ, Spray and Camel implemented in Scala [1]

Most of our internal API's rely on Akka and some also on the Akka-Camel 
integration. 


With the next major release we plan to upgrade our Spray routes to 
Akka-Http. Now that I have started looking at the concrete 
steps I have noticed that Akka-Camel is also deprecated and to be replaced 
with alpakka. 

I had a look through the Alpakka project. So far I haven't found the 
replacement for the Akka-Camel efforts in there. 
Perhaps I have overlooked something or is the replacement just on the 
roadmap ? 

Also I did have a look at the JMS part of Alpakka. It seems that this 
implementation currently only supports TextMessages 
and ignores any properties within the message. If I understand the 
implementation correctly, it would fail the stream in case 
of any JMSException and also when the buffer has been filled up ?

On a broader level I was wondering if the implementation should be in the 
form that the inbound stream fails if and only if 
the connection is irrecoverably broken and in other cases the Stream should 
reconnect transparently. 

Also on a broader level I have noticed, that the messages are acknowledged 
as soon as they pushed. Coming from a JMS
background that feels a bit strange to me, but that might be because I am 
unfamiliar with the streaming API. In our world 
a message is normally acknowledged when it has been processed successfully 
(which is normally it has been written to 
the file system, forwarded to another JMS destination or triggered some 
execution in the database). 

If the container crashes before it has acknowledged the message, the 
message will be redelivered. In cases we encounter 
an error we pass the message to an error handling destination or a retry 
destination. 


Apparently the architecture and the acceptance level of message loss 
changes when switching to a streaming approach. 


For now I have some concrete questions:

1) Have I missed the Camel replacement in Alpakka and if so, where is it 
located within Alpakka ?
2) How are others coping with the "window of potential message loss" when 
migrating from pure JMS flows to streams ?
3) Any pointers to good hands-on white papers are much appreciated. I have 
read through some and also through most 
of the streams documentation, but I guess I need to get my hands dirty 
... 
4) I don't dare to ask, but if anyone is using Akka / AkkaHttp and / or 
AkkaStream within OSGi I would be more than happy 
to exchange experiences & ideas. 

[1] https://github.com/woq-blended/blended


Thanks in advance for your attention 
Best regards 
Andreas

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


Re: [akka-user] Re: withSupervisionStrategy passed a japi Function but compiler complains that its expecting a scala Function1

2017-07-11 Thread Stuart Roebuck
I seem to be encountering the same issue within the latest release of the 
Lagom framework and it's associated Akka libraries.

Has this been resolved?


On Wednesday, 26 October 2016 13:40:47 UTC+1, murtuza chhil wrote:
>
> Though my code is not HTTP related, so whatever is fixed will fix my 
> problem too , right?
>
> -chhil
>
> On Wednesday, October 26, 2016 at 6:08:21 PM UTC+5:30, murtuza chhil wrote:
>>
>> Thanks Konrad.
>>
>> -chhil
>>
>>
>> On Wednesday, October 26, 2016 at 6:01:34 PM UTC+5:30, Konrad Malawski 
>> wrote:
>>>
>>> Well that's exactly the thing we fixed.
>>> As you've found in the docs.
>>>
>>> We'll release a stable this week, please upgrade then.
>>>
>>> -- 
>>> Konrad `ktoso` Malawski
>>> Akka  @ Lightbend 
>>>
>>> On 26 October 2016 at 13:29:52, murtuza chhil (chi...@gmail.com) wrote:
>>>
>>> Still looking for an answer to this, if anyone can point out whats wrong 
>>> and how to get it done. 
>>> I was looking at some HTTP docs and there was a fix in there and wonder 
>>> if the problem is related
>>>
>>>
>>> http://doc.akka.io/docs/akka-http/current/java/http/migration-guide/migration-guide-2.4.x-3.0.x.html#akka-http-2-4-11-3-0-0
>>>
>>> "The Java DSL for the following directives pathPrefixText, 
>>> rawPathPrefixTest, rawPathPrefix, pathSuffix
>>> accidentally used the Scala function type instead of the 
>>> java.util.function.Function"
>>>
>>> -chhil
>>>
>>> On Thursday, October 20, 2016 at 10:33:03 PM UTC+5:30, murtuza chhil 
>>> wrote: 

 Having trouble setting up withSupervisionStrategy for the materializer.

 I get a compile time error of

   Error:(30, 23) java: no suitable method found for 
 withSupervisionStrategy(akka.japi.function.Function)
 method 
 akka.stream.ActorMaterializerSettings.withSupervisionStrategy(scala.Function1)
  is not applicable
   (argument mismatch; 
 akka.japi.function.Function
  cannot be converted to 
 scala.Function1)
 method 
 akka.stream.ActorMaterializerSettings.withSupervisionStrategy(akka.japi.function.Function)
  is not applicable
   (argument mismatch; 
 akka.japi.function.Function
  cannot be converted to 
 akka.japi.function.Function)

 It for some reason is confusing the method that would be used for scala 
 (expecting a function1).
 How do I get this to compile using java?

 import akka.NotUsed;import akka.actor.ActorSystem;import 
 akka.actor.SupervisorStrategy;import akka.japi.function.Function;import 
 akka.stream.ActorAttributes;import akka.stream.ActorMaterializer;import 
 akka.stream.IOResult;import akka.stream.Supervision;import 
 akka.stream.javadsl.*;import akka.util.ByteString;import scala.Function1;
 import java.io.File;import java.util.concurrent.CompletionStage;
 /**
  * Created by Murtuza on 10/19/2016.
  */public class EventFilter {

 public static void main(String[] args) {

 State filteredState = new State("ok");
 ActorSystem system = ActorSystem.create("system");
 ActorMaterializer mat = ActorMaterializer.create(system);
 Function decider = thr 
 ->SupervisorStrategy.resume();

 mat.settings().withSupervisionStrategy(decider);

 }

 Below supervisionStrategy expects a Function1 unlike for the mat which 
 expects a japi function


 Flow parse = Flow.of(String.class)
 .map(x -> {
 //System.out.println(LogStreamProcessor.parseLineEx(x).get());
 return LogStreamProcessor.parseLineEx(x).get();

 }).withAttributes(ActorAttributes.supervisionStrategy(...));

 So I am kinda confused on passing the strategy.

 Any help will be greatly appreciated.

 -chhil
 ​

>>> --
>>> >> 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 https://groups.google.com/group/akka-user.
>>> For more 

[akka-user] Akka-Typed on a new project?

2017-07-11 Thread Mushtaq Ahmed
I read the blog for coexistence of typed actors 
 with the current 
ecosystem. This looks very promising. I infer that a new project can be 
based upon the Akka-Typed API and use the adapter to integrate with 
unsupported modules like Akka-Cluster for now. 

Will that work? If our project is planning to go live after 1 year or so, 
will that be a recommended approach? Or do you think the API changes will 
be huge in near future? Will appreciate some guidance from the core team on 
this one.

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