mirror of https://github.com/apache/activemq.git
http://issues.apache.org/activemq/browse/AMQ-2042 - fix for amq persistence store
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@835412 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d34dcb4830
commit
bf2077f484
|
@ -695,7 +695,13 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
|
|||
}
|
||||
|
||||
public Location writeCommand(DataStructure command, boolean syncHint,boolean forceSync) throws IOException {
|
||||
return asyncDataManager.write(wireFormat.marshal(command), (forceSync||(syncHint && syncOnWrite)));
|
||||
try {
|
||||
return asyncDataManager.write(wireFormat.marshal(command), (forceSync||(syncHint && syncOnWrite)));
|
||||
} catch (IOException ioe) {
|
||||
LOG.error("Failed to write command: " + command + ". Reason: " + ioe, ioe);
|
||||
stopBroker();
|
||||
throw ioe;
|
||||
}
|
||||
}
|
||||
|
||||
private Location writeTraceMessage(String message, boolean sync) throws IOException {
|
||||
|
@ -1085,4 +1091,16 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
|
|||
+ ".DisableLocking",
|
||||
"false"));
|
||||
}
|
||||
|
||||
protected void stopBroker() {
|
||||
new Thread() {
|
||||
public void run() {
|
||||
try {
|
||||
brokerService.stop();
|
||||
} catch (Exception e) {
|
||||
LOG.warn("Failure occured while stopping broker", e);
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue