Giter Site home page Giter Site logo

zio-akka-cluster's Issues

No communication between nodes.

I´m trying to send a message from one ActorSystem to another.

The publisher in port 2700 and listener in 2600.

But checking the logs it seems it´s trying to publish the message from the listener port 2600 to another actor without port Actor[akka://ClusterSystem/system/distributedPubSubMediator]

[INFO] [07/18/2019 16:26:55.893] [ClusterSystem-akka.actor.default-dispatcher-3] [akka://ClusterSystem/system/distributedPubSubMediator] Message [akka.cluster.pubsub.DistributedPubSubMediator$Internal$Status] from Actor[akka.tcp://[email protected]:2600/system/distributedPubSubMediator#-327490257] to Actor[akka://ClusterSystem/system/distributedPubSubMediator] was not delivered. [2] dead letters encountered. If this is not an expected behavior, then [Actor[akka://ClusterSystem/system/distributedPubSubMediator]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[INFO] [07/18/2019 16:26:55.893] [ClusterSystem-akka.actor.default-dispatcher-3] [akka://ClusterSystem/system/distributedPubSubMediator] Message [akka.cluster.pubsub.DistributedPubSubMediator$Internal$Status] from Actor[akka.tcp://[email protected]:2600/system/distributedPubSubMediator#-327490257] to Actor[akka://ClusterSystem/system/distributedPubSubMediator] was not delivered. [2] dead letters encountered. If this is not an expected behavior, then [Actor[akka://ClusterSystem/system/distributedPubSubMediator]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[INFO] [07/18/2019 16:26:56.883] [ClusterSystem-akka.actor.default-dispatcher-23] [akka://ClusterSystem/system/distributedPubSubMediator] Message [akka.cluster.pubsub.DistributedPubSubMediator$Internal$Status] from Actor[akka.tcp://[email protected]:2600/system/distributedPubSubMediator#-327490257] to Actor[akka://ClusterSystem/system/distributedPubSubMediator] was not delivered. [3] dead letters encountered. If this is not an expected behavior, then [Actor[akka://ClusterSystem/system/distributedPubSubMediator]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[INFO] [07/18/2019 16:26:57.872] [ClusterSystem-akka.actor.default-dispatcher-23] [akka://ClusterSystem/system/distributedPubSubMediator] Message [akka.cluster.pubsub.DistributedPubSubMediator$Internal$Status] from Actor[akka.tcp://[email protected]:2600/system/distributedPubSubMediator#-327490257] to Actor[akka://ClusterSystem/system/distributedPubSubMediator] was not delivered. [4] dead letters encountered. If this is not an expected behavior, then [Actor[akka://ClusterSystem/system/distributedPubSubMediator]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[INFO] [07/18/2019 16:26:58.896] [ClusterSystem-akka.actor.default-dispatcher-3] [akka://ClusterSystem/system/distributedPubSubMediator] Message [akka.cluster.pubsub.DistributedPubSubMediator$Internal$Status] from Actor[akka.tcp://[email protected]:2600/system/distributedPubSubMediator#-327490257] to Actor[akka://ClusterSystem/system/distributedPubSubMediator] was not delivered. [5] dead letters encountered. If this is not an expected behavior, then [Actor[akka://ClusterSystem/system/distributedPubSubMediator]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[INFO] [07/18/2019 16:26:59.877] [ClusterSystem-akka.actor.default-dispatcher-24] [akka://ClusterSystem/system/distributedPubSubMediator] Message [akka.cluster.pubsub.DistributedPubSubMediator$Internal$Status] from Actor[akka.tcp://[email protected]:2600/system/distributedPubSubMediator#-327490257] to Actor[akka://ClusterSystem/system/distributedPubSubMediator] was not delivered. [6] dead letters encountered. If this is not an expected behavior, then [Actor[akka://ClusterSystem/system/distributedPubSubMediator]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[WARN] [SECURITY][07/18/2019 16:27:00.042] [pool-2-thread-2] [akka.serialization.Serialization(akka://ClusterSystem)] Using the default Java serializer for class [zio.akka.cluster.pubsub.MessageEnvelope] which is not recommended because of performance implications. Use another serializer or disable this warning using the setting 'akka.actor.warn-about-java-serializer-usage'
[INFO] [07/18/2019 16:27:00.047] [ClusterSystem-akka.actor.default-dispatcher-3] [akka://ClusterSystem/system/distributedPubSubMediator] Message [zio.akka.cluster.pubsub.MessageEnvelope] without sender to Actor[akka://ClusterSystem/system/distributedPubSubMediator#2077152297] was not delivered. [7] dead letters encountered. If this is not an expected behavior, then [Actor[akka://ClusterSystem/system/distributedPubSubMediator#2077152297]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.

Any idea if I´m doing something wrong?, here the code

 val messageProgram: ZIO[ActorSystem, Throwable, String] = (for {
        remotePort <- ZIO.accessM[ActorSystem](as => ZIO.effect(as.settings.config.getString("akka.remote.netty.tcp.port")))
        state <- Cluster.clusterState
        _ <- logClusterInfo(remotePort, state)
        _ <- if (state.members.size > 1) {
          //Wait until the other node accept the new member
          Thread.sleep(5000)
          for {
            pubSub <- PubSub.createPubSub[String]
            _ <- pubSub.publish(ToggleTopic, "Hello ZIO world")
          } yield Unit
        }else{
          ZIO.effect(Unit)
        }
        subscriber <- PubSub.createSubscriber[String]
        queue <- subscriber.listen(ToggleTopic)
        message <- queue.take
      } yield message).catchAll(t => {
        logger.info(null, "Error in ZIO Akka cluster:")
        ZIO.fail(t)
      })

As far as I can see in the akka log, the cluster is formed

Members:TreeSet(Member(address = akka.tcp://[email protected]:2600, status = Up), Member(address = akka.tcp://[email protected]:2700, status = Up))

Any idea what it could be wrong?
Regards

Race condition between creation of ActorSystem and Cluster.clusterEvents

Hi again,

I think I´m facing a possible Race condition using


  val clusterEvents: ZIO[ActorSystem, Throwable, Queue[ClusterDomainEvent]] =
    Queue.unbounded[ClusterDomainEvent].tap(clusterEventsWith)

This queue is filled with the events of actions over the cluster.

The problem is that the ActorSystem has been created previously passed as provider into the Monad ZIO[ActorSystem, Throwable, Any]

mainProgram.unsafeRunToFuture(bootableProgram.provide(actorSystem))

so it happening sometimes that the Member is added into the cluster before I subscribe into the Queue so I´m missing that event.

events <- Cluster.clusterEvents
event <-events.take

Any suggestion to prevent that RC?

I guess not pass the ActorSystem as Environment when I run the monad and pass into the Cluster.clusterEvents, is an option but definitely less cool option :(

 events <- Cluster.clusterEvents.provide(ActorSystem.create("bla"))
event <-events.take

Regards.

Upgrade to ZIO 2.0

ZIO is at Milestone 4, with an RC expected in the next few weeks.
https://github.com/zio/zio/releases/tag/v2.The API is nearly stable at this point, so any early migration work against this version should pay off towards the official 2.0 release.

The progress is being tracked here:
zio/zio#5470

The Stream Encoding work in progress is the only area where the API might still change before the RC.

To assist with the migration, follow this guide:
https://zio.dev/howto/migrate/zio-2.x-migration-guide/

We are actively working on a ScalaFix rule that will cover the bulk of the simple API changes:
https://github.com/zio/zio/blob/series/2.x/scalafix/rules/src/main/scala/fix/Zio2Upgrade.scala

If you would like assistance with the migration from myself or other ZIO contributors, please let us know!

Enhance onMessage for Sharding.start

Would be useful to have the definition for

onMessage: Msg => ZIO[Entity[State], Nothing, Unit]

in Sharding.start to accept more environment, and provide it from outside like

Sharding.start(...).provideLayer(layerForOnMessage)`

Support for akka-typed

Hello, I am new to zio and akka, and maybe it is best we add support for akk-typed because most new developers are into akka-typed like me. Thanks!

Implement ask pattern

I noticed Sharding had send and stop but it would be nice to support the ask pattern as well

How to run the ZIO

I´m trying to use the library, but I´m not able to run the ZIO.

Here my code:

   val main: DefaultRuntime = new DefaultRuntime {}

      val clusterStateProgram: ZIO[ActorSystem, Throwable, CurrentClusterState] =
        for {
          state <- Cluster.clusterState
          state <- logClusterInfo(state)
        } yield state

      main.unsafeRun(clusterStateProgram)

and the compilation error

Error:(64, 22) type mismatch;
 found   : zio.ZIO[akka.actor.ActorSystem,Throwable,akka.cluster.ClusterEvent.CurrentClusterState]
 required: zio.ZIO[zio.clock.Clock with zio.console.Console with zio.system.System with zio.random.Random with zio.blocking.Blocking,?,?]
      main.unsafeRun(clusterStateProgram)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.