org.apache.activemq.command.ActiveMQStreamMessage

Here are the examples of the java api class org.apache.activemq.command.ActiveMQStreamMessage taken from open source projects.

1. CompressionOverNetworkTest#testStreamMessageCompression()

View license
@Test
public void testStreamMessageCompression() throws Exception {
    MessageConsumer consumer1 = remoteSession.createConsumer(included);
    MessageProducer producer = localSession.createProducer(included);
    producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
    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);
    ActiveMQStreamMessage message = (ActiveMQStreamMessage) msg;
    assertTrue(message.isCompressed());
    for (int i = 0; i < 100; ++i) {
        assertEquals("test string: " + i, message.readString());
    }
}

2. ActiveMQStreamMessageTest#createObject()

View license
@Override
public Object createObject() throws Exception {
    ActiveMQStreamMessage info = new ActiveMQStreamMessage();
    populateObject(info);
    return info;
}

3. ActiveMQStreamMessageTest#populateObject()

View license
@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    ActiveMQStreamMessage info = (ActiveMQStreamMessage) object;
}

4. ActiveMQStreamMessageTest#createObject()

View license
@Override
public Object createObject() throws Exception {
    ActiveMQStreamMessage info = new ActiveMQStreamMessage();
    populateObject(info);
    return info;
}

5. ActiveMQStreamMessageTest#populateObject()

View license
@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    ActiveMQStreamMessage info = (ActiveMQStreamMessage) object;
}