Package org.hornetq.api.core

Examples of org.hornetq.api.core.HornetQException


   public void connectionDestroyed(final Object connectionID)
   {
      // The exception has to be created in the same thread where it's being called
      // as to avoid a different stack trace cause
      final HornetQException ex = HornetQClientMessageBundle.BUNDLE.channelDisconnected();

      // It has to use the same executor as the disconnect message is being sent through

      closeExecutor.execute(new Runnable()
      {
View Full Code Here


               throw e;
            }
         }
      }
      connection.destroy();
      throw new HornetQException(HornetQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS);
   }
View Full Code Here

         {
            throw (HornetQException)handledException;
         }
         else
         {
            throw new HornetQException(HornetQExceptionType.LARGE_MESSAGE_ERROR_BODY,
                                       "Error on saving LargeMessageBufferImpl",
                                       handledException);
         }
      }
   }
View Full Code Here

   public void storeMessage(final ServerMessage message) throws Exception
   {
      if (message.getMessageID() <= 0)
      {
         // Sanity check only... this shouldn't happen unless there is a bug
         throw new HornetQException(HornetQException.ILLEGAL_STATE, "MessageId was not assigned to Message");
      }

      // Note that we don't sync, the add reference that comes immediately after will sync if appropriate

      if (message.isLargeMessage())
View Full Code Here

   public void storeMessageTransactional(final long txID, final ServerMessage message) throws Exception
   {
      if (message.getMessageID() <= 0)
      {
         throw new HornetQException(HornetQException.ILLEGAL_STATE, "MessageId was not assigned to Message");
      }

      if (message.isLargeMessage())
      {
         messageJournal.appendAddRecordTransactional(txID,
View Full Code Here

      Binding binding = addressManager.removeBinding(uniqueName, tx);

      if (binding == null)
      {
         throw new HornetQException(HornetQException.QUEUE_DOES_NOT_EXIST);
      }

      if (addressManager.getBindingsForRoutingAddress(binding.getAddress()) == null)
      {
         pagingManager.deletePageStore(binding.getAddress());
View Full Code Here

            warnMessage.append(message.toString());
            PostOfficeImpl.log.warn(warnMessage.toString());

            if (context.getTransaction() != null)
            {
               context.getTransaction().markAsRollbackOnly(new HornetQException(HornetQException.DUPLICATE_ID_REJECTED, warnMessage.toString()));
            }

            message.decrementRefCount();

            return false;
         }
         else
         {
            if (context.getTransaction() == null)
            {
               context.setTransaction(new TransactionImpl(storageManager));
               startedTX.set(true);
            }
         }

         cacheBridge.addToCache(bridgeDupBytes, context.getTransaction());

         message.removeProperty(MessageImpl.HDR_BRIDGE_DUPLICATE_ID);

      }
      else
      {
         // if used BridgeDuplicate, it's not going to use the regular duplicate
         // since this will would break redistribution (re-setting the duplicateId)
         byte[] duplicateIDBytes = message.getDuplicateIDBytes();
  
         DuplicateIDCache cache = null;
  
         boolean isDuplicate = false;
  
         if (duplicateIDBytes != null)
         {
            cache = getDuplicateIDCache(message.getAddress());
  
            isDuplicate = cache.contains(duplicateIDBytes);
  
            if (rejectDuplicates && isDuplicate)
            {
               String warnMessage = "Duplicate message detected - message will not be routed. Message information:" + message.toString();
               PostOfficeImpl.log.warn(warnMessage);
  
               if (context.getTransaction() != null)
               {
                  context.getTransaction().markAsRollbackOnly(new HornetQException(HornetQException.DUPLICATE_ID_REJECTED, warnMessage));
               }
  
               message.decrementRefCount();
  
               return false;
View Full Code Here

            }

            if (ref == null)
            {

               HornetQException e = new HornetQException(HornetQException.ILLEGAL_STATE, "Could not find reference on consumerID=" +
                                id +
                                ", messageId = " +
                                messageID +
                                " queue = " +
                                messageQueue.getName());
               throw e;
            }

            ref.getQueue().acknowledge(tx, ref);
         }
         while (ref.getMessage().getMessageID() != messageID);

         if (startedTransaction)
         {
            tx.commit();
         }
      }
      catch (HornetQException e)
      {
         if (startedTransaction)
         {
            tx.rollback();
         }
         else
         {
            tx.markAsRollbackOnly(e);
         }
         throw e;
      }
      catch (Throwable e)
      {
         log.error(e.getMessage(), e);
         HornetQException hqex = new HornetQException(HornetQException.ILLEGAL_STATE, e.getMessage());
         if (startedTransaction)
         {
            tx.rollback();
         }
         else
View Full Code Here

   {
      Binding binding = postOffice.getBinding(queueName);

      if (binding == null || binding.getType() != BindingType.LOCAL_QUEUE)
      {
         throw new HornetQException(HornetQException.QUEUE_DOES_NOT_EXIST, "Queue " + queueName + " does not exist");
      }

      securityStore.check(binding.getAddress(), CheckType.CONSUME, this);

      Filter filter = FilterImpl.createFilter(filterString);
View Full Code Here

   {
      Binding binding = postOffice.getBinding(name);

      if (binding == null || binding.getType() != BindingType.LOCAL_QUEUE)
      {
         throw new HornetQException(HornetQException.QUEUE_DOES_NOT_EXIST);
      }

      server.destroyQueue(name, this, true);

      TempQueueCleanerUpper cleaner = this.tempQueueCleannerUppers.remove(name);
View Full Code Here

TOP

Related Classes of org.hornetq.api.core.HornetQException

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.