Just noticed this strange code committed in revision 7669 to fix the producer window size issue https://jira.jboss.org/jira/browse/JBMESSAGING-1693
public synchronized void confirm(final Packet packet)
{
if (packet.getType() == PacketImpl.SESS_ACKNOWLEDGE || packet.getType() == PacketImpl.CREATESESSION || packet.getType() == PacketImpl.SESS_CREATECONSUMER
|| packet.getType() == PacketImpl.SESS_START || packet.getType() == PacketImpl.PING || packet.getType() == PacketImpl.SESS_FLOWTOKEN)
{
if (resendCache != null && packet.isRequiresConfirmations())
{
lastReceivedCommandID++;
receivedBytes += packet.getPacketSize();
if (receivedBytes >= confWindowSize)
{
receivedBytes = 0;
if (connection.isActive())
{
final Packet confirmed = new PacketsConfirmedMessage(lastReceivedCommandID);
confirmed.setChannelID(id);
doWrite(confirmed);
}
}
}
}
else
{
if (resendCache != null && packet.isRequiresConfirmations())
{
lastReceivedCommandID++;
receivedBytes += packet.getPacketSize();
if (receivedBytes >= confWindowSize)
{
receivedBytes = 0;
if (connection.isActive())
{
final Packet confirmed = new PacketsConfirmedMessage(lastReceivedCommandID);
confirmed.setChannelID(id);
doWrite(confirmed);
}
}
}
}
}