Monday 15 March 2010

Akka Singleton - not accepting messages -


This was making me stupid - I was not going An indicative adder in the system creation I answer some of the questions here in this case, anyone takes some advantage *

I am making a singleton and will send a message like this:

  val indexerProps = ClusterSingletonManager.props (forced = & gt; props (classOf [SingleCoreIndexer], dataProvider, publisher name), name, expiration, no) Val coreIndexer = system.actorOf (indexerProps, name) // val CoreIndexer = system.actorOf (props LassOf [SingleCoreIndexer], Detector, Publisher, Name) Core Indexer! "Start_indexing"   

The commented line shows non-singular props that work fine

When I run the app, I get the following error:

  [warning] [2013/06/21 11: 55: 32.443] [deadcoreindexerstest-akka.actor.default- dispatcher -5] [Akka: // deadcoreindexerstest / user / node1] Initially state Without action_inexexing action event   

All other functionality stops working, which is associated with the message of the "core index" actor, "start_ind Exing "message is missing

more code:

  class index (systemCreator: SystemCreator, publisherProps: Props, dataProviderProps: Props, Name: string) {def start { VAL system = systemCreator.create Val dataProvider = system.actorOf (dataProviderProps) Val publisher = system .actorOf (publisherProps) Val indexerProps = ClusterSingletonManager.props (singletonProps = had = & gt; props (classOf [SingleCoreIndexer], dataProvider, publisher, name ), SingletonName = "aaa", terminationMessage = end, role = none) Val Surroundexer = System.ctoreoff (props (class [single coir inde Sr], Detaprowaider, publisher name)) Core Indeksr! "Start_indexing"}} class Akalkorindaksr (Detaprowaider: Aktorrf, Publisher: Aktorrf, name: String) enhances the actor is {DRF = {case "Armb_andeksing" = & gt; {Println ("Single Core Indexer Start Sequencing") Detector! New NextBatchOfDataPlease} Case BatchAdfata (Data) = & gt; {Publisher! (Name, data) yourself! "Next_batch"} case "next_batch" = & gt; { data provider ! New NextBatchOfDataPlease}}   

It seems that I was sending messages to the manager and not a singleton. However, when I had nothing, send a message to Singleton:

  class index (systemCreator: SystemCreator, publisherProps: props, DataProviderProps: props, name: String) {{def Val system start = systemCreator .create val dataProvider = system.actorOf (dataProviderProp) val publisher = system.actorOf (publisherProp) val indexerProp = ClusterSingletonManager.props (Singltnprops = = => props (classOf [Single coir indexer] Detapradata, publisher name), Singltnnam = "Single Core Index", Termination Message = End, Role = None) System. Core (index (single coir indicator), dataprover, publisher, name) Core Core Indexer = System.ctore Selection (S "/ User / $ name / Singlecore index") Core Indexes! You are seeing (I think) the issue you are born with "start_indexing"}}    

ClusterSingletonManager rather than the real actor, it sat down. Try to see the actor under the name ( actor ) and he should work.

No comments:

Post a Comment