Package org.jboss.jms.message

Examples of org.jboss.jms.message.JBossMessage


      //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


         // send the messages

         for (Iterator j = sessionState.getMsgs().iterator(); j.hasNext(); )
         {
            JBossMessage message = (JBossMessage)j.next();

            if (checkForDuplicates && !message.isReliable())
            {
               //Ignore np messages on failover
            }
            else
            {
View Full Code Here

      String result = "<null>";
      if (ref == null) return result;
      Object rmsg = ref.getMessage();
      if (rmsg instanceof JBossMessage)
      {
         JBossMessage msg = (JBossMessage)ref.getMessage();
         if (msg instanceof TextMessage)
         {
            try
            {
               result = "(" + ((TextMessage)msg).getText() + ")";
View Full Code Here

         // send the messages

         for (Iterator j = sessionState.getMsgs().iterator(); j.hasNext(); )
         {
            JBossMessage message = (JBossMessage)j.next();

            if (checkForDuplicates && !message.isReliable())
            {
               //Ignore np messages on failover
            }
            else
            {
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



   public void testExpirationOnReceive() throws Exception
   {
      expectedMessage = new JBossMessage(123456);

      queueProducer.send(queueProducerSession.createMessage(), DeliveryMode.NON_PERSISTENT, 4, 2000);

      // allow the message to expire
      Thread.sleep(3000);
View Full Code Here

            Iterator iter2 = msgs.iterator();

            while (iter2.hasNext())
            {
               JBossMessage m = (JBossMessage) iter2.next();

               out.writeByte(m.getType());

               m.write(out);
            }

            List acks = state.getAcks();

            iter2 = acks.iterator();
View Full Code Here

         for (int j = 0; j < numMsgs; j++)
         {
            byte type = in.readByte();

            JBossMessage msg = (JBossMessage) MessageFactory.createMessage(type);

            msg.read(in);

            sessionState.addMessage(msg);
         }

         long l;
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

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.