Package com.swiftmq.amqp.v100.generated.messaging.message_format

Examples of com.swiftmq.amqp.v100.generated.messaging.message_format.AmqpValue


        AMQPContext ctx = new AMQPContext(AMQPContext.CLIENT);
        Connection conn = new Connection(ctx, host, port, false);
        conn.connect();
        Session s = conn.createSession(INBOUND_WINDOW, OUTBOUND_WINDOW);
        Consumer c = s.createConsumer(q, CONSUMER_LINK_CREDIT, QoS.AT_MOST_ONCE, false, null);
        AMQPMessage m;
        while ((m = get(c)) != null);
        conn.close();
    }
View Full Code Here


        conn.connect();
        Session s = conn.createSession(INBOUND_WINDOW, OUTBOUND_WINDOW);

        Consumer c = s.createConsumer(consumerSource, CONSUMER_LINK_CREDIT, QoS.AT_LEAST_ONCE, false, null);
        Producer p = s.createProducer(producerTarget, QoS.AT_LEAST_ONCE);
        AMQPMessage msg = msg();
        AmqpValue sentinel = new AmqpValue(new AMQPDouble(Math.random()));
        msg.setAmqpValue(sentinel);
        Properties props = new Properties();
        props.setSubject(new AMQPString(routingKey));
        msg.setProperties(props);
        p.send(msg);

        if (succeed) {
            AMQPMessage m = c.receive();
            assertNotNull(m);
            assertEquals(sentinel.getValue().getValueString(), m.getAmqpValue().getValue().getValueString());
            m.accept();
        } else {
            assertNull(get(c));
        }
        c.close();
        p.close();
View Full Code Here

        AMQPContext ctx = new AMQPContext(AMQPContext.CLIENT);
        Connection conn = new Connection(ctx, host, port, false);
        conn.connect();
        Session s = conn.createSession(INBOUND_WINDOW, OUTBOUND_WINDOW);
        Producer p = s.createProducer(QUEUE, QoS.AT_LEAST_ONCE);
        AMQPMessage msg = msg();

        d.decorateMessage(msg, map);
        p.send(msg);
        p.close();
        Consumer c = s.createConsumer(QUEUE, CONSUMER_LINK_CREDIT, QoS.AT_LEAST_ONCE, false, null);
        AMQPMessage recvMsg = c.receive();
        recvMsg.accept();

        compareMaps(map, d.getDecoration(recvMsg));
        conn.close();
    }
View Full Code Here

                Session session = connection.createSession(10, 10);
                Producer p = session.createProducer(queue, qos);
                for (int i = 0; i < nMsgs; i++) {
                    AMQPMessage msg = new AMQPMessage();
                    System.out.println("Sending " + i);
                    msg.setAmqpValue(new AmqpValue(new AMQPString(String.format(dataFormat, i))));
                    p.send(msg);
                }
                p.close();
                session.close();
            }
View Full Code Here

                // Receive messages non-transacted
                int i = 0;
                while ( i < nMsgs) {
                    AMQPMessage msg = c.receive();
                    if( msg!=null ) {
                        final AMQPType value = msg.getAmqpValue().getValue();
                        if (value instanceof AMQPString) {
                            String s = ((AMQPString) value).getValue();
                            assertEquals(String.format(dataFormat, i), s);
                            System.out.println("Received: " + i);
                        }
View Full Code Here

TOP

Related Classes of com.swiftmq.amqp.v100.generated.messaging.message_format.AmqpValue

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.