Examples of basicGet()


Examples of com.rabbitmq.client.Channel.basicGet()

                ch.basicPublish(
                  EXCHANGE,
                  "", null,
                  new byte[1024 * 1024]
                );
                ch.basicGet(QUEUE, true);
            }
          } catch(Exception e){
            synchronized(lock){
              e.printStackTrace();
              System.err.println();
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicGet()

        Channel channel = connection.createChannel();

        String queue = "ttl.queue";

        // exchange
        GetResponse response = channel.basicGet(queue, false);
        if(response == null) {
            System.out.println("Got no message...");
        } else {
            System.out.println("Got message: " + new String(response.getBody()));
            channel.basicAck(response.getEnvelope().getDeliveryTag(), false);
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicGet()

        public void run() {
            try {
                while (true) {
                    Channel ch = conn.createChannel();
                    ch.basicPublish(EXCHANGE, ROUTING_KEY, null, new byte[1024 * 1024]);
                    ch.basicGet(QUEUE, true);
                    ch.close();
                }
            } catch (Exception e) {
                synchronized (outputSync) {
                    e.printStackTrace();
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicGet()

        Channel channel = connection.createChannel();

        String queue = "ttl.queue";

        // exchange
        GetResponse response = channel.basicGet(queue, false);
        if(response == null) {
            System.out.println("Got no message...");
        } else {
            System.out.println("Got message: " + new String(response.getBody()));
            channel.basicAck(response.getEnvelope().getDeliveryTag(), false);
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicGet()

        channel.queueDeclarePassive(TEST_QUEUE);
       
        String body = "test.body";
        channel.basicPublish(TEST_EXCHANGE, routingKey, new BasicProperties(), body.getBytes());
       
        GetResponse response = channel.basicGet(TEST_QUEUE, true);
        Assert.assertNotNull("no message in queue", response);
        Assert.assertEquals("wrong message in queue", new String(response.getBody(), "UTF-8"), body);
       
        channel.exchangeDelete(TEST_EXCHANGE);
    }
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicGet()

        final String clientId = (String) parameters[2];
        final Channel channel = AmqpOperationFactory.this.amqpDriver.getChannel (clientId);
        if (channel != null) {
          GetResponse outcome = null;
          try {
            outcome = channel.basicGet (queue, autoAck);
            if (outcome != null) {
              final Envelope envelope = outcome.getEnvelope ();
              final AMQP.BasicProperties properties = outcome.getProps ();
              message = new AmqpInboundMessage (null, envelope.getDeliveryTag (), envelope.getExchange (), envelope.getRoutingKey (), outcome.getBody (), properties.getDeliveryMode () == 2 ? true : false, properties.getReplyTo (), properties.getContentEncoding (), properties.getContentType (), properties.getCorrelationId (), properties.getMessageId ());
            }
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicGet()

    when(mockConnectionFactory.newConnection((ExecutorService) null)).thenReturn(mockConnection);
    when(mockConnection.isOpen()).thenReturn(true);
    when(mockConnection.createChannel()).thenReturn(mockChannel1).thenReturn(mockChannel2);

    when(mockChannel1.basicGet("foo", false)).thenReturn(new GetResponse(null, null, null, 1));
    when(mockChannel2.basicGet("bar", false)).thenReturn(new GetResponse(null, null, null, 1));
    when(mockChannel1.isOpen()).thenReturn(true);
    when(mockChannel2.isOpen()).thenReturn(true);

    CachingConnectionFactory ccf = new CachingConnectionFactory(mockConnectionFactory);
    ccf.setChannelCacheSize(2);
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicGet()

    Channel channel1 = con.createChannel(false);
    Channel channel2 = con.createChannel(false);

    channel1.basicGet("foo", true);
    channel2.basicGet("bar", true);

    channel1.close(); // should be ignored, and add last into channel cache.
    channel2.close(); // should be ignored, and add last into channel cache.

    Channel ch1 = con.createChannel(false); // remove first entry in cache
View Full Code Here

Examples of eu.mosaic_cloud.drivers.queue.amqp.AmqpDriver.basicGet()

        queue = gop.getQueue ();
        autoAck = gop.getAutoAck ();
        AmqpStub.logger.trace ("AmqpStub - Received request for GET"); // $NON-NLS-1$
        // NOTE: execute operation
        final DriverOperationFinishedHandler getHandler = new DriverOperationFinishedHandler (token, session);
        resultBool = driver.basicGet (token.getClientId (), queue, autoAck, getHandler);
        getHandler.setDetails (AmqpOperations.GET, resultBool);
        break;
      case CANCEL_REQUEST :
        final AmqpPayloads.CancelRequest clop = (CancelRequest) message.payload;
        token = clop.getToken ();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.