About Akka remoting ways to send message size limits

Source: Internet
Author: User

Title, to test the Akka Actor model remote transmission restrictions, the results have really found a point.

The design test cases are as follows:

Client side:

1  Packagecn.wanda.local2 3 ImportAkka.actor.Actor4 Importmodule. {ListType, Jsontype, Seqtype}5 6 Importjava.util.ArrayList7 /**8 * Created by Administrator on 2014/11/17.9  */Ten classLocalactorextendsActor { One  AVal remote = context.actorselection ("Akka.tcp://[email protected]:8000/user/remoteactor")//Create the remote actor -var counter = 0 -   //val Seq:indexedseq[int] = for (i <-0 to 12335) yield I theVal list = list (1 to 100000:_*) -  -def receive = { -      Case"START" = { ARemote!NewListType (list) at     } -      CaseMsg:string ={ -println (S "localactor received message: ' $msg '") -     } -   }28}

Server side:

1  PackageCn.wanda.remote2 3 ImportAkka.actor.Actor4 Importmodule. {listtype, seqtype}5 /**6 * Created by Administrator on 2014/11/17.7  */8 classRemoteactorextendsActor {9def receive = {Ten      CaseMsg:string = { Oneprintln (S "remoteactor received message ' $msg '") A println (Sender (). toString ()) -       //Sender! Future.successful ("Hello from the Remoteactor") -     } the      CaseSeq:seqtype = { - print (seq) -     } -      CaseList:listtype = { +println ("Hello") -       println (list) +     } A   } at}

Send this 100000-length array to the remote actor

The client side output is as follows:

[DEBUG] [12/03/2014 16:45:32.173] [main] [EventStream (Akka://LocalSystem)] Logger Log1-logging$defaultlogger started[DEBUG] [12/03/2014 16:45:32.176] [Main] [EventStream (Akka://LocalSystem)] Default Loggers started[INFO] [12/03/2014 16:45:32.260] [main] [Remoting] starting remoting[info] [12/03/2014 16:45:32.821] [main] [Remoting] Remoting started; Listening on addresses: [AKKA.TCP://[email protected]:53304][INFO] [12/03/2014 16:45:32.825] [Main] [Remoting] Remoting now listens on addresses: [AKKA.TCP://[email protected]:53304]----Actorselection[anchor (akka.tcp://[email protected]:8000/), Path (/user/remoteactor)][DEBUG] [12/03/2014 16:45:33.204] [Localsystem-akka.remote.default-REMOTE-DISPATCHER-6] [akka.tcp://[Email protected]:53304/system/endpointmanager/reliableendpointwriter-akka.tcp%3a%2f%2fhelloremotesystem% 40localhost%3a8000-0/endpointwriter] Associated [AKKA.TCP://[email protected]:53304], [akka.tcp://[email protected]:8000][DEBUG] [12/03/2014 16:45:33.211] [Localsystem-akka.remote.default-REMOTE-DISPATCHER-6] [Akka.serialization.Serialization (Akka://LocalSystem)] Using Serializer[akka.serialization.javaserializer] for message [module. ListType][ERROR] [12/03/2014 16:45:33.340] [Localsystem-akka.remote.default-REMOTE-DISPATCHER-6] [akka.tcp://[Email protected]:53304/system/endpointmanager/reliableendpointwriter-akka.tcp%3a%2f%2fhelloremotesystem% 40localhost%3a8000-0/endpointwriter] Transient Association Error (Association remains live)Akka.remote.OversizedPayloadException:Discarding oversized payload sent to ACTOR[AKKA.TCP://[email protected]:8000/]: max allowed size 128000 bytes, actual size of encoded class Akka.actor.ActorSelectionMessage was 1000508 bytes.[DEBUG] [12/03/2014 16:45:33.341] [localsystem-akka.remote.default-REMOTE-DISPATCHER-6] [akka.tcp://[Email protected]:53304/system/endpointmanager/reliableendpointwriter-akka.tcp%3a%2f%2fhelloremotesystem% 40localhost%3a8000-0/endpointwriter] drained buffer with maxwritecount:50, fullbackoffcount:1, smallbackoffcount:0, nobackoffcount:0, adaptivebackoff:1000

The server-side output is as follows:

[DEBUG] [12/03/2014 16:45:33.191] [Helloremotesystem-akka.remote. default-remote-dispatcher-5] [Remoting] associated [AKKA.TCP://[email protected]:8000] <-[ AKKA.TCP://[email protected]:53304]

In the client side of the output message there is such a sentence:

[ERROR] [12/03/2014 16:45:33.340] [Localsystem-akka.remote.default-remote-dispatcher-6] [Akka.tcp://[email Protected]:53304/system/endpointmanager /reliableendpointwriter-akka.tcp%3a%2f%2fhelloremotesystem%40localhost%3a8000-0/endpointwriter] Transient Association Error (Association remains live)
Akka.remote.OversizedPayloadException:Discarding oversized payload sent to Actor[akka.tcp://[email Protected]:8000/] : Max allowed size 128000 bytes, actual size of encoded class Akka.actor.ActorSelectionMessage was 1000508 bytes.

The maximum allowable 128000bytes size of the message, that is, 125kb, but the output seems to have received what the message sent to the end, and then elaborate ..... Not finished, to be continued

About Akka remoting ways to send message size limits

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.