Package com.rabbitmq.client

Examples of com.rabbitmq.client.Method


  protected ShutdownSignalException channelShutdownSignal() {
    return retryableChannelShutdownSignal();
  }

  protected ShutdownSignalException nonRetryableChannelShutdownSignal() {
    Method m = new AMQP.Channel.Close.Builder().replyCode(404).build();
    return new ShutdownSignalException(false, false, m, null);
  }
View Full Code Here


    Method m = new AMQP.Channel.Close.Builder().replyCode(404).build();
    return new ShutdownSignalException(false, false, m, null);
  }

  protected ShutdownSignalException retryableChannelShutdownSignal() {
    Method m = new AMQP.Channel.Close.Builder().replyCode(311).build();
    return new ShutdownSignalException(false, false, m, null);
  }
View Full Code Here

  protected ShutdownSignalException connectionShutdownSignal() {
    return retryableConnectionShutdownSignal();
  }

  protected ShutdownSignalException retryableConnectionShutdownSignal() {
    Method m = new AMQP.Connection.Close.Builder().replyCode(320).build();
    return new ShutdownSignalException(true, false, m, null);
  }
View Full Code Here

    Method m = new AMQP.Connection.Close.Builder().replyCode(320).build();
    return new ShutdownSignalException(true, false, m, null);
  }

  protected ShutdownSignalException nonRetryableConnectionShutdownSignal() {
    Method m = new AMQP.Connection.Close.Builder().replyCode(530).build();
    return new ShutdownSignalException(true, false, m, null);
  }
View Full Code Here

    Method m = new AMQP.Connection.Close.Builder().replyCode(530).build();
    return new ShutdownSignalException(true, false, m, null);
  }

  protected void callShutdownListener(RetryableResource resource, ShutdownSignalException e) {
    Method method = e.getReason();
    if (method instanceof AMQP.Connection.Close) {
      if (recoveryChannel != null)
        when(recoveryChannel.isOpen()).thenReturn(false);
      connectionHandler.shutdownListeners.get(0).shutdownCompleted(e);
    } else if (method instanceof AMQP.Channel.Close)
View Full Code Here

  }

  private static boolean isRetryable(ShutdownSignalException e) {
    if (e.isInitiatedByApplication())
      return false;
    Method method = e.getReason();
    if (method instanceof AMQP.Connection.Close)
      return isRetryable(((AMQP.Connection.Close) method).getReplyCode());
    if (method instanceof AMQP.Channel.Close)
      return isRetryable(((AMQP.Channel.Close) method).getReplyCode());
    return false;
View Full Code Here

        ConnectionFactory factory = new ConnectionFactory();
        SocketFrameHandler fh = new SocketFrameHandler(factory.getSocketFactory().createSocket("localhost", AMQP.PROTOCOL.PORT));
        fh.sendHeader();
        AMQCommand command = new AMQCommand();
        while (!command.handleFrame(fh.readFrame())) { }
        Method m = command.getMethod();
        //    System.out.println(m.getClass());
        assertTrue("First command must be Connection.start",
                m instanceof AMQP.Connection.Start);
        AMQP.Connection.Start start = (AMQP.Connection.Start) m;
        assertTrue("Version in Connection.start is <= what we sent",
View Full Code Here

    private void setChannelReturnListener() {
        log("Setting return listener..");
        _ch1.addReturnListener(new ReturnListener() {
            public void handleReturn(int replyCode, String replyText, String exchange, String routingKey, AMQP.BasicProperties properties, byte[] body)
                    throws IOException {
                Method method = new AMQP.Basic.Return.Builder()
                                        .replyCode(replyCode)
                                        .replyText(replyText)
                                        .exchange(exchange)
                                        .routingKey(routingKey)
                                .build();
View Full Code Here

{
    private static final String XCHG_NAME = "builder_test_xchg";

    public void testParticularBuilderForBasicSanityWithRpc() throws IOException
    {
        Method retVal =
                channel.rpc(new AMQP.Exchange.Declare.Builder()
                           .exchange(XCHG_NAME)
                           .type("direct")
                           .durable(false)
                           .build()
View Full Code Here

        ConnectionFactory factory = new ConnectionFactory();
        SocketFrameHandler fh = new SocketFrameHandler(factory.getSocketFactory().createSocket("localhost", AMQP.PROTOCOL.PORT));
        fh.sendHeader();
        AMQCommand command = new AMQCommand();
        while (!command.handleFrame(fh.readFrame())) { }
        Method m = command.getMethod();
        //    System.out.println(m.getClass());
        assertTrue("First command must be Connection.start",
                m instanceof AMQP.Connection.Start);
        AMQP.Connection.Start start = (AMQP.Connection.Start) m;
        assertTrue("Version in Connection.start is <= what we sent",
View Full Code Here

TOP

Related Classes of com.rabbitmq.client.Method

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.