Package org.activemq.message

Examples of org.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 JabberWireFormat 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("hello there");

        StringWriter buffer = new StringWriter();
        PrintWriter out = new PrintWriter(buffer);
        format.setWriter(out);
        format.writePacket(message, null);
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

     * @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

        writer.println("  id='" + clientID + "'>");
        writer.flush();
   }

    protected Packet readMessage(XMLStreamReader reader) throws XMLStreamException, JMSException {
        ActiveMQTextMessage message = new ActiveMQTextMessage();
        message.setJMSMessageID(idGenerator.generateId());
        QName name = reader.getName();
        String to = getAttributeValue("to", reader);
        String type = getAttributeValue("type",reader);
              
        if (type != null){
            message.setJMSType(type);
        }
              
        if (to != null && to.length() > 0) {
            message.setJMSDestination(createDestination(type,to));
        }
       
        if (this.userName != null && this.userName .length() > 0) {
            message.setJMSReplyTo(createDestination("chat",this.userName));
        }

        while (reader.hasNext()) {
            switch (reader.nextTag()) {
                case XMLStreamConstants.START_ELEMENT:
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

*/
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

            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

TOP

Related Classes of org.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.