Examples of MessageInternal


Examples of org.hornetq.core.message.impl.MessageInternal

   {
      session.startCall();

      try
      {
         MessageInternal msgI = (MessageInternal) msg;

         ClientProducerCredits theCredits;

         boolean isLarge;
         // a note about the second check on the writerIndexSize,
         // If it's a server's message, it means this is being done through the bridge or some special consumer on the
         // server's on which case we can't' convert the message into large at the servers
         if (msgI.getBodyInputStream() != null || msgI.isLargeMessage() ||
            msgI.getBodyBuffer().writerIndex() > minLargeMessageSize && !msgI.isServerMessage())
         {
            isLarge = true;
         }
         else
         {
            isLarge = false;
         }

         if (address1 != null)
         {
            if (!isLarge)
            {
               session.setAddress(msg, address1);
            }
            else
            {
               msg.setAddress(address1);
            }

            // Anonymous
            theCredits = session.getCredits(address1, true);
         }
         else
         {
            if (!isLarge)
            {
               session.setAddress(msg, this.address);
            }
            else
            {
               msg.setAddress(this.address);
            }

            theCredits = producerCredits;
         }

         if (rateLimiter != null)
         {
            // Rate flow control

            rateLimiter.limit();
         }

         if (groupID != null)
         {
            msgI.putStringProperty(Message.HDR_GROUP_ID, groupID);
         }

         final boolean sendBlockingConfig = msgI.isDurable() ? blockOnDurableSend : blockOnNonDurableSend;
         final boolean forceAsyncOverride = handler != null;
         final boolean sendBlocking = sendBlockingConfig && !forceAsyncOverride;

         session.workDone();
View Full Code Here

Examples of org.hornetq.core.message.impl.MessageInternal

      closed = true;
   }

   private void doSend(final SimpleString address, final Message msg) throws HornetQException
   {
      MessageInternal msgI = (MessageInternal)msg;

      ClientProducerCredits theCredits;

      boolean isLarge;

      if (msgI.getBodyInputStream() != null || msgI.isLargeMessage() ||
          msgI.getBodyBuffer().writerIndex() > minLargeMessageSize)
      {
         isLarge = true;
      }
      else
      {
         isLarge = false;
      }

      if (address != null)
      {
         if (!isLarge)
         {
            session.setAddress(msg, address);
         }
         else
         {
            msg.setAddress(address);
         }

         // Anonymous
         theCredits = session.getCredits(address, true);
      }
      else
      {
         if (!isLarge)
         {
            session.setAddress(msg, this.address);
         }
         else
         {
            msg.setAddress(this.address);
         }

         theCredits = credits;
      }

      if (rateLimiter != null)
      {
         // Rate flow control

         rateLimiter.limit();
      }

      if (groupID != null)
      {
         msgI.putStringProperty(Message.HDR_GROUP_ID, groupID);
      }

      boolean sendBlocking = msgI.isDurable() ? blockOnDurableSend : blockOnNonDurableSend;

      session.workDone();

      if (isLarge)
      {
         largeMessageSend(sendBlocking, msgI, theCredits);
      }
      else
      {
         SessionSendMessage packet = new SessionSendMessage(msgI, sendBlocking);

         if (sendBlocking)
         {
            channel.sendBlocking(packet);
         }
         else
         {
            channel.sendBatched(packet);
         }
      }

      try
      {
         // This will block if credits are not available

         // Note, that for a large message, the encode size only includes the properties + headers
         // Not the continuations, but this is ok since we are only interested in limiting the amount of
         // data in *memory* and continuations go straight to the disk

         if (!isLarge)
         {
            theCredits.acquireCredits(msgI.getEncodeSize());
         }
      }
      catch (InterruptedException e)
      {
      }
View Full Code Here

Examples of org.hornetq.core.message.impl.MessageInternal

   {
      session.startCall();

      try
      {
         MessageInternal msgI = (MessageInternal)msg;

         ClientProducerCredits theCredits;

         boolean isLarge;

         if (msgI.getBodyInputStream() != null || msgI.isLargeMessage() ||
            msgI.getBodyBuffer().writerIndex() > minLargeMessageSize)
         {
            isLarge = true;
         }
         else
         {
            isLarge = false;
         }

         if (address != null)
         {
            if (!isLarge)
            {
               session.setAddress(msg, address);
            }
            else
            {
               msg.setAddress(address);
            }

            // Anonymous
            theCredits = session.getCredits(address, true);
         }
         else
         {
            if (!isLarge)
            {
               session.setAddress(msg, this.address);
            }
            else
            {
               msg.setAddress(this.address);
            }

            theCredits = credits;
         }

         if (rateLimiter != null)
         {
            // Rate flow control

            rateLimiter.limit();
         }

         if (groupID != null)
         {
            msgI.putStringProperty(Message.HDR_GROUP_ID, groupID);
         }

         boolean sendBlocking = msgI.isDurable() ? blockOnDurableSend : blockOnNonDurableSend;

         session.workDone();

         try
         {
            // This will block if credits are not available

            // Note, that for a large message, the encode size only includes the properties + headers
            // Not the continuations, but this is ok since we are only interested in limiting the amount of
            // data in *memory* and continuations go straight to the disk

            if (!isLarge)
            {
               theCredits.acquireCredits(msgI.getEncodeSize());
            }
         }
         catch (InterruptedException e)
         {
         }
View Full Code Here

Examples of org.hornetq.core.message.impl.MessageInternal

   {
      session.startCall();

      try
      {
         MessageInternal msgI = (MessageInternal)msg;

         ClientProducerCredits theCredits;

         boolean isLarge;

         if (msgI.getBodyInputStream() != null || msgI.isLargeMessage() ||
            msgI.getBodyBuffer().writerIndex() > minLargeMessageSize)
         {
            isLarge = true;
         }
         else
         {
            isLarge = false;
         }

         if (address != null)
         {
            if (!isLarge)
            {
               session.setAddress(msg, address);
            }
            else
            {
               msg.setAddress(address);
            }

            // Anonymous
            theCredits = session.getCredits(address, true);
         }
         else
         {
            if (!isLarge)
            {
               session.setAddress(msg, this.address);
            }
            else
            {
               msg.setAddress(this.address);
            }

            theCredits = credits;
         }

         if (rateLimiter != null)
         {
            // Rate flow control

            rateLimiter.limit();
         }

         if (groupID != null)
         {
            msgI.putStringProperty(Message.HDR_GROUP_ID, groupID);
         }

         boolean sendBlocking = msgI.isDurable() ? blockOnDurableSend : blockOnNonDurableSend;

         session.workDone();

         try
         {
            // This will block if credits are not available

            // Note, that for a large message, the encode size only includes the properties + headers
            // Not the continuations, but this is ok since we are only interested in limiting the amount of
            // data in *memory* and continuations go straight to the disk

            if (!isLarge)
            {
               theCredits.acquireCredits(msgI.getEncodeSize());
            }
         }
         catch (InterruptedException e)
         {
            throw new HornetQInterruptedException(e);
View Full Code Here

Examples of org.hornetq.core.message.impl.MessageInternal

   {
      session.startCall();

      try
      {
         MessageInternal msgI = (MessageInternal)msg;

         ClientProducerCredits theCredits;

         boolean isLarge;

         // a note about the second check on the writerIndexSize,
         // If it's a server's message, it means this is being done through the bridge or some special consumer on the
         // server's on which case we can't' convert the message into large at the servers
         if (msgI.getBodyInputStream() != null || msgI.isLargeMessage() ||
            msgI.getBodyBuffer().writerIndex() > minLargeMessageSize && ! msgI.isServerMessage())
         {
            isLarge = true;
         }
         else
         {
            isLarge = false;
         }

         if (address != null)
         {
            if (!isLarge)
            {
               session.setAddress(msg, address);
            }
            else
            {
               msg.setAddress(address);
            }

            // Anonymous
            theCredits = session.getCredits(address, true);
         }
         else
         {
            if (!isLarge)
            {
               session.setAddress(msg, this.address);
            }
            else
            {
               msg.setAddress(this.address);
            }

            theCredits = credits;
         }

         if (rateLimiter != null)
         {
            // Rate flow control

            rateLimiter.limit();
         }

         if (groupID != null)
         {
            msgI.putStringProperty(Message.HDR_GROUP_ID, groupID);
         }

         boolean sendBlocking = msgI.isDurable() ? blockOnDurableSend : blockOnNonDurableSend;

         session.workDone();

         if (isLarge)
         {
View Full Code Here

Examples of org.hornetq.core.message.impl.MessageInternal

   {
      session.startCall();

      try
      {
         MessageInternal msgI = (MessageInternal)msg;

         ClientProducerCredits theCredits;

         boolean isLarge;

         // a note about the second check on the writerIndexSize,
         // If it's a server's message, it means this is being done through the bridge or some special consumer on the
         // server's on which case we can't' convert the message into large at the servers
         if (msgI.getBodyInputStream() != null || msgI.isLargeMessage() ||
            msgI.getBodyBuffer().writerIndex() > minLargeMessageSize && ! msgI.isServerMessage())
         {
            isLarge = true;
         }
         else
         {
            isLarge = false;
         }

         if (address != null)
         {
            if (!isLarge)
            {
               session.setAddress(msg, address);
            }
            else
            {
               msg.setAddress(address);
            }

            // Anonymous
            theCredits = session.getCredits(address, true);
         }
         else
         {
            if (!isLarge)
            {
               session.setAddress(msg, this.address);
            }
            else
            {
               msg.setAddress(this.address);
            }

            theCredits = credits;
         }

         if (rateLimiter != null)
         {
            // Rate flow control

            rateLimiter.limit();
         }

         if (groupID != null)
         {
            msgI.putStringProperty(Message.HDR_GROUP_ID, groupID);
         }

         boolean sendBlocking = msgI.isDurable() ? blockOnDurableSend : blockOnNonDurableSend;

         session.workDone();

         try
         {
            // This will block if credits are not available

            // Note, that for a large message, the encode size only includes the properties + headers
            // Not the continuations, but this is ok since we are only interested in limiting the amount of
            // data in *memory* and continuations go straight to the disk

            if (!isLarge)
            {
               theCredits.acquireCredits(msgI.getEncodeSize());
            }
         }
         catch (InterruptedException e)
         {
            throw new HornetQInterruptedException(e);
View Full Code Here

Examples of org.hornetq.core.message.impl.MessageInternal

      closed = true;
   }

   private void doSend(final SimpleString address, final Message msg) throws HornetQException
   {
      MessageInternal msgI = (MessageInternal)msg;

      ClientProducerCredits theCredits;

      boolean isLarge;

      if (msgI.getBodyInputStream() != null || msgI.isLargeMessage() ||
          msgI.getBodyBuffer().writerIndex() > minLargeMessageSize)
      {
         isLarge = true;
      }
      else
      {
         isLarge = false;
      }

      if (address != null)
      {
         if (!isLarge)
         {
            session.setAddress(msg, address);
         }
         else
         {
            msg.setAddress(address);
         }

         // Anonymous
         theCredits = session.getCredits(address, true);
      }
      else
      {
         if (!isLarge)
         {
            session.setAddress(msg, this.address);
         }
         else
         {
            msg.setAddress(this.address);
         }

         theCredits = credits;
      }

      if (rateLimiter != null)
      {
         // Rate flow control

         rateLimiter.limit();
      }

      if (groupID != null)
      {
         msgI.putStringProperty(Message.HDR_GROUP_ID, groupID);
      }

      boolean sendBlocking = msgI.isDurable() ? blockOnDurableSend : blockOnNonDurableSend;

      session.workDone();

      if (isLarge)
      {
         largeMessageSend(sendBlocking, msgI, theCredits);
      }
      else
      {
         SessionSendMessage packet = new SessionSendMessage(msgI, sendBlocking);

         if (sendBlocking)
         {
            channel.sendBlocking(packet);
         }
         else
         {
            channel.sendBatched(packet);
         }
      }

      try
      {
         // This will block if credits are not available

         // Note, that for a large message, the encode size only includes the properties + headers
         // Not the continuations, but this is ok since we are only interested in limiting the amount of
         // data in *memory* and continuations go straight to the disk

         if (!isLarge)
         {
            theCredits.acquireCredits(msgI.getEncodeSize());
         }
      }
      catch (InterruptedException e)
      {
      }
View Full Code Here

Examples of org.hornetq.core.message.impl.MessageInternal

   {
      session.startCall();

      try
      {
         MessageInternal msgI = (MessageInternal)msg;

         ClientProducerCredits theCredits;

         boolean isLarge;
         // a note about the second check on the writerIndexSize,
         // If it's a server's message, it means this is being done through the bridge or some special consumer on the
         // server's on which case we can't' convert the message into large at the servers
         if (msgI.getBodyInputStream() != null || msgI.isLargeMessage() ||
            msgI.getBodyBuffer().writerIndex() > minLargeMessageSize && ! msgI.isServerMessage())
         {
            isLarge = true;
         }
         else
         {
            isLarge = false;
         }

         if (address1 != null)
         {
            if (!isLarge)
            {
               session.setAddress(msg, address1);
            }
            else
            {
               msg.setAddress(address1);
            }

            // Anonymous
            theCredits = session.getCredits(address1, true);
         }
         else
         {
            if (!isLarge)
            {
               session.setAddress(msg, this.address);
            }
            else
            {
               msg.setAddress(this.address);
            }

            theCredits = producerCredits;
         }

         if (rateLimiter != null)
         {
            // Rate flow control

            rateLimiter.limit();
         }

         if (groupID != null)
         {
            msgI.putStringProperty(Message.HDR_GROUP_ID, groupID);
         }

         final boolean sendBlockingConfig = msgI.isDurable() ? blockOnDurableSend : blockOnNonDurableSend;
         final boolean forceAsyncOverride = handler != null;
         final boolean sendBlocking = sendBlockingConfig && !forceAsyncOverride;

         session.workDone();
View Full Code Here

Examples of org.hornetq.core.message.impl.MessageInternal

      closed = true;
   }

   private void doSend(final SimpleString address, final Message msg) throws HornetQException
   {
      MessageInternal msgI = (MessageInternal)msg;

      ClientProducerCredits theCredits;

      boolean isLarge;

      if (msgI.getBodyInputStream() != null || msgI.isLargeMessage() ||
          msgI.getBodyBuffer().writerIndex() > minLargeMessageSize)
      {
         isLarge = true;
      }
      else
      {
         isLarge = false;
      }

      if (address != null)
      {
         if (!isLarge)
         {
            session.setAddress(msg, address);
         }
         else
         {
            msg.setAddress(address);
         }

         // Anonymous
         theCredits = session.getCredits(address, true);
      }
      else
      {
         if (!isLarge)
         {
            session.setAddress(msg, this.address);
         }
         else
         {
            msg.setAddress(this.address);
         }

         theCredits = credits;
      }

      if (rateLimiter != null)
      {
         // Rate flow control

         rateLimiter.limit();
      }

      if (groupID != null)
      {
         msgI.putStringProperty(Message.HDR_GROUP_ID, groupID);
      }

      boolean sendBlocking = msgI.isDurable() ? blockOnDurableSend : blockOnNonDurableSend;

      session.workDone();

      if (isLarge)
      {
         largeMessageSend(sendBlocking, msgI, theCredits);
      }
      else
      {
         SessionSendMessage packet = new SessionSendMessage(msgI, sendBlocking);

         if (sendBlocking)
         {
            channel.sendBlocking(packet);
         }
         else
         {
            channel.sendBatched(packet);
         }
      }

      try
      {
         // This will block if credits are not available

         // Note, that for a large message, the encode size only includes the properties + headers
         // Not the continuations, but this is ok since we are only interested in limiting the amount of
         // data in *memory* and continuations go straight to the disk

         if (!isLarge)
         {
            theCredits.acquireCredits(msgI.getEncodeSize());
         }
      }
      catch (InterruptedException e)
      {
      }
View Full Code Here

Examples of org.hornetq.core.message.impl.MessageInternal

      closed = true;
   }

   private void doSend(final SimpleString address, final Message msg) throws HornetQException
   {
      MessageInternal msgI = (MessageInternal)msg;

      ClientProducerCredits theCredits;

      boolean isLarge;

      if (msgI.getBodyInputStream() != null || msgI.isLargeMessage() ||
          msgI.getBodyBuffer().writerIndex() > minLargeMessageSize)
      {
         isLarge = true;
      }
      else
      {
         isLarge = false;
      }

      if (address != null)
      {
         if (!isLarge)
         {
            session.setAddress(msg, address);
         }
         else
         {
            msg.setAddress(address);
         }

         // Anonymous
         theCredits = session.getCredits(address, true);
      }
      else
      {
         if (!isLarge)
         {
            session.setAddress(msg, this.address);
         }
         else
         {
            msg.setAddress(this.address);
         }

         theCredits = credits;
      }

      if (rateLimiter != null)
      {
         // Rate flow control

         rateLimiter.limit();
      }

      if (groupID != null)
      {
         msgI.putStringProperty(Message.HDR_GROUP_ID, groupID);
      }

      boolean sendBlocking = msgI.isDurable() ? blockOnDurableSend : blockOnNonDurableSend;

      session.workDone();

      if (isLarge)
      {
         largeMessageSend(sendBlocking, msgI, theCredits);
      }
      else
      {
         SessionSendMessage packet = new SessionSendMessage(msgI, sendBlocking);

         if (sendBlocking)
         {
            channel.sendBlocking(packet);
         }
         else
         {
            channel.sendBatched(packet);
         }
      }

      try
      {
         // This will block if credits are not available

         // Note, that for a large message, the encode size only includes the properties + headers
         // Not the continuations, but this is ok since we are only interested in limiting the amount of
         // data in *memory* and continuations go straight to the disk

         if (!isLarge)
         {
            theCredits.acquireCredits(msgI.getEncodeSize());
         }
      }
      catch (InterruptedException e)
      {
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.