Package org.jboss.jms.message

Examples of org.jboss.jms.message.JBossMessage


     
      switch (type)
      {
         case JBossMessage.TYPE:
         {
            m = new JBossMessage(messageID, reliable, expiration,
                                 timestamp, priority, headers, payload);
            break;
         }
         case JBossObjectMessage.TYPE:
         {
View Full Code Here


         testPacket(req, PacketSupport.REQ_SESSION_UNSUBSCRIBE);                          
      }
     
      public void testSessionSendRequest() throws Exception
      {
         JBossMessage msg = new JBossMessage(123);
        
         RequestSupport req =
            new SessionSendRequest("23", (byte)77, msg, false, true, -1);
                
         testPacket(req, PacketSupport.REQ_SESSION_SEND);                          
View Full Code Here

     
      // Browser
     
      public void testBrowserNextMessageResponse() throws Exception
      {
         JBossMessage msg = new JBossMessage(123);
        
         ResponseSupport resp =
            new BrowserNextMessageResponse(msg);
                
         testPacket(resp, PacketSupport.RESP_BROWSER_NEXTMESSAGE);                          
View Full Code Here

         testPacket(resp, PacketSupport.RESP_BROWSER_HASNEXTMESSAGE);                          
      }
     
      public void testBrowserNextMessageBlockResponse() throws Exception
      {
         JBossMessage msg = new JBossMessage(123);
        
         ResponseSupport resp =
            new BrowserNextMessageBlockResponse(new JBossMessage[] { msg });
                
         testPacket(resp, PacketSupport.RESP_BROWSER_NEXTMESSAGEBLOCK);                          
View Full Code Here

      if (expiryQueue != null)
      {
         if (trace) { log.trace(this + " sending expired message to expiry queue " + expiryQueue); }

         JBossMessage copy = makeCopyForDLQOrExpiry(true, del);

         moveInTransaction(copy, del, expiryQueue, true);
      }
      else
      {
View Full Code Here

         if (expired)
         {
            //Sent to expiry queue

            if (debug) { log.debug("Sending expired message: " + rec.del.getReference() + " to expiry queue " + rec.expiryQueue); }
            JBossMessage copy = makeCopyForDLQOrExpiry(true, del);

            moveInTransaction(copy, del, rec.expiryQueue, false);
         }
         else
         {
            //Send to DLQ
            if (debug) { log.debug("Sending message: " + rec.del.getReference() + " to dlq " + rec.dlq); }

            JBossMessage copy = makeCopyForDLQOrExpiry(false, del);

            moveInTransaction(copy, del, rec.dlq, true);
         }
      }
View Full Code Here

      //subscriptions of a topic for example
      //We set headers that hold the original message destination, expiry time and original message id

     if (trace) { log.trace("Making copy of message for DLQ or expiry " + del); }

      JBossMessage msg = ((JBossMessage)del.getReference().getMessage());

      JBossMessage copy = msg.doCopy();

      long newMessageId = sp.getMessageIDManager().getID();

      copy.setMessageId(newMessageId);

      //reset expiry
      copy.setExpiration(0);

      String origMessageId = msg.getJMSMessageID();

      String origDest = msg.getJMSDestination().toString();

      copy.setStringProperty(JBossMessage.JBOSS_MESSAGING_ORIG_MESSAGE_ID, origMessageId);

      copy.setStringProperty(JBossMessage.JBOSS_MESSAGING_ORIG_DESTINATION, origDest);

      if (expiry)
      {
         long actualExpiryTime = System.currentTimeMillis();

         copy.setLongProperty(JBossMessage.JBOSS_MESSAGING_ACTUAL_EXPIRY_TIME, actualExpiryTime);
      }

      return copy;
   }
View Full Code Here

      log.trace("Done that test");
   }

   public void testCopyOnJBossMessage() throws JMSException
   {
      JBossMessage jbossMessage = ((MessageProxy)queueProducerSession.createMessage()).getMessage();

      configureMessage(jbossMessage);

      JBossMessage copy = new JBossMessage(jbossMessage, 0);

      ensureEquivalent(jbossMessage, copy);
   }
View Full Code Here

   public void testCopyOnForeignMessage() throws JMSException
   {
      Message foreignMessage = new SimpleJMSMessage();

      JBossMessage copy = new JBossMessage(foreignMessage, 0);

      ensureEquivalent(foreignMessage, copy);
   }
View Full Code Here

               // send an expired message
               Message m = queueProducerSession.createMessage();
               queueProducer.send(m, DeliveryMode.NON_PERSISTENT, 4, -1);

               JBossMessage jbm = ((MessageProxy)m).getMessage();
              
               if (!jbm.isExpired())
               {
                  log.error("The message " + m + " should have expired");
                  testFailed = true;
                  return;
               }
View Full Code Here

TOP

Related Classes of org.jboss.jms.message.JBossMessage

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.