Package com.rabbitmq.client

Examples of com.rabbitmq.client.Consumer


    // }}}

    // {{{ testSendJson
    public void testSendJson() throws Exception {
        // build the endpoint for the module to deliver to
        Consumer cons = new DefaultConsumer(chan) {
            public void handleDelivery(final String consumerTag,
                                       final Envelope envelope,
                                       final AMQP.BasicProperties props,
                                       final byte[] body)
                throws IOException
View Full Code Here


    // }}}

    // {{{ testSendPlainText
    public void testSendPlainText() throws Exception {
        // build the endpoint for the module to deliver to
        Consumer cons = new DefaultConsumer(chan) {
            public void handleDelivery(final String consumerTag,
                                       final Envelope envelope,
                                       final AMQP.BasicProperties props,
                                       final byte[] body)
                throws IOException
View Full Code Here

    // }}}

    // {{{ testInvokeRpcWithSingleReply
    public void testInvokeRpcWithSingleReply() throws Exception {
        // build the endpoint for the module to deliver to
        Consumer cons = new DefaultConsumer(chan) {
            public void handleDelivery(final String consumerTag,
                                       final Envelope envelope,
                                       final AMQP.BasicProperties props,
                                       final byte[] body)
                throws IOException
View Full Code Here

    // }}}

    // {{{ testInvokeRpcWithManyReplies
    public void testInvokeRpcWithManyReplies() throws Exception {
        // build the endpoint for the module to deliver to
        Consumer cons = new DefaultConsumer(chan) {
            public void handleDelivery(final String consumerTag,
                                       final Envelope envelope,
                                       final AMQP.BasicProperties props,
                                       final byte[] body)
                throws IOException
View Full Code Here

      final CountDownLatch latch) throws IOException {
    doAnswer(new Answer<Object>() {

      @Override
      public Object answer(InvocationOnMock invocation) throws Throwable {
        Consumer cons = (Consumer) invocation.getArguments()[6];
        consumers.add(cons);
        cons.handleConsumeOk(String.valueOf(consumerTag.getAndIncrement()));
        latch.countDown();
        return null;
      }
    }).when(channel).basicConsume(anyString(), anyBoolean(), anyString(), anyBoolean(), anyBoolean(), anyMap(), any(Consumer.class));
  }
View Full Code Here

      public Object answer(InvocationOnMock invocation) throws Throwable {
        Set<?> consumers = TestUtils.getPropertyValue(container, "consumers", Map.class).keySet();
        for (Object consumer : consumers) {
          ChannelProxy channel = TestUtils.getPropertyValue(consumer, "channel", ChannelProxy.class);
          if (channel != null && channel.getTargetChannel() == mockChannel) {
            Consumer rabbitConsumer = TestUtils.getPropertyValue(consumer, "consumer", Consumer.class);
            if (cancel) {
              rabbitConsumer.handleCancelOk((String) invocation.getArguments()[0]);
            }
            else {
              rabbitConsumer.handleConsumeOk("foo");
            }
            latch.countDown();
          }
        }
        return null;
View Full Code Here

TOP

Related Classes of com.rabbitmq.client.Consumer

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.