Package org.apache.qpid.proton.jms

Examples of org.apache.qpid.proton.jms.EncodedMessage


      //presettle means we can ack the message on the proton side before we send it, i.e. for browsers
      boolean preSettle = sender.getRemoteSenderSettleMode() == SenderSettleMode.SETTLED;
      //we only need a tag if we are going to ack later
      byte[] tag = preSettle ? new byte[0] : protonSession.getTag();
      //encode the message
      EncodedMessage encodedMessage = ProtonUtils.OUTBOUND.transform(message, deliveryCount);
      //now handle the delivery
      protonProtocolManager.handleDelivery(sender, tag, encodedMessage, message, connection, preSettle);

      return encodedMessage.getLength();
   }
View Full Code Here


         {
            buffer = ByteBuffer.wrap(new byte[1024 * 4 + overflow.position()]);
            c = protonMessage.encode(new WritableBuffer.ByteBufferWrapper(buffer));
         }

         return new EncodedMessage(messageFormat, buffer.array(), 0, c);
      }
View Full Code Here

         }
         receiver.advance();
         byte[] bytes = new byte[buffer.readableBytes()];
         buffer.readBytes(bytes);
         buffer.clear();
         EncodedMessage encodedMessage = new EncodedMessage(delivery.getMessageFormat(), bytes, 0, bytes.length);
         ServerMessage message = ProtonUtils.INBOUND.transform(connection, encodedMessage);
         //use the address on the receiver if not null, if null let's hope it was set correctly on the message
         if (address != null)
         {
            message.setAddress(new SimpleString(address));
View Full Code Here

         }
         receiver.advance();
         byte[] bytes = new byte[buffer.readableBytes()];
         buffer.readBytes(bytes);
         buffer.clear();
         EncodedMessage encodedMessage = new EncodedMessage(delivery.getMessageFormat(), bytes, 0, bytes.length);
         ServerMessage message = ProtonUtils.INBOUND.transform(connection, encodedMessage);
         //use the address on the receiver if not null, if null lets hope it was set correctly on the message
         if (address != null)
         {
            message.setAddress(new SimpleString(address));
View Full Code Here

      //presettle means we can ack the message on the proton side before we send it, i.e. for browsers
      boolean preSettle = sender.getRemoteSenderSettleMode() == SenderSettleMode.SETTLED;
      //we only need a tag if we are going to ack later
      byte[] tag = preSettle ? new byte[0] : protonSession.getTag();
      //encode the message
      EncodedMessage encodedMessage = ProtonUtils.OUTBOUND.transform(message, deliveryCount);
      //now handle the delivery
      protonProtocolManager.handleDelivery(sender, tag, encodedMessage, message, connection, preSettle);

      return encodedMessage.getLength();
   }
View Full Code Here

         {
            buffer = ByteBuffer.wrap(new byte[1024 * 4 + overflow.position()]);
            c = protonMessage.encode(new WritableBuffer.ByteBufferWrapper(buffer));
         }

         return new EncodedMessage(messageFormat, buffer.array(), 0, c);
      }
View Full Code Here

            this.destination = destination;
        }

        @Override
        protected void onMessage(final Receiver receiver, final Delivery delivery, Buffer buffer) throws Exception {
            EncodedMessage em = new EncodedMessage(delivery.getMessageFormat(), buffer.data, buffer.offset, buffer.length);
            final ActiveMQMessage message = (ActiveMQMessage) getInboundTransformer().transform(em);
            current = null;

            if (destination != null) {
                message.setJMSDestination(destination);
View Full Code Here

                        endOfBrowse = true;
                        drainCheck();
                    } else {
                        jms.setRedeliveryCounter(md.getRedeliveryCounter());
                        jms.setReadOnlyBody(true);
                        final EncodedMessage amqp = outboundTransformer.transform(jms);
                        if (amqp != null && amqp.getLength() > 0) {
                            currentBuffer = new Buffer(amqp.getArray(), amqp.getArrayOffset(), amqp.getLength());
                            if (presettle) {
                                currentDelivery = sender.delivery(EMPTY_BYTE_ARRAY, 0, 0);
                            } else {
                                final byte[] tag = nextTag();
                                currentDelivery = sender.delivery(tag, 0, tag.length);
View Full Code Here

                        endOfBrowse = true;
                        drainCheck();
                    } else {
                        jms.setRedeliveryCounter(md.getRedeliveryCounter());
                        jms.setReadOnlyBody(true);
                        final EncodedMessage amqp = outboundTransformer.transform(jms);
                        if (amqp != null && amqp.getLength() > 0) {
                            currentBuffer = new Buffer(amqp.getArray(), amqp.getArrayOffset(), amqp.getLength());
                            if (presettle) {
                                currentDelivery = sender.delivery(EMPTY_BYTE_ARRAY, 0, 0);
                            } else {
                                final byte[] tag = nextTag();
                                currentDelivery = sender.delivery(tag, 0, tag.length);
View Full Code Here

            this.destination = destination;
        }

        @Override
        protected void onMessage(final Receiver receiver, final Delivery delivery, Buffer buffer) throws Exception {
            EncodedMessage em = new EncodedMessage(delivery.getMessageFormat(), buffer.data, buffer.offset, buffer.length);
            final ActiveMQMessage message = (ActiveMQMessage) getInboundTransformer().transform(em);
            current = null;

            if (destination != null) {
                message.setJMSDestination(destination);
View Full Code Here

TOP

Related Classes of org.apache.qpid.proton.jms.EncodedMessage

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.