[jboss-cvs] JBoss Messaging SVN: r5521 - in trunk/src/main/org/jboss/messaging/core: paging/impl and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Dec 12 00:52:49 EST 2008
Author: clebert.suconic at jboss.com
Date: 2008-12-12 00:52:49 -0500 (Fri, 12 Dec 2008)
New Revision: 5521
Modified:
trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionImpl.java
trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionInternal.java
trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionPacketHandler.java
trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreFactoryNIO.java
trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java
Log:
Using getEncodeSize on regular messages
Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionImpl.java 2008-12-12 03:59:01 UTC (rev 5520)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionImpl.java 2008-12-12 05:52:49 UTC (rev 5521)
@@ -630,23 +630,25 @@
producers.remove(producer);
}
- public void handleReceiveMessage(final long consumerID, final ClientMessageInternal message) throws Exception
+ public void handleReceiveMessage(final long consumerID, final SessionReceiveMessage message) throws Exception
{
ClientConsumerInternal consumer = consumers.get(consumerID);
if (consumer != null)
{
- consumer.handleMessage(message);
+ ClientMessageInternal clMessage = message.getClientMessage();
+ clMessage.setFlowControlSize(clMessage.getEncodeSize());
+ consumer.handleMessage(message.getClientMessage());
}
}
- public void handleReceiveLargeMessage(final long consumerID, final SessionReceiveMessage receiveMessage) throws Exception
+ public void handleReceiveLargeMessage(final long consumerID, final SessionReceiveMessage message) throws Exception
{
ClientConsumerInternal consumer = consumers.get(consumerID);
if (consumer != null)
{
- consumer.handleLargeMessage(receiveMessage);
+ consumer.handleLargeMessage(message);
}
}
Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionInternal.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionInternal.java 2008-12-12 03:59:01 UTC (rev 5520)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionInternal.java 2008-12-12 05:52:49 UTC (rev 5521)
@@ -39,9 +39,9 @@
void removeProducer(ClientProducerInternal producer);
- void handleReceiveMessage(long consumerID, ClientMessageInternal message) throws Exception;
+ void handleReceiveMessage(long consumerID, SessionReceiveMessage message) throws Exception;
- void handleReceiveLargeMessage(long consumerID, SessionReceiveMessage headerBytes) throws Exception;
+ void handleReceiveLargeMessage(long consumerID, SessionReceiveMessage message) throws Exception;
void handleReceiveContinuation(long consumerID, SessionReceiveContinuationMessage continuation) throws Exception;
Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionPacketHandler.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionPacketHandler.java 2008-12-12 03:59:01 UTC (rev 5520)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionPacketHandler.java 2008-12-12 05:52:49 UTC (rev 5521)
@@ -81,8 +81,7 @@
}
else
{
- message.getClientMessage().setFlowControlSize(packet.getPacketSize());
- clientSession.handleReceiveMessage(message.getConsumerID(), message.getClientMessage());
+ clientSession.handleReceiveMessage(message.getConsumerID(), message);
}
break;
Modified: trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreFactoryNIO.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreFactoryNIO.java 2008-12-12 03:59:01 UTC (rev 5520)
+++ trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreFactoryNIO.java 2008-12-12 05:52:49 UTC (rev 5521)
@@ -74,7 +74,6 @@
public PagingStoreFactoryNIO(final String directory, final int maxThreads)
{
- System.out.println("maxThreads = " + maxThreads);
this.directory = directory;
parentExecutor = new ThreadPoolExecutor(0, maxThreads,
Modified: trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java 2008-12-12 03:59:01 UTC (rev 5520)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java 2008-12-12 05:52:49 UTC (rev 5521)
@@ -589,15 +589,13 @@
*/
private void sendStandardMessage(final MessageReference ref, final ServerMessage message)
{
-
- final SessionReceiveMessage packet = new SessionReceiveMessage(id, message, ref.getDeliveryCount() + 1);
-
if (availableCredits != null)
{
- // RequiredBufferSize is the actual size for this packet
- availableCredits.addAndGet(-packet.getRequiredBufferSize());
+ availableCredits.addAndGet(-message.getEncodeSize());
}
+ final SessionReceiveMessage packet = new SessionReceiveMessage(id, message, ref.getDeliveryCount() + 1);
+
DelayedResult result = channel.replicatePacket(new SessionReplicateDeliveryMessage(id, message.getMessageID()));
if (result == null)
More information about the jboss-cvs-commits
mailing list