Search in sources :

Example 11 with ActiveMQTextMessage

use of org.apache.activemq.command.ActiveMQTextMessage in project activemq-artemis by apache.

the class ActiveMQTextMessageTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    ActiveMQTextMessage info = (ActiveMQTextMessage) object;
}
Also used : ActiveMQTextMessage(org.apache.activemq.command.ActiveMQTextMessage)

Example 12 with ActiveMQTextMessage

use of org.apache.activemq.command.ActiveMQTextMessage in project activemq-artemis by apache.

the class ActiveMQTextMessageTest method createObject.

@Override
public Object createObject() throws Exception {
    ActiveMQTextMessage info = new ActiveMQTextMessage();
    populateObject(info);
    return info;
}
Also used : ActiveMQTextMessage(org.apache.activemq.command.ActiveMQTextMessage)

Example 13 with ActiveMQTextMessage

use of org.apache.activemq.command.ActiveMQTextMessage in project activemq-artemis by apache.

the class ActiveMQTextMessageTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    ActiveMQTextMessage info = (ActiveMQTextMessage) object;
}
Also used : ActiveMQTextMessage(org.apache.activemq.command.ActiveMQTextMessage)

Example 14 with ActiveMQTextMessage

use of org.apache.activemq.command.ActiveMQTextMessage in project activemq-artemis by apache.

the class TopicClusterTest method testSendReceive.

@Test
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) {
        while (receivedMessageCount.get() < expectedReceiveCount()) {
            receivedMessageCount.wait(20000);
        }
    }
    // sleep a little - to check we don't get too many messages
    Thread.sleep(2000);
    LOG.info("GOT: " + receivedMessageCount.get() + " Expected: " + expectedReceiveCount());
    Assert.assertEquals("Expected message count not correct", expectedReceiveCount(), receivedMessageCount.get());
}
Also used : TextMessage(javax.jms.TextMessage) ActiveMQTextMessage(org.apache.activemq.command.ActiveMQTextMessage) ActiveMQTextMessage(org.apache.activemq.command.ActiveMQTextMessage) Test(org.junit.Test) OpenwireArtemisBaseTest(org.apache.activemq.broker.artemiswrapper.OpenwireArtemisBaseTest)

Example 15 with ActiveMQTextMessage

use of org.apache.activemq.command.ActiveMQTextMessage in project activemq-artemis by apache.

the class FailoverTransportBrokerTest method createMessage.

protected Message createMessage(ProducerInfo producerInfo, ActiveMQDestination destination) {
    ActiveMQTextMessage message = new ActiveMQTextMessage();
    message.setMessageId(new MessageId(producerInfo, ++msgIdGenerator));
    message.setDestination(destination);
    message.setPersistent(false);
    try {
        message.setText("Test Message Payload.");
    } catch (MessageNotWriteableException e) {
    }
    return message;
}
Also used : MessageNotWriteableException(javax.jms.MessageNotWriteableException) ActiveMQTextMessage(org.apache.activemq.command.ActiveMQTextMessage) MessageId(org.apache.activemq.command.MessageId)

Aggregations

ActiveMQTextMessage (org.apache.activemq.command.ActiveMQTextMessage)71 Test (org.junit.Test)36 TextMessage (javax.jms.TextMessage)16 ActiveMQQueue (org.apache.activemq.command.ActiveMQQueue)14 Message (javax.jms.Message)10 MessageProducer (javax.jms.MessageProducer)10 MessageConsumer (javax.jms.MessageConsumer)9 MessageId (org.apache.activemq.command.MessageId)9 JMSException (javax.jms.JMSException)7 ActiveMQBytesMessage (org.apache.activemq.command.ActiveMQBytesMessage)7 DestinationStatistics (org.apache.activemq.broker.region.DestinationStatistics)6 MessageReference (org.apache.activemq.broker.region.MessageReference)6 Queue (org.apache.activemq.broker.region.Queue)6 ActiveMQMapMessage (org.apache.activemq.command.ActiveMQMapMessage)6 ActiveMQObjectMessage (org.apache.activemq.command.ActiveMQObjectMessage)6 ActiveMQStreamMessage (org.apache.activemq.command.ActiveMQStreamMessage)6 ConsumerInfo (org.apache.activemq.command.ConsumerInfo)6 SystemUsage (org.apache.activemq.usage.SystemUsage)6 MutableSpan (brave.handler.MutableSpan)5 MessageNotWriteableException (javax.jms.MessageNotWriteableException)5