org.apache.activemq.command.ActiveMQObjectMessage

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

1. CompressionOverNetworkTest#testObjectMessageCompression()

View license
@Test
public void testObjectMessageCompression() throws Exception {
    MessageConsumer consumer1 = remoteSession.createConsumer(included);
    MessageProducer producer = localSession.createProducer(included);
    producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
    waitForConsumerRegistration(localBroker, 1, included);
    StringBuilder payload = new StringBuilder("test-");
    for (int i = 0; i < 100; ++i) {
        payload.append(UUID.randomUUID().toString());
    }
    Message test = localSession.createObjectMessage(payload.toString());
    producer.send(test);
    Message msg = consumer1.receive(RECEIVE_TIMEOUT_MILLS);
    assertNotNull(msg);
    ActiveMQObjectMessage message = (ActiveMQObjectMessage) msg;
    assertTrue(message.isCompressed());
    assertEquals(payload.toString(), message.getObject());
}

2. ActiveMQObjectMessageTest#createObject()

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

3. ActiveMQObjectMessageTest#populateObject()

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

4. ActiveMQObjectMessageTest#createObject()

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

5. ActiveMQObjectMessageTest#populateObject()

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