Package com.rabbitmq.client

Examples of com.rabbitmq.client.GetResponse


                                             getOk.getExchange(),
                                             getOk.getRoutingKey());
            BasicProperties props = (BasicProperties)replyCommand.getContentHeader();
            byte[] body = replyCommand.getContentBody();
            int messageCount = getOk.getMessageCount();
            return new GetResponse(envelope, props, body, messageCount);
        } else if (method instanceof Basic.GetEmpty) {
            return null;
        } else {
            throw new UnexpectedMethodError(method);
        }
View Full Code Here


        throws IOException, InterruptedException
    {
        publishN("", "confirm-test-noconsumer", true, false, false);

        for (long i = 0; i < NUM_MESSAGES; i++) {
            GetResponse resp =
                channel.basicGet("confirm-test-noconsumer", false);
            resp.getEnvelope().getDeliveryTag();
            // not acking
        }

        channel.basicRecover(true);
View Full Code Here

        throws IOException
    {
        publishN("", "confirm-test-noconsumer", true, false, false);

        for (long i = 0; i < NUM_MESSAGES; i++) {
            GetResponse resp =
                channel.basicGet("confirm-test-noconsumer", false);
            long dtag = resp.getEnvelope().getDeliveryTag();
            channel.basicReject(dtag, requeue);
        }
    }
View Full Code Here

        for (int i = 0; i < N; i++) {
            basicPublishVolatile(X, K);
        }

        GetResponse response = channel.basicGet(Q, true);
        assertNull("The initial response SHOULD BE null", response);

        deleteQueue(Q);
        deleteExchange(X);
    }
View Full Code Here

        restart();

        basicPublishVolatile("", Q);

        GetResponse response = channel.basicGet(Q, true);
        assertNotNull("The initial response SHOULD NOT be null", response);

        deleteQueue(Q);
    }
View Full Code Here

  protected void restart() throws IOException {
  }

  protected void sendRoutable(Binding binding) throws IOException {
    channel.basicPublish(binding.x, binding.k, null, payload);
    GetResponse response = channel.basicGet(binding.q, true);
    assertNotNull("The response should not be null", response);
  }
View Full Code Here

    assertNotNull("The response should not be null", response);
  }

  protected void sendUnroutable(Binding binding) throws IOException {
    channel.basicPublish(binding.x, binding.k, null, payload);
    GetResponse response = channel.basicGet(binding.q, true);
    assertNull("The response SHOULD BE null", response);
  }
View Full Code Here

        channel.basicPublish(binding.x, binding.k, null, payload);

        // Purge the queue, and test that we don't recieve a message
        channel.queuePurge(binding.q);

        GetResponse response = channel.basicGet(binding.q, true);
        assertNull("The response SHOULD BE null", response);

        deleteExchangeAndQueue(binding);
    }
View Full Code Here

    @SuppressWarnings("deprecation")
    public void testUnackedPurge() throws IOException {
        Binding binding = setupExchangeBindings(false);
        channel.basicPublish(binding.x, binding.k, null, payload);

        GetResponse response = channel.basicGet(binding.q, false);
        assertFalse(response.getEnvelope().isRedeliver());
        assertNotNull("The response SHOULD NOT BE null", response);

        // If we purge the queue the unacked message should still be there on
        // recover.
        channel.queuePurge(binding.q);
        response = channel.basicGet(binding.q, true);
        assertNull("The response SHOULD BE null", response);

        channel.basicRecoverAsync(true);
        response = channel.basicGet(binding.q, false);
        assertTrue(response.getEnvelope().isRedeliver());
        assertNotNull("The response SHOULD NOT BE null", response);

        // If we recover then purge the message should go away
        channel.basicRecoverAsync(true);
        channel.queuePurge(binding.q);
View Full Code Here

    }

    private void checkGet(String queue, boolean messageExpected)
        throws IOException
    {
        GetResponse r = channel.basicGet(queue, true);
        if (messageExpected) {
            assertNotNull(r);
        } else {
            assertNull(r);
        }
View Full Code Here

TOP

Related Classes of com.rabbitmq.client.GetResponse

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.