Package javax.jms

Examples of javax.jms.StreamMessage.writeString()


                {
                    StreamMessage sm = (StreamMessage) message;
                    try
                    {
                        sm.clearBody();
                        sm.writeString("dfgjshfslfjshflsjfdlsjfhdsljkfhdsljkfhsd");
                    }
                    catch (JMSException e)
                    {
                        _logger.error("Error when writing large string to received msg: " + e, e);
                        fail("Error when writing large string to received msg" + e);
View Full Code Here


        msg.writeInt(1234);
        msg.writeLong(1234567890);
        msg.writeObject(new Integer(444));
        msg.writeObject(null);
        msg.writeShort((short)123);
        msg.writeString("foobar");
       
        producer = session.createProducer(queue1);
        producer.send(msg,TestUtils.DELIVERY_MODE,3,0);
        session.commit();
        session.close();
View Full Code Here

        waitForConsumerRegistration(localBroker, 1, included);

        StreamMessage test = localSession.createStreamMessage();

        for (int i = 0; i < 100; ++i) {
            test.writeString("test string: " + i);
        }

        producer.send(test);
        Message msg = consumer1.receive(RECEIVE_TIMEOUT_MILLS);
        assertNotNull(msg);
View Full Code Here

        MessageProducer producer = session.createProducer(destination);

        // Send the message.
        {
            StreamMessage message = session.createStreamMessage();
            message.writeString("This is a test to see how it works.");
            producer.send(message);
        }

        // Check the message.
        {
View Full Code Here

                    final StreamMessage sm = (StreamMessage) message;
                    try
                    {
                        sm.clearBody();
                        // it is legal to extend a stream message's content
                        sm.writeString("dfgjshfslfjshflsjfdlsjfhdsljkfhdsljkfhsd");
                    }
                    catch (Throwable t)
                    {
                        listenerCaughtException.set(t);
                    }
View Full Code Here

    }

    public static StreamMessage newStreamMessage(Session session, int size) throws JMSException
    {
        StreamMessage message = session.createStreamMessage();
        message.writeString(createMessagePayload(size));
        return message;
    }

    public static ObjectMessage newObjectMessage(Session session, int size) throws JMSException
    {
View Full Code Here

                    final StreamMessage sm = (StreamMessage) message;
                    try
                    {
                        sm.clearBody();
                        // it is legal to extend a stream message's content
                        sm.writeString("dfgjshfslfjshflsjfdlsjfhdsljkfhdsljkfhsd");
                    }
                    catch (Throwable t)
                    {
                        listenerCaughtException.set(t);
                    }
View Full Code Here

    }

    public static StreamMessage newStreamMessage(Session session, int size) throws JMSException
    {
        StreamMessage message = session.createStreamMessage();
        message.writeString(createMessagePayload(size));
        return message;
    }

    public static ObjectMessage newObjectMessage(Session session, int size) throws JMSException
    {
View Full Code Here

                {
                    StreamMessage sm = (StreamMessage) message;
                    try
                    {
                        sm.clearBody();
                        sm.writeString("dfgjshfslfjshflsjfdlsjfhdsljkfhdsljkfhsd");
                    }
                    catch (JMSException e)
                    {
                        _logger.error("Error when writing large string to received msg: " + e, e);
                        fail("Error when writing large string to received msg" + e);
View Full Code Here

        waitForConsumerRegistration(localBroker, 1, included);

        StreamMessage test = localSession.createStreamMessage();

        for (int i = 0; i < 100; ++i) {
            test.writeString("test string: " + i);
        }

        producer.send(test);
        Message msg = consumer1.receive(RECEIVE_TIMEOUT_MILLS);
        assertNotNull(msg);
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.