Examples of AMQMethodBody


Examples of org.apache.qpid.framing.AMQMethodBody

    }

    private void flow(boolean flow)
    {
        MethodRegistry methodRegistry = _session.getMethodRegistry();
        AMQMethodBody responseBody = methodRegistry.createChannelFlowBody(flow);
        _session.writeFrame(responseBody.generateFrame(_channelId));
    }
View Full Code Here

Examples of org.apache.qpid.framing.AMQMethodBody

                        AMQShortString consumerTag = channel.subscribeToQueue(consumerTagName, queue, !body.getNoAck(),
                                                                              body.getArguments(), body.getNoLocal(), body.getExclusive());
                        if (!body.getNowait())
                        {
                            MethodRegistry methodRegistry = protocolConnection.getMethodRegistry();
                            AMQMethodBody responseBody = methodRegistry.createBasicConsumeOkBody(consumerTag);
                            protocolConnection.writeFrame(responseBody.generateFrame(channelId));

                        }
                    }
                    else
                    {
                        AMQShortString msg = new AMQShortString("Non-unique consumer tag, '" + body.getConsumerTag() + "'");

                        MethodRegistry methodRegistry = protocolConnection.getMethodRegistry();
                        AMQMethodBody responseBody = methodRegistry.createConnectionCloseBody(AMQConstant.NOT_ALLOWED.getCode(),    // replyCode
                                                                 msg,               // replytext
                                                                 body.getClazz(),
                                                                 body.getMethod());
                        protocolConnection.writeFrame(responseBody.generateFrame(0));
                    }

                }
                catch (org.apache.qpid.AMQInvalidArgumentException ise)
                {
                    _logger.debug("Closing connection due to invalid selector");

                    MethodRegistry methodRegistry = protocolConnection.getMethodRegistry();
                    AMQMethodBody responseBody = methodRegistry.createChannelCloseBody(AMQConstant.ARGUMENT_INVALID.getCode(),
                                                                                       new AMQShortString(ise.getMessage()),
                                                                                       body.getClazz(),
                                                                                       body.getMethod());
                    protocolConnection.writeFrame(responseBody.generateFrame(channelId));


                }
                catch (AMQQueue.ExistingExclusiveSubscription e)
                {
View Full Code Here

Examples of org.apache.qpid.framing.AMQMethodBody

        {
            _log.info("Binding queue " + queue + " to exchange " + exch + " with routing key " + routingKey);
        }

        final MethodRegistry registry = session.getMethodRegistry();
        final AMQMethodBody responseBody;
        if (registry instanceof MethodRegistry_0_9)
        {
            responseBody = ((MethodRegistry_0_9)registry).createQueueUnbindOkBody();
        }
        else if (registry instanceof MethodRegistry_0_91)
        {
            responseBody = ((MethodRegistry_0_91)registry).createQueueUnbindOkBody();
        }
        else
        {
            // 0-8 does not support QueueUnbind
            throw new AMQException(AMQConstant.COMMAND_INVALID, "QueueUnbind not present in AMQP version: " + session.getProtocolVersion(), null);
        }
        channel.sync();
        session.writeFrame(responseBody.generateFrame(channelId));
    }
View Full Code Here

Examples of org.apache.qpid.framing.AMQMethodBody

        }
        if (!body.getNowait())
        {
            channel.sync();
            MethodRegistry methodRegistry = protocolConnection.getMethodRegistry();
            AMQMethodBody responseBody = methodRegistry.createQueueBindOkBody();
            protocolConnection.writeFrame(responseBody.generateFrame(channelId));

        }
    }
View Full Code Here

Examples of org.apache.qpid.framing.AMQMethodBody

                if(!body.getNowait())
                {
                    channel.sync();
                    MethodRegistry methodRegistry = protocolConnection.getMethodRegistry();
                    AMQMethodBody responseBody = methodRegistry.createQueuePurgeOkBody(purged);
                    protocolConnection.writeFrame(responseBody.generateFrame(channelId));

                }
        }
    }
View Full Code Here

Examples of org.apache.qpid.framing.AMQMethodBody


        if(!body.getNowait())
        {
            MethodRegistry methodRegistry = session.getMethodRegistry();
            AMQMethodBody responseBody = methodRegistry.createExchangeDeclareOkBody();
            channel.sync();
            session.writeFrame(responseBody.generateFrame(channelId));
        }
    }
View Full Code Here

Examples of org.apache.qpid.framing.AMQMethodBody

            serverProperties.setString(ServerPropertyNames.QPID_INSTANCE_NAME,
                    _broker.getName());
            serverProperties.setString(ConnectionStartProperties.QPID_CLOSE_WHEN_NO_ROUTE,
                    String.valueOf(_closeWhenNoRoute));

            AMQMethodBody responseBody = getMethodRegistry().createConnectionStartBody((short) getProtocolMajorVersion(),
                                                                                       (short) pv.getActualMinorVersion(),
                                                                                       serverProperties,
                                                                                       mechanisms.getBytes(),
                                                                                       locales.getBytes());
            _sender.send(asByteBuffer(responseBody.generateFrame(0)));
            _sender.flush();

        }
        catch (AMQException e)
        {
View Full Code Here

Examples of org.apache.qpid.framing.AMQMethodBody

    }

    private void flow(boolean flow)
    {
        MethodRegistry methodRegistry = _session.getMethodRegistry();
        AMQMethodBody responseBody = methodRegistry.createChannelFlowBody(flow);
        _session.writeFrame(responseBody.generateFrame(_channelId));
    }
View Full Code Here

Examples of org.apache.qpid.framing.AMQMethodBody

                if(!body.getNowait())
                {

                    MethodRegistry methodRegistry = session.getMethodRegistry();
                    AMQMethodBody responseBody = methodRegistry.createQueuePurgeOkBody(purged);
                    session.writeFrame(responseBody.generateFrame(channelId));
                   
                }
        }
    }
View Full Code Here

Examples of org.apache.qpid.framing.AMQMethodBody

     *
     * @return <tt>true</tt> if this listener has handled the method, <tt>false</tt> otherwise.
     */
    public boolean methodReceived(AMQMethodEvent evt) // throws AMQException
    {
        AMQMethodBody method = evt.getMethod();

        /*try
        {*/
        boolean ready = (evt.getChannelId() == _channelId) && processMethod(evt.getChannelId(), method);

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.