mirror of https://github.com/apache/activemq.git
flush messages into journal on stop
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@517567 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0527ebacc9
commit
93d1087726
|
@ -96,7 +96,6 @@ public class AMQMessageStore implements MessageStore{
|
|||
*/
|
||||
public void addMessage(ConnectionContext context,final Message message) throws IOException{
|
||||
final MessageId id=message.getMessageId();
|
||||
|
||||
final Location location=peristenceAdapter.writeCommand(message,message.isResponseRequired());
|
||||
if(!context.isInTransaction()){
|
||||
if(debug)
|
||||
|
@ -341,8 +340,7 @@ public class AMQMessageStore implements MessageStore{
|
|||
try{
|
||||
referenceStore.removeMessage(transactionTemplate.getContext(),ack);
|
||||
}catch(Throwable e){
|
||||
e.printStackTrace();
|
||||
log.debug("Message could not be removed from long term store: "+e.getMessage(),e);
|
||||
log.warn("Message could not be removed from long term store: "+e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -407,6 +405,7 @@ public class AMQMessageStore implements MessageStore{
|
|||
}
|
||||
|
||||
public void stop() throws Exception{
|
||||
flush();
|
||||
asyncWriteTask.shutdown();
|
||||
referenceStore.stop();
|
||||
}
|
||||
|
|
|
@ -201,6 +201,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
|
|||
}
|
||||
|
||||
public void stop() throws Exception{
|
||||
|
||||
if(!started.compareAndSet(true,false))
|
||||
return;
|
||||
this.usageManager.removeUsageListener(this);
|
||||
|
@ -236,10 +237,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
|
|||
|
||||
/**
|
||||
* When we checkpoint we move all the journalled data to long term storage.
|
||||
*
|
||||
* @param stopping
|
||||
*
|
||||
* @param b
|
||||
* @param sync
|
||||
*/
|
||||
public void checkpoint(boolean sync){
|
||||
try{
|
||||
|
@ -268,7 +266,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
|
|||
/**
|
||||
* This does the actual checkpoint.
|
||||
*
|
||||
* @return
|
||||
* @return true if successful
|
||||
*/
|
||||
public boolean doCheckpoint(){
|
||||
CountDownLatch latch=null;
|
||||
|
|
Loading…
Reference in New Issue