Package org.jboss.messaging.core.contract

Examples of org.jboss.messaging.core.contract.Message


      TransactionRepository txRep = new TransactionRepository(pm, ms, 0);
      txRep.start();

      Message[] messages = createMessages(10);

      Message m1 = messages[0];
      Message m2 = messages[1];
      Message m3 = messages[2];
      Message m4 = messages[3];
      Message m5 = messages[4];


      Transaction tx = null;
      if (xa)
      {
View Full Code Here


                        byte[] payload = getBytes(rs, 7);

                        byte type = rs.getByte(8);

                        Message m = MessageFactory.createMessage(messageId,
                              reliable, expiration, timestamp, priority,
                              headers, payload, type);
                        msgs.add(m);
                     }
View Full Code Here

                  {
                     log.trace("Inserted " + rows + " rows");
                  }
                 
                  // Maybe we need to persist the message itself
                  Message m = ref.getMessage();

                  rows = storeMessage(m, psInsertMessage, psUpdateMessage);

                  if (trace)
                  {
View Full Code Here

                  if (trace)
                  {
                     log.trace("Inserted " + rows + " rows");
                  }

                  Message m = ref.getMessage();

                  synchronized (m)
                  {
                     if (!m.isPersisted())
                     {
                        if (psInsertMessage == null)
                        {
                           psInsertMessage = conn
                                 .prepareStatement(getSQLStatement("INSERT_MESSAGE"));
                        }

                        // First time so add message
                        // And in case of clustered queues/topics, the message
                        // could possibly be already persisted on the different
                        // node
                        // so we persist also using the Conditional Update
                        if (trace)
                        {
                           log
                                 .trace("Message does not already exist so inserting it");
                        }
                        storeMessage(m, psInsertMessage, true);
                        rows = psInsertMessage.executeUpdate();
                        if (trace)
                        {
                           log.trace("Inserted " + rows + " rows");
                        }

                        m.setPersisted(true);

                        messagesStored.add(m);

                        //We only cache the first id in a tx - this is enough to determine if the tx succeeded
                        if (first && m instanceof JBossMessage)
View Full Code Here

         {
            if(messagesStored != null)
            {
               for (Iterator i = messagesStored.iterator(); i.hasNext();)
               {
                  Message msg = (Message) i.next();

                  msg.setPersisted(false);
               }
            }
         }
View Full Code Here

                  if (trace)
                  {
                     log.trace("Inserted " + rows + " rows");
                  }

                  Message m = pair.ref.getMessage();

                  synchronized (m)
                  {
                     if (!m.isPersisted())
                     {
                        if (psInsertMessage == null)
                        {
                           psInsertMessage = conn
                                 .prepareStatement(getSQLStatement("INSERT_MESSAGE"));
                        }

                        storeMessage(m, psInsertMessage, true);
                        rows = psInsertMessage.executeUpdate();

                        if (trace)
                        {
                           log.trace("Inserted " + rows + " rows");
                        }

                        m.setPersisted(true);

                        messagesStored.add(m);

                        //We only cache the first id in a tx - this is enough to determine if the tx succeeded
                        if (first && m instanceof JBossMessage)
View Full Code Here

         {
            if(messagesStored != null)
            {
               for (Iterator i = messagesStored.iterator(); i.hasNext();)
               {
                  Message msg = (Message) i.next();

                  msg.setPersisted(false);
               }
            }
         }
View Full Code Here

      ids.add(msgId);
      List msgs = persistenceManager.getMessages(ids);
      Iterator msgIter = msgs.iterator();
      while (msgIter.hasNext())
      {
         Message m = (Message)msgIter.next();
         buffer.append("<tr>");
         buffer.append("<td>" + m.getMessageID() + "</td>");
         buffer.append("<td>" + m.getExpiration() + "</td>");
         buffer.append("<td>" + new Date(m.getTimestamp()) + "</td>");
         buffer.append("<td>" + m.getPriority() + "</td>");
         buffer.append("<td>" + m.getType() + "</td>");
         buffer.append("<td>" + m.getHeaders() + "</td>");
         buffer.append("<td>" + m.getPayload() + "</td>");
         buffer.append("<td>" + m.getPayload().getClass().getName() + "</td>");
         buffer.append("</tr>");
      }
     
      return buffer.toString();
   }
View Full Code Here

                 
                  iter = messages.iterator();
                 
                  while (iter.hasNext())
                  {
                     Message m = (Message)iter.next();
                     MessageReference mref = ms.reference(m);
                    
                     ReferenceInfo mInfo = refInfoMap.get(m.getMessageID());
                     mref.setDeliveryCount(mInfo.getDeliveryCount());
                     mref.setScheduledDeliveryTime(mInfo.getScheduledDelivery());
                    
                     Delivery del = new SimpleDelivery(ch, mref, true, true);
                     del.cancel();
View Full Code Here

         {
           log.error("Failed to acknowledge delivery", t);
         }
       }

       Message message = delivery.getReference().getMessage();

       //Note that we only replicate transacted or client acknowledge sessions
       //There is no point in replicating AUTO_ACK or DUPS_OK
       if (!consumer.isReplicating() || !replicating)
       {
         if (trace) { log.trace(this + " doing the delivery straight away"); }

         //Actually do the delivery now
         performDelivery(delivery.getReference(), deliveryId, consumer);
       }
       else if (!message.isReliable())
       {
         if (!toDeliver.isEmpty())
         {
           if (trace) { log.trace("Message is unreliable and there are refs in the toDeliver so adding to list"); }
View Full Code Here

TOP

Related Classes of org.jboss.messaging.core.contract.Message

Copyright © 2018 www.massapicom. 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.