Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.ActiveMQTextMessage


     * @return an ActiveMQTextMessage
     * @throws JMSException if the JMS provider fails to create this message due to some internal error.
     */
    public TextMessage createTextMessage() throws JMSException {
        checkClosed();
        return new ActiveMQTextMessage();
    }
View Full Code Here


     * @return an ActiveMQTextMessage
     * @throws JMSException if the JMS provider fails to create this message due to some internal error.
     */
    public TextMessage createTextMessage(String text) throws JMSException {
        checkClosed();
        ActiveMQTextMessage msg = new ActiveMQTextMessage();
        msg.setText(text);
        return msg;
    }
View Full Code Here

*/
public class JabberWireFormatTest extends TestCase {
    protected WireFormat format = new JabberWireFormat();

    public void testWrite() throws Exception {
        ActiveMQTextMessage message = new ActiveMQTextMessage();
        message.setJMSType("id");
        message.setJMSReplyTo(new ActiveMQTopic("my.source"));
        message.setJMSDestination(new ActiveMQTopic("my.target"));
        message.setJMSCorrelationID("abc123");
        message.setText("<body>hello there </body>");

        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(buffer);
        format.writePacket(message, out);
        out.close();
View Full Code Here

    /**
     * @throws Exception
     */
    public void testSendReceive() throws Exception {
        for (int i = 0;i < MESSAGE_COUNT;i++) {
            TextMessage textMessage = new ActiveMQTextMessage();
            textMessage.setText("MSG-NO:" + i);
            for (int x = 0;x < producers.length;x++) {
                producers[x].send(textMessage);
            }
        }
        synchronized (receivedMessageCount) {
View Full Code Here

        }
        return messages[i];
    }

    protected ActiveMQMessage createMessage(int i) throws JMSException {
        ActiveMQTextMessage answer = new ActiveMQTextMessage();
        answer.setJMSMessageID(idGenerator.generateId());
        answer.setJMSClientID(getClientID());
        answer.setJMSDestination(destination);
        answer.setText("message index: " + i);
        return answer;
    }
View Full Code Here

        message.setJMSMessageID(id);
        messageIdenties[i] = container.addMessage(message);
    }

    protected void readMessage(int i) throws JMSException {
        ActiveMQTextMessage message = (ActiveMQTextMessage) container.getMessage(messageIdenties[i]);
        assertTrue("Message should not be null", message != null);

        String text = message.getText();
        assertEquals("Message text should be equal", messageTexts[i], text);
    }
View Full Code Here

        ActiveMQMessage message = container.getMessage(messageIdenties[i]);
        assertTrue("Message should be null", message == null);
    }

    protected ActiveMQMessage createMessage(int i) throws JMSException {
        ActiveMQTextMessage answer = new ActiveMQTextMessage();
        String text = "Message: " + i;
        messageTexts[i] = text;
        answer.setText(text);
        return answer;
    }
View Full Code Here

        answer.addPostCommitTask(new SendMessageTransactionTask(null, createMessage()));
        return answer;
    }

    protected ActiveMQMessage createMessage() throws JMSException {
        ActiveMQTextMessage answer = new ActiveMQTextMessage();
        answer.setJMSMessageID("abc:123");
        answer.setText("I'm a test message!");
        return answer;
    }
View Full Code Here

            tester.setLocalId(args[1]);           
        }
       
        tester.start();
       
        ActiveMQTextMessage message = new ActiveMQTextMessage();
        int counter = 0;
        while( true ) {
            message.setText("Message "+counter+" from "+tester.getLocalId());
            tester.send(message);
            counter++;
            Thread.sleep(1000);
        }
       
View Full Code Here

     * @return an ActiveMQTextMessage
     * @throws JMSException if the JMS provider fails to create this message due to some internal error.
     */
    public TextMessage createTextMessage() throws JMSException {
        checkClosed();
        return new ActiveMQTextMessage();
    }
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.message.ActiveMQTextMessage

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.