Package org.springframework.amqp

Examples of org.springframework.amqp.AmqpIOException


    }
    if (ex instanceof UnsupportedEncodingException) {
      return new AmqpUnsupportedEncodingException(ex);
    }
    if (ex instanceof IOException) {
      return new AmqpIOException((IOException) ex);
    }
    // fallback
    return new UncategorizedAmqpException(ex);
  }
View Full Code Here


      return methodInvoker.invoke();
    }
    catch (InvocationTargetException ex) {
      Throwable targetEx = ex.getTargetException();
      if (targetEx instanceof IOException) {
        throw new AmqpIOException((IOException) targetEx);
      }
      else {
        throw new ListenerExecutionFailedException("Listener method '" + methodName + "' threw exception",
            targetEx, originalMessage);
      }
View Full Code Here

      return resourceHolderToUse;

    } catch (IOException ex) {
      RabbitUtils.closeChannel(channel);
      RabbitUtils.closeConnection(connection);
      throw new AmqpIOException(ex);
    }
  }
View Full Code Here

  public static void commitIfNecessary(Channel channel) {
    Assert.notNull(channel, "Channel must not be null");
    try {
      channel.txCommit();
    } catch (IOException ex) {
      throw new AmqpIOException(ex);
    }
  }
View Full Code Here

  public static void rollbackIfNecessary(Channel channel) {
    Assert.notNull(channel, "Channel must not be null");
    try {
      channel.txRollback();
    } catch (IOException ex) {
      throw new AmqpIOException(ex);
    }
  }
View Full Code Here

      if (deliveryTags.containsKey(channel)) {
        for (Long deliveryTag : deliveryTags.get(channel)) {
          try {
            channel.basicReject(deliveryTag, true);
          } catch (IOException ex) {
            throw new AmqpIOException(ex);
          }
        }
        // Need to commit the reject (=nack)
        RabbitUtils.commitIfNecessary(channel);
      }
View Full Code Here

TOP

Related Classes of org.springframework.amqp.AmqpIOException

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.