Package org.apache.qpid.framing

Examples of org.apache.qpid.framing.BasicPublishBody


     * @param queues the list of queues
     * @throws NoConsumersException
     */
    static void deliver(int count, List<AMQQueue> queues) throws AMQException
    {
        BasicPublishBody publish = new BasicPublishBody();
        publish.exchange = new NullExchange().getName();
        ContentHeaderBody header = new ContentHeaderBody();
        List<ContentBody> body = new ArrayList<ContentBody>();
        MessageStore messageStore = new SkeletonMessageStore();
        // channel can be null since it is only used in ack processing which does not apply to this test
View Full Code Here


    void sendMessage(AMQDestination destination, Message origMessage, AbstractJMSMessage message,
                     UUID messageId, int deliveryMode,int priority, long timeToLive, boolean mandatory,
                     boolean immediate, boolean wait) throws JMSException
    {
        BasicPublishBody body = getSession().getMethodRegistry().createBasicPublishBody(_session.getTicket(),
                                                                                        destination.getExchangeName(),
                                                                                        destination.getRoutingKey(),
                                                                                        mandatory,
                                                                                        immediate);

        AMQFrame publishFrame = body.generateFrame(_channelId);

        message.prepareForSending();
        ByteBuffer payload = message.getData();
        AMQMessageDelegate_0_8 delegate = (AMQMessageDelegate_0_8) message.getDelegate();
        BasicContentHeaderProperties contentHeaderProperties = delegate.getContentHeaderProperties();
View Full Code Here

    void sendMessage(AMQDestination destination, Message origMessage, AbstractJMSMessage message,
                     UUID messageId, int deliveryMode,int priority, long timeToLive, boolean mandatory,
                     boolean immediate) throws JMSException
    {
        BasicPublishBody body = getSession().getMethodRegistry().createBasicPublishBody(_session.getTicket(),
                                                                                        destination.getExchangeName(),
                                                                                        destination.getRoutingKey(),
                                                                                        mandatory,
                                                                                        immediate);

        AMQFrame publishFrame = body.generateFrame(_channelId);

        message.prepareForSending();
        ByteBuffer payload = message.getData();
        AMQMessageDelegate_0_8 delegate = (AMQMessageDelegate_0_8) message.getDelegate();
        BasicContentHeaderProperties contentHeaderProperties = delegate.getContentHeaderProperties();
View Full Code Here

    }


    public MessagePublishInfo convertToInfo(AMQMethodBody methodBody)
    {
        final BasicPublishBody publishBody = ((BasicPublishBody) methodBody);

        final AMQShortString exchange = publishBody.getExchange();
        final AMQShortString routingKey = publishBody.getRoutingKey();

        return new MessagePublishInfoImpl(exchange,
                                          publishBody.getImmediate(),
                                          publishBody.getMandatory(),
                                          routingKey);

    }
View Full Code Here

    }


    public MessagePublishInfo convertToInfo(AMQMethodBody methodBody)
    {
        final BasicPublishBody publishBody = ((BasicPublishBody) methodBody);

        final AMQShortString exchange = publishBody.getExchange();
        final AMQShortString routingKey = publishBody.getRoutingKey();

        return new MessagePublishInfoImpl(exchange == null ? null : exchange.intern(),
                                          publishBody.getImmediate(),
                                          publishBody.getMandatory(),
                                          routingKey == null ? null : routingKey.intern(false));

    }
View Full Code Here

    }


    public MessagePublishInfo convertToInfo(AMQMethodBody methodBody)
    {
        final BasicPublishBody publishBody = ((BasicPublishBody) methodBody);

        final AMQShortString exchange = publishBody.getExchange();
        final AMQShortString routingKey = publishBody.getRoutingKey();

        return new MessagePublishInfoImpl(exchange,
                                          publishBody.getImmediate(),
                                          publishBody.getMandatory(),
                                          routingKey);

    }
View Full Code Here

    public void methodReceived(AMQStateManager stateManager, QueueRegistry queueRegistry,
                               ExchangeRegistry exchangeRegistry, AMQProtocolSession protocolSession,
                               AMQMethodEvent<BasicPublishBody> evt) throws AMQException
    {
        final BasicPublishBody body = evt.getMethod();

        // TODO: check the delivery tag field details - is it unique across the broker or per subscriber?
        if (body.exchange == null)
        {
            body.exchange = "amq.direct";
View Full Code Here

     * @param queues the list of queues
     * @throws NoConsumersException
     */
    static void deliver(int count, List<AMQQueue> queues) throws AMQException
    {
        BasicPublishBody publish = new BasicPublishBody();
        publish.exchange = new NullExchange().getName();
        ContentHeaderBody header = new ContentHeaderBody();
        List<ContentBody> body = new ArrayList<ContentBody>();
        MessageStore messageStore = new SkeletonMessageStore();
        body.add(new ContentBody());
View Full Code Here

    private void publishMessages(int count, boolean persistent) throws AMQException
    {
        for (int i = 1; i <= count; i++)
        {
            BasicPublishBody publishBody = new BasicPublishBody();
            publishBody.routingKey = "rk";
            publishBody.exchange = "someExchange";
            AMQMessage msg = new AMQMessage(_messageStore, publishBody);
            if (persistent)
            {
View Full Code Here

        return message(false);
    }

    AMQMessage message(boolean immediate) throws AMQException
    {
        BasicPublishBody publish = new BasicPublishBody();
        publish.immediate = immediate;
        return new AMQMessage(_messageStore, publish, new ContentHeaderBody(), null);
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.framing.BasicPublishBody

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.