akka 邮箱测试,起多个jvm结果都不一样,求大侠指导

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import akka.actor.UntypedActor;
import akka.dispatch.PriorityGenerator;
import akka.dispatch.UnboundedPriorityMailbox;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;


import java.io.File;

class MsgPriorityMailBox extends UnboundedPriorityMailbox {
    public  MsgPriorityMailBox(ActorSystem.Settings settings, Config config){
        super(new PriorityGenerator() {
            @Override
            public int gen(Object message) {
                if(message.equals("张三")){
                    return 0;
                }else if(message.equals("李四")){
                    return 1;
                }else if(message.equals("王五")){
                    return 2;
                }else {
                    return 3;
                }
            }
        });
    }
}
class priorityActor extends UntypedActor{
    @Override
    public void onReceive(Object message) throws Exception{
        System.out.print(message+"---\n");
    }
}
class Test1202 {
    public static void main(String[] args) throws Exception{

        Config firstConfig = ConfigFactory.parseFile(new File("./conf/application.conf")).withFallback(ConfigFactory.load());
        ActorSystem system= ActorSystem.create("sys1",firstConfig);
        ActorRef ref= system.actorOf(Props.create(priorityActor.class).withMailbox("msgprio-mailbox"),"priorityActor");
       Object[] message={"王五","张三","李四","小二"};
       for(Object msg:message){
           ref.tell(msg,ActorRef.noSender());
       }
    }
}





![图片说明](https://img-ask.csdn.net/upload/201812/03/1543848875_367858.png)图片说明
图片说明

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!