mirror of https://github.com/apache/activemq.git
Add warning message if not enough space to complete a transaction
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@603884 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3099953b72
commit
d4d9ba88b9
|
@ -351,10 +351,16 @@ public class Topic extends BaseDestination implements Task{
|
|||
// Producer flow control cannot be used, so we have do the flow
|
||||
// control at the broker
|
||||
// by blocking this thread until there is space available.
|
||||
int count = 0;
|
||||
while (!memoryUsage.waitForSpace(1000)) {
|
||||
if (context.getStopping().get()) {
|
||||
throw new IOException("Connection closed, send aborted.");
|
||||
}
|
||||
if (count > 2 && context.isInTransaction()) {
|
||||
count =0;
|
||||
int size = context.getTransaction().size();
|
||||
LOG.warn("Waiting for space to send transacted message - transaction elements = " + size + " need more space to commit. Message = " + message);
|
||||
}
|
||||
}
|
||||
|
||||
// The usage manager could have delayed us by the time
|
||||
|
|
|
@ -109,4 +109,8 @@ public abstract class Transaction {
|
|||
public boolean isPrepared() {
|
||||
return getState() == PREPARED_STATE;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return synchronizations.size();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue