我正在使用akka actor系统进行多线程处理.它在正常使用情况下工作正常.但是,Akka因致命错误而关闭了JVM.请告诉我如何配置Akka以禁用
java中的“akka.jvm-exit-on-fatal-error”.下面是代码.
public class QueueListener implements MessageListener { private String _queueName=null; public static boolean isActorinit=false; public static ActorSystem system=null; private ActorRef myActor; public QueueListener(String actorId,String qName){ this._queueName = qName; if(!isActorinit){ system=ActorSystem.create(actorId); isActorinit=true; } myActor=system.actorOf( Props.create(MessageExecutor.class,qName),qName+"id"); } /* * (non-Javadoc) * @see javax.jms.MessageListener#onMessage(javax.jms.Message) */ @Override public void onMessage(Message msg) { executeRequest(msg); } /** This method will process the message fetch by the listener. * * @param msg - javax.jms.Messages parameter get queue message */ private void executeRequest(Message msg){ String requestData=null; try { if(msg instanceof TextMessage){ TextMessage textMessage= (TextMessage) msg; requestData = textMessage.getText().toString(); }else if(msg instanceof ObjectMessage){ ObjectMessage objMsg = (ObjectMessage) msg; requestData = objMsg.getObject().toString(); } myActor.tell(requestData,ActorRef.noSender()); } catch (JMSException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } }