[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: LargeMessage & Failover Update

timfox do-not-reply at jboss.com
Thu Jan 15 04:12:13 EST 2009


"clebert.suconic at jboss.com" wrote : - If we wait the replicatePacket to finish, largeMessageDeliver.deliver will be done asynchronously 
  | 
  | 
  | 
  |   |    private void deliverLargeMessage(final MessageReference ref, final ServerMessage message)
  |   |    {
  |   |        .....
  |   | 
  |   | 
  |   |          if (!replicating)
  |   |                 largeMessageDeliver.deliver(); // synchronous call when not replicating
  |   | 
  |   | 	 else 
  |   |          result.setResultRunner(new Runnable()  // asynchronous call when replicating
  |   |          {
  |   |             public void run()
  |   |             {
  |   |                largeMessageDeliverer.deliver();
  |   |             }
  |   |             
  |   |          });
  |   |    }
  |   | 
  | 
  | 
  | - the method doHandle which is calling deliverLargeMessage, will return immediately, while the server is still deliveringChunks to the client.
  | 
  | (promptDelivery BTW will try to send another message to the consumer, but it will be rejected as BUSY)
  | 
  | 
  | - As the ServerSessionPacketHandler is free, credits will arrive concurrently with the delivery to the client, instead of coming after the method deliver returned. This following logic on receiveCredits will not work:
  | 
  | 
  |   |    public void receiveCredits(final int credits) throws Exception
  |   |    {
  |   |       if (credits == -1)
  |   |       {
  |   |          // No flow control
  |   |          availableCredits = null;
  |   |       }
  |   |       else
  |   |       {
  |   |          int previous = availableCredits.getAndAdd(credits);
  |   | 
  |   |          if (previous <= 0 && previous + credits > 0)
  |   |          {
  |   |             promptDelivery(); // this is what would resume the delivery of the largeMessage
  |   |          }
  |   |       }
  |   |    }
  |   | 
  | 
  | 
  | - because of the credits coming on a different order than how they would usually come,
  | 

The order the the credits arrive on the server should be the same. How is this different? The only way the credits could arrive in a different order on the server is if the client sent them in a different order. How is this the case? I think it needs more explanation....

anonymous wrote : 
  |  the delivery of messages is interrupted. We will get the credit before they became negative.. so nothing will resume delivery.
  | 
  | If we called largeMessageDeliver.deliver() synchronously the credits would only arrive at the right time and the resume would work without any problem.
  | 

I'm not sure what do you mean by "called largeMessageDeliver.deliver() synchronously"



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4202059#4202059

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4202059



More information about the jboss-dev-forums mailing list