Examples of ServerMessageImpl


Examples of org.hornetq.core.server.impl.ServerMessageImpl

               break;
            }
            case ADD_MESSAGE:
            {
               ServerMessage message = new ServerMessageImpl(record.id, 50);

               message.decode(buff);

               messages.put(record.id, message);

               break;
            }
View Full Code Here

Examples of org.hornetq.core.server.impl.ServerMessageImpl

                  break;
               }
               case ADD_MESSAGE:
               {
                  ServerMessage message = new ServerMessageImpl(record.id, 50);

                  message.decode(buff);

                  messages.put(record.id, message);

                  break;
               }
View Full Code Here

Examples of org.hornetq.core.server.impl.ServerMessageImpl

            messageEncoding.decode(buffer);

            return new MessageDescribe(largeMessage);

         case ADD_MESSAGE:
            ServerMessage message = new ServerMessageImpl(rec, 50);

            message.decode(buffer);

            return new MessageDescribe(message);

         case ADD_REF:
         {
View Full Code Here

Examples of org.hornetq.core.server.impl.ServerMessageImpl

               break;
            }
            case ADD_MESSAGE:
            {
               ServerMessage message = new ServerMessageImpl(record.id, 50);

               message.decode(buff);

               messages.put(record.id, message);

               break;
            }
View Full Code Here

Examples of org.hornetq.core.server.impl.ServerMessageImpl

                  break;
               }
               case ADD_MESSAGE:
               {
                  ServerMessage message = new ServerMessageImpl(record.id, 50);

                  message.decode(buff);

                  messages.put(record.id, message);

                  break;
               }
View Full Code Here

Examples of org.hornetq.core.server.impl.ServerMessageImpl

            return new MessageDescribe(largeMessage);
         }
         case ADD_MESSAGE:
         {
            ServerMessage message = new ServerMessageImpl(rec, 50);

            message.decode(buffer);

            return new MessageDescribe(message);
         }
         case ADD_REF:
         {
View Full Code Here

Examples of org.hornetq.core.server.impl.ServerMessageImpl

      // Need to lock to make sure all queue info and notifications are in the correct order with no gaps
      synchronized (notificationLock)
      {
         // First send a reset message

         ServerMessage message = new ServerMessageImpl(storageManager.generateUniqueID(), 50);

         message.setAddress(queueName);
         message.putBooleanProperty(PostOfficeImpl.HDR_RESET_QUEUE_DATA, true);
         routeQueueInfo(message, queue, false);

         for (QueueInfo info : queueInfos.values())
         {
            if (log.isTraceEnabled())
            {
               log.trace("QueueInfo on sendQueueInfoToQueue = " + info);
            }
            if (info.getAddress().startsWith(address))
            {
               message = createQueueInfoMessage(NotificationType.BINDING_ADDED, queueName);

               message.putStringProperty(ManagementHelper.HDR_ADDRESS, info.getAddress());
               message.putStringProperty(ManagementHelper.HDR_CLUSTER_NAME, info.getClusterName());
               message.putStringProperty(ManagementHelper.HDR_ROUTING_NAME, info.getRoutingName());
               message.putLongProperty(ManagementHelper.HDR_BINDING_ID, info.getID());
               message.putStringProperty(ManagementHelper.HDR_FILTERSTRING, info.getFilterString());
               message.putIntProperty(ManagementHelper.HDR_DISTANCE, info.getDistance());

               routeQueueInfo(message, queue, true);

               int consumersWithFilters = info.getFilterStrings() != null ? info.getFilterStrings().size() : 0;

               for (int i = 0; i < info.getNumberOfConsumers() - consumersWithFilters; i++)
               {
                  message = createQueueInfoMessage(NotificationType.CONSUMER_CREATED, queueName);

                  message.putStringProperty(ManagementHelper.HDR_ADDRESS, info.getAddress());
                  message.putStringProperty(ManagementHelper.HDR_CLUSTER_NAME, info.getClusterName());
                  message.putStringProperty(ManagementHelper.HDR_ROUTING_NAME, info.getRoutingName());
                  message.putIntProperty(ManagementHelper.HDR_DISTANCE, info.getDistance());

                  routeQueueInfo(message, queue, true);
               }

               if (info.getFilterStrings() != null)
               {
                  for (SimpleString filterString : info.getFilterStrings())
                  {
                     message = createQueueInfoMessage(NotificationType.CONSUMER_CREATED, queueName);

                     message.putStringProperty(ManagementHelper.HDR_ADDRESS, info.getAddress());
                     message.putStringProperty(ManagementHelper.HDR_CLUSTER_NAME, info.getClusterName());
                     message.putStringProperty(ManagementHelper.HDR_ROUTING_NAME, info.getRoutingName());
                     message.putStringProperty(ManagementHelper.HDR_FILTERSTRING, filterString);
                     message.putIntProperty(ManagementHelper.HDR_DISTANCE, info.getDistance());

                     routeQueueInfo(message, queue, true);
                  }
               }
            }
View Full Code Here

Examples of org.hornetq.core.server.impl.ServerMessageImpl

      }
   }

   private ServerMessage createQueueInfoMessage(final NotificationType type, final SimpleString queueName)
   {
      ServerMessage message = new ServerMessageImpl(storageManager.generateUniqueID(), 50);

      message.setAddress(queueName);

      String uid = UUIDGenerator.getInstance().generateStringUUID();

      message.putStringProperty(ManagementHelper.HDR_NOTIFICATION_TYPE, new SimpleString(type.toString()));
      message.putLongProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP, System.currentTimeMillis());

      message.putStringProperty(new SimpleString("foobar"), new SimpleString(uid));

      return message;
   }
View Full Code Here

Examples of org.hornetq.core.server.impl.ServerMessageImpl

         if (header == null)
         {
            header = new Header();
         }

         ServerMessageImpl message = connection.createServerMessage();
         TypedProperties properties = message.getProperties();

         properties.putLongProperty(new SimpleString(MESSAGE_FORMAT), encodedMessage.getMessageFormat());
         properties.putLongProperty(new SimpleString(PROTON_MESSAGE_FORMAT), getMessageFormat(protonMessage.getMessageFormat()));
         properties.putIntProperty(new SimpleString(PROTON_MESSAGE_SIZE), encodedMessage.getLength());

         populateSpecialProps(header, protonMessage, message, properties);
         populateHeaderProperties(header, properties, message);
         populateDeliveryAnnotations(protonMessage.getDeliveryAnnotations(), properties);
         populateMessageAnnotations(protonMessage.getMessageAnnotations(), properties);
         populateApplicationProperties(protonMessage.getApplicationProperties(), properties);
         populateProperties(protonMessage.getProperties(), properties, message);
         populateFooterProperties(protonMessage.getFooter(), properties);
         message.setTimestamp(System.currentTimeMillis());

         Section section = protonMessage.getBody();
         if (section instanceof AmqpValue)
         {
            AmqpValue amqpValue = (AmqpValue) section;
            Object value = amqpValue.getValue();
            if (value instanceof String)
            {
               message.getBodyBuffer().writeNullableString((String) value);
            }
            else if (value instanceof Binary)
            {
               Binary binary = (Binary) value;
               message.getBodyBuffer().writeBytes(binary.getArray());
            }
         }
         else if(section instanceof Data)
         {
            message.getBodyBuffer().writeBytes(((Data)section).getValue().getArray());
         }

         return message;
      }
View Full Code Here

Examples of org.hornetq.core.server.impl.ServerMessageImpl

      //noop
   }

   public ServerMessageImpl createServerMessage()
   {
      return new ServerMessageImpl(server.getStorageManager().generateUniqueID(), 512);
   }
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.