Re: [akka-user] (AKKA V2.3.9) Akka configured seed nodes are leaving cluster and unreachable/reachable warning message is getting logged. ::: Spring Class (ClassPathXmlApplicationContext) serializatio

2016-08-24 Thread vipin mandloi
Hello,

Thanks for your quick response.

*How can i avoid sending ClassPathXmlApplicationContext ?*

I didn't have any custom code for serialization. I'm using akka provided 
cluster message Serializer


serializers {
 akka-cluster = "akka.cluster.protobuf.ClusterMessageSerializer"
}
serialization-bindings {
"akka.cluster.ClusterMessage" = akka-cluster
} 




On Wednesday, August 24, 2016 at 3:34:04 PM UTC+5:30, Patrik Nordwall wrote:
>
> Then you must avoid sending ClassPathXmlApplicationContext. It's not 
> serializable, and should not be, so you can't send it.
>
> On Wed, Aug 24, 2016 at 10:08 AM, vipin mandloi <vipinm...@gmail.com 
> > wrote:
>
>> Hello,
>>
>>
>> Thanks a lot for the response.
>>
>> *Enabled remote debugging , Error - "Failed to write message to Transport 
>> " is  occurring due to Spring Class (ClassPathXmlApplicationContext) 
>> serialization failure. *
>>
>> Please let me know whether *Akka Cluster Remote Routess  usages support 
>> spring configuration ?*
>>
>>  if yes then how can i fix *Spring Class 
>> (ClassPathXmlApplicationContext) serialization failure ? *
>>
>>
>> *Logged error message:-*
>>
>>
>> *[ERROR] [08/24/2016 03:03:13.934] 
>> [ClusterSystem-akka.remote.default-remote-dispatcher-23] 
>> [akka.tcp://ClusterSystem*
>>
>>
>> *@localhost:2551/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40localhost%3A2552-0/en*
>>
>> *dpointWriter] AssociationError [akka.tcp://ClusterSystem@localhost:2551] 
>> -> [akka.tcp://ClusterSystem@localhost:2552*
>>
>> *]: Error [Failed to write message to the transport] [*
>>
>> *akka.remote.EndpointException: Failed to write message to the transport*
>>
>> *Caused by: java.lang.IllegalArgumentException: Can't serialize object of 
>> type class org.springframework.context.supp*
>>
>> *ort.ClassPathXmlApplicationContext*
>>
>> at 
>> akka.cluster.protobuf.ClusterMessageSerializer.toBinary(ClusterMessageSerializer.scala:74)
>>
>> at 
>> akka.serialization.Serialization$$anonfun$serialize$1.apply(Serialization.scala:90)
>>
>> at 
>> akka.serialization.Serialization$$anonfun$serialize$1.apply(Serialization.scala:90)
>>
>> at scala.util.Try$.apply(Try.scala:161)
>>
>> at 
>> akka.serialization.Serialization.serialize(Serialization.scala:90)
>>
>> at 
>> akka.remote.serialization.DaemonMsgCreateSerializer.serialize(DaemonMsgCreateSerializer.scala:107)
>>
>> at 
>> akka.remote.serialization.DaemonMsgCreateSerializer$$anonfun$propsProto$1$1.apply(DaemonMsgCreateSerializ
>>
>> er.scala:56)
>>
>> at 
>> akka.remote.serialization.DaemonMsgCreateSerializer$$anonfun$propsProto$1$1.apply(DaemonMsgCreateSerializ
>>
>> er.scala:56)
>>
>> at 
>> scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
>>
>> at 
>> scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
>>
>> at scala.collection.immutable.List.foreach(List.scala:318)
>>
>> at 
>> scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
>>
>> at scala.collection.AbstractTraversable.map(Traversable.scala:105)
>>
>> at 
>> akka.remote.serialization.DaemonMsgCreateSerializer.propsProto$1(DaemonMsgCreateSerializer.scala:56)
>>
>> at 
>> akka.remote.serialization.DaemonMsgCreateSerializer.toBinary(DaemonMsgCreateSerializer.scala:62)
>>
>> at 
>> akka.remote.MessageSerializer$.serialize(MessageSerializer.scala:36)
>>
>> at 
>> akka.remote.EndpointWriter$$anonfun$serializeMessage$1.apply(Endpoint.scala:842)
>>
>> at 
>> akka.remote.EndpointWriter$$anonfun$serializeMessage$1.apply(Endpoint.scala:842)
>>
>> at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
>>
>> at akka.remote.EndpointWriter.serializeMessage(Endpoint.scala:841)
>>
>> at akka.remote.EndpointWriter.writeSend(Endpoint.scala:742)
>>
>> at 
>> akka.remote.EndpointWriter$$anonfun$2.applyOrElse(Endpoint.scala:717)
>>
>> at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
>>
>> at akka.remote.EndpointActor.aroundReceive(Endpoint.scala:410)
>>
>> at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
>>
>> at

Re: [akka-user] (AKKA V2.3.9) Akka configured seed nodes are leaving cluster and unreachable/reachable warning message is getting logged. ::: Spring Class (ClassPathXmlApplicationContext) serializat

2016-08-24 Thread vipin mandloi
Hello,


Thanks a lot for the response.

*Enabled remote debugging , Error - "Failed to write message to Transport " 
is  occurring due to Spring Class (ClassPathXmlApplicationContext) 
serialization failure. *

Please let me know whether *Akka Cluster Remote Routess  usages support 
spring configuration ?*

 if yes then how can i fix *Spring Class (ClassPathXmlApplicationContext) 
serialization failure ? *


*Logged error message:-*


*[ERROR] [08/24/2016 03:03:13.934] 
[ClusterSystem-akka.remote.default-remote-dispatcher-23] 
[akka.tcp://ClusterSystem*

*@localhost:2551/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40localhost%3A2552-0/en*

*dpointWriter] AssociationError [akka.tcp://ClusterSystem@localhost:2551] 
-> [akka.tcp://ClusterSystem@localhost:2552*

*]: Error [Failed to write message to the transport] [*

*akka.remote.EndpointException: Failed to write message to the transport*

*Caused by: java.lang.IllegalArgumentException: Can't serialize object of 
type class org.springframework.context.supp*

*ort.ClassPathXmlApplicationContext*

at 
akka.cluster.protobuf.ClusterMessageSerializer.toBinary(ClusterMessageSerializer.scala:74)

at 
akka.serialization.Serialization$$anonfun$serialize$1.apply(Serialization.scala:90)

at 
akka.serialization.Serialization$$anonfun$serialize$1.apply(Serialization.scala:90)

at scala.util.Try$.apply(Try.scala:161)

at 
akka.serialization.Serialization.serialize(Serialization.scala:90)

at 
akka.remote.serialization.DaemonMsgCreateSerializer.serialize(DaemonMsgCreateSerializer.scala:107)

at 
akka.remote.serialization.DaemonMsgCreateSerializer$$anonfun$propsProto$1$1.apply(DaemonMsgCreateSerializ

er.scala:56)

at 
akka.remote.serialization.DaemonMsgCreateSerializer$$anonfun$propsProto$1$1.apply(DaemonMsgCreateSerializ

er.scala:56)

at 
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)

at 
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)

at scala.collection.immutable.List.foreach(List.scala:318)

at 
scala.collection.TraversableLike$class.map(TraversableLike.scala:244)

at scala.collection.AbstractTraversable.map(Traversable.scala:105)

at 
akka.remote.serialization.DaemonMsgCreateSerializer.propsProto$1(DaemonMsgCreateSerializer.scala:56)

at 
akka.remote.serialization.DaemonMsgCreateSerializer.toBinary(DaemonMsgCreateSerializer.scala:62)

at 
akka.remote.MessageSerializer$.serialize(MessageSerializer.scala:36)

at 
akka.remote.EndpointWriter$$anonfun$serializeMessage$1.apply(Endpoint.scala:842)

at 
akka.remote.EndpointWriter$$anonfun$serializeMessage$1.apply(Endpoint.scala:842)

at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)

at akka.remote.EndpointWriter.serializeMessage(Endpoint.scala:841)

at akka.remote.EndpointWriter.writeSend(Endpoint.scala:742)

at 
akka.remote.EndpointWriter$$anonfun$2.applyOrElse(Endpoint.scala:717)

at akka.actor.Actor$class.aroundReceive(Actor.scala:465)

at akka.remote.EndpointActor.aroundReceive(Endpoint.scala:410)

at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)

at akka.actor.ActorCell.invoke(ActorCell.scala:487)

at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)

at akka.dispatch.Mailbox.run(Mailbox.scala:221)

at akka.dispatch.Mailbox.exec(Mailbox.scala:231)

at 
scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)

at 
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)

at 
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)

at 
scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)

at 
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)



Thanks,
Vipin Mandloi 

On Tuesday, August 23, 2016 at 11:33:43 PM UTC+5:30, Patrik Nordwall wrote:
>
> I would suggest that you turn on remote debug logging and hopefully find 
> the root cause of the "Failed to write message to the transport": 
> http://doc.akka.io/docs/akka/2.4/java/logging.html#Auxiliary_remote_logging_options
>
> /Patrik
>
> On Tue, Aug 23, 2016 at 5:27 PM, Rob Crawford <rob...@gmail.com 
> > wrote:
>
>> Trying to pass around an entire Spring context is a bad idea. It contains 
>> MANY objects -- you're serializing your entire application.
>>
>> Focus on serializing the state -- changeable data -- of your actor, and 
>> let Spring wire up the dependencies on the other node.
>>
>>
>> On Tuesday, August 23, 2016 at 10:19:35 AM UTC-4, vipin mandloi wrote:
>>>
>>> Hello,
>>>
>>> Thanks for your quick

Re: [akka-user] Akka configured seed nodes are leaving cluster and unreachable/reachable warning message is getting logged.

2016-08-23 Thread vipin mandloi
Hello,

Thanks for your quick response.


As soon i add 3rd node, i am getting this* unreachable/reachable message . 
and cluster is getting deformed*. till 2 nodes there is no issue.

One more things added *serialize-creators = on and serialize-messages = *
*on* to verify serialization for props and message. although i have added 
serialize for *ClassPathXmlApplicationContext (refer 1st email 
application.conf) getting serialization error*


*Error:-*

ERROR] [08/23/2016 07:02:10.705] 
[ClusterSystem-akka.actor.default-dispatcher-5] 
[akka://ClusterSystem/user/singleton] pre-creation serialization check 
failed at [akka://ClusterSystem/user/singleton/ConsumerActor]

java.lang.IllegalArgumentException: pre-creation serialization check failed 
at [akka://ClusterSystem/user/singleton/ConsumerActor]

   at 
akka.actor.dungeon.Children$class.makeChild(Children.scala:193)

   at 
akka.actor.dungeon.Children$class.actorOf(Children.scala:37)

   at akka.actor.ActorCell.actorOf(ActorCell.scala:369)

   at 
akka.contrib.pattern.ClusterSingletonManager.gotoOldest(ClusterSingletonManager.scala:516)

   at 
akka.contrib.pattern.ClusterSingletonManager$$anonfun$6.applyOrElse(ClusterSingletonManager.scala:428)

   at 
akka.contrib.pattern.ClusterSingletonManager$$anonfun$6.applyOrElse(ClusterSingletonManager.scala:417)

   at 
scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33)

   at akka.actor.FSM$class.processEvent(FSM.scala:604)

   at 
akka.contrib.pattern.ClusterSingletonManager.processEvent(ClusterSingletonManager.scala:336)

   at 
akka.actor.FSM$class.akka$actor$FSM$$processMsg(FSM.scala:598)

   at 
akka.actor.FSM$$anonfun$receive$1.applyOrElse(FSM.scala:592)

   at akka.actor.Actor$class.aroundReceive(Actor.scala:465)

   at 
akka.contrib.pattern.ClusterSingletonManager.aroundReceive(ClusterSingletonManager.scala:336)

   at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)

   at akka.actor.ActorCell.invoke(ActorCell.scala:487)

   at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)

   at akka.dispatch.Mailbox.run(Mailbox.scala:221)

   at akka.dispatch.Mailbox.exec(Mailbox.scala:231)

   at 
scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)

   at 
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)

   at 
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)

   at 
scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)

   at 
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

*Caused by: java.lang.IllegalArgumentException: Can't serialize object of 
type class 
org.springframework.context.support.ClassPathXmlApplicationContext*

   at 
akka.cluster.protobuf.ClusterMessageSerializer.toBinary(ClusterMessageSerializer.scala:74)

   at 
akka.serialization.Serialization$$anonfun$serialize$1.apply(Serialization.scala:90)







On Monday, August 22, 2016 at 10:22:49 PM UTC+5:30, Justin du coeur wrote:
>
> On Mon, Aug 22, 2016 at 11:09 AM, vipin mandloi <vipinm...@gmail.com 
> > wrote:
>
>> Please let me know if i am missing any configuration.
>>
>
> It's not a matter of *missing* -- the problem is that this:
>  
>
>> *My application.conf is configured as below-*
>>
>>  
>>   cluster { 
>> auto-down-unreachable-after = 10s
>>   }  
>>
>
> Should never, ever, *ever* be used except for initial testing.  Auto-down 
> is intended just as a way to get you started, but it's very primitive and 
> dumb, and must *never* be used in production.  Auto-downing is always 
> likely to cause cluster disasters, and having such a short auto-down 
> timeout essentially guarantees it.
>
> Basically, you're getting split-brain -- you need to replace auto-down 
> with a more-sophisticated downing strategy.  See this section of the 
> documentation 
> <http://doc.akka.io/docs/akka/2.4.9-RC2/scala/cluster-usage.html#automatic-vs-manual-downing-scala>
>  
> for more information.
>

-- 
>>>>>>>>>>  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.


[akka-user] Akka configured seed nodes are leaving cluster and unreachable/reachable warning message is getting logged.

2016-08-22 Thread vipin mandloi
Hello All,

I am setting akka cluster *(using akka library version 2.3.9* ) with one 
master actor and multiple worker actor. Master Actor is configured with 
pool cluster aware router.

I am deploying application with forming 4 cluster nodes. *Initially all the 
nodes are joining to cluster properly but after few minutes nodes are 
leaving to cluster and forming their own cluster. *

Getting below *warn *message when i add another node in the cluster.


*[WARN*] [08/22/2016 04:52:42.145] 
[ClusterSystem-akka.remote.default-remote-dispatcher-8] 
[akka.tcp://ClusterSystem@host:port/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%host%port-4]
 
Association with remote system [akka.tcp://ClusterSystem@host:port] has 
failed, address is now gated for [5000] ms. Reason is: [Failed to write 
message to the transport].


And *after few minutes of joining, * frequent unreachable reachable 
*warning *message is getting logged.


*[WARN] *[08/22/2016 05:42:13.586] 
[ClusterSystem-akka.actor.default-dispatcher-8] 
[akka.tcp://ClusterSystem@host:port/system/cluster/core/daemon] Cluster 
Node [akka.tcp://ClusterSystem@host:port] - Marking node(s) as UNREACHABLE 
[Member(address = akka.tcp://ClusterSystem@xldcarcsi01:port, status = Up)]
[INFO] [08/22/2016 05:42:14.586] 
[ClusterSystem-akka.actor.default-dispatcher-6] 
[Cluster(akka://ClusterSystem)] Cluster Node 
[akka.tcp://ClusterSystem@host:port] - Marking node(s) as REACHABLE 
[Member(address = akka.tcp://ClusterSystem@host:port, status = Up), 
Member(address = akka.tcp://ClusterSystem@xldcarcsi01:port, status = Up)]
*[WARN]* [08/22/2016 05:42:14.592] 
[ClusterSystem-akka.remote.default-remote-dispatcher-10] 
[akka.tcp://ClusterSystem@host:port/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40host%3Aport-0]
 
Association with remote system [akka.tcp://ClusterSystem@host:port] has 
failed, address is now gated for [5000] ms. Reason is: [Failed to write 
message to the transport].
*[WARN]* [08/22/2016 05:42:14.593] 
[ClusterSystem-akka.remote.default-remote-dispatcher-10] 
[akka.tcp://ClusterSystem@host:port/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40xldcarcsi01%3Aport-1]
 
Association with remote system [akka.tcp://ClusterSystem@xldcarcsi01:port] 
has failed, address is now gated for [5000] ms. Reason is: [Failed to write 
message to the transport].
[WARN] [08/22/2016 05:42:18.584] 
[ClusterSystem-akka.actor.default-dispatcher-2] 
[akka.tcp://ClusterSystem@host:port/system/cluster/core/daemon] Cluster 
Node [akka.tcp://ClusterSystem@host:port] - Marking node(s) as UNREACHABLE 
[Member(address = akka.tcp://ClusterSystem@host:port, status = Up)]




Please let me know if i am missing any configuration.


*My application.conf is configured as below-*

my-dispatcher {
type = PinnedDispatcher 
executor = "thread-pool-executor"
thread-pool-executor {
core-pool-size-min = 1
core-pool-size-factor = 2.0
core-pool-size-max = 2
}
throughput = 3
mailbox-capacity = 3
}

akka {
 
 bounded-mailbox {
 mailbox-type = "akka.dispatch.BoundedMailbox"
 mailbox-capacity = 2
 mailbox-push-timeout-time = 100ms
  }

  actor {
provider = "akka.cluster.ClusterActorRefProvider"
serializers {
akka-cluster = "akka.cluster.protobuf.ClusterMessageSerializer"
}
serialization-bindings {
"akka.cluster.ClusterMessage" = akka-cluster
"org.springframework.context.support.ClassPathXmlApplicationContext" = 
akka-cluster
} 
  }
  remote {
log-remote-lifecycle-events = off   
netty.tcp {
  hostname = ${akka.node.hostname}
  port = ${akka.node.port}
}
  }
 
  cluster {
seed-nodes = [${akka.seed.nodes}]
 
  roles = ["master"]
  
auto-down-unreachable-after = 10s
  }  
}
akka.actor.deployment {
  /singleton/MyConsumerActor/workerRouter {
router = consistent-hashing-pool
nr-of-instances = 100
cluster {
  enabled = on
  max-nr-of-instances-per-node = 3
  allow-local-routees = on
  use-role = master
}
  }
}
*//tried with customizing transport-failure-detector*
akka.remote.transport-failure-detector {
heartbeat-interval = 1000s 
acceptable-heartbeat-pause = 6000s 
}



Thanks,
Vipin Mandloi

-- 
>>>>>>>>>>  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.


[akka-user] Akka Camel ,AutoAck issue - (Needs to make Akka Camel consumer Actor asynchronous and at the same time needs jms message redelivery )

2015-07-27 Thread vipin mandloi
I have written Akka  Camel (extends Akka UntypedConsumerActor ) Actor which 
is consuming messages from the JMS Queue. I want this Consumer to be 
(Point#1) asynchronous, at the same time  (Point#2)if a messages fails in 
processing by child actor then JMS Queue can  redeliver, So to achieve this 
I have overridden autoack method  in Akka Camel Actor (extends Akka 
UntypedConsumerActor) and returning false from this overridden method also 
when each messages get proceed successfully by Child Actor explicitly 
acknowledging *Success* message to Camel Endpoint. But I am observing 
Consumer Actor (extends Akka UntypedConsumerActor ) is processing messages 
sequentially so I am loosing my first point  to making Akka Camel  Consumer 
Actor (point#1)asynchronous.


Please help me on this - *Needs to make Akka Camel consumer Actor 
asynchronous and at the same time needs jms message redelivery *


-- 
  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.