Example #1
0
        ITextMessageCloak ITextMessageCloak.Copy()
        {
            ITextMessageCloak tcloak = new AMQPTextMessageCloak(connection);

            CopyInto(tcloak);
            return(tcloak);
        }
Example #2
0
        public virtual IMessageCloak Copy()
        {
            IMessageCloak copy = null;

            switch (JMSMessageType)
            {
            case MessageSupport.JMS_TYPE_MSG:
                copy = new AMQPMessageCloak(connection);
                break;

            case MessageSupport.JMS_TYPE_BYTE:
                copy = new AMQPBytesMessageCloak(connection);
                break;

            case MessageSupport.JMS_TYPE_TXT:
                copy = new AMQPTextMessageCloak(connection);
                break;

            case MessageSupport.JMS_TYPE_MAP:
                copy = new AMQPMapMessageCloak(connection);
                break;

            case MessageSupport.JMS_TYPE_STRM:
                copy = new AMQPStreamMessageCloak(connection);
                break;

            case MessageSupport.JMS_TYPE_OBJ:
                copy = new AMQPObjectMessageCloak(connection, (this as AMQPObjectMessageCloak).Type);
                break;

            default:
                throw new NMSException("Fatal error Invalid JMS type.");
            }

            CopyInto(copy);
            return(copy);
        }
Example #3
0
        private static IMessage CreateTextMessage(MessageConsumer consumer, Amqp.Message message)
        {
            ITextMessageCloak cloak = new AMQPTextMessageCloak(consumer, message);

            return(new TextMessage(cloak));
        }