Search in sources :

Example 21 with DeliveryProperties

use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties in project qpid-broker-j by apache.

the class PropertyConverter_0_10_to_0_8Test method testDiscardUnroutableTrueConversion.

public void testDiscardUnroutableTrueConversion() {
    final boolean discardUnroutable = true;
    final DeliveryProperties deliveryProperties = new DeliveryProperties();
    deliveryProperties.setDiscardUnroutable(discardUnroutable);
    MessageTransferMessage message = createTestMessage(deliveryProperties);
    final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    MessagePublishInfo messagePublishInfo = convertedMessage.getMessagePublishInfo();
    assertEquals("Unexpected mandatory flag", !discardUnroutable, messagePublishInfo.isMandatory());
}
Also used : MessagePublishInfo(org.apache.qpid.server.protocol.v0_8.transport.MessagePublishInfo) MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 22 with DeliveryProperties

use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties in project qpid-broker-j by apache.

the class PropertyConverter_0_8_to_0_10Test method testPublishInfoRoutingKeyConversion.

public void testPublishInfoRoutingKeyConversion() {
    final String testRoutingKey = "testRoutingKey";
    AMQMessage message = createTestMessage(new BasicContentHeaderProperties());
    message.getMessagePublishInfo().setRoutingKey(AMQShortString.valueOf(testRoutingKey));
    final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    final DeliveryProperties deliveryProperties = convertedMessage.getStoredMessage().getMetaData().getDeliveryProperties();
    assertEquals("Unexpected routing-key", testRoutingKey, deliveryProperties.getRoutingKey());
}
Also used : MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) AMQShortString(org.apache.qpid.server.protocol.v0_8.AMQShortString) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 23 with DeliveryProperties

use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties in project qpid-broker-j by apache.

the class PropertyConverter_0_8_to_0_10Test method testPriorityConversion.

public void testPriorityConversion() {
    BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
    final byte priority = 5;
    basicContentHeaderProperties.setPriority(priority);
    AMQMessage message = createTestMessage(basicContentHeaderProperties);
    final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    final DeliveryProperties deliveryProperties = convertedMessage.getStoredMessage().getMetaData().getDeliveryProperties();
    assertEquals("Unexpected priority", priority, deliveryProperties.getPriority().getValue());
}
Also used : MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 24 with DeliveryProperties

use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties in project qpid-broker-j by apache.

the class PropertyConverter_0_8_to_0_10Test method testExpirationConversion.

public void testExpirationConversion() {
    BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
    long timestamp = System.currentTimeMillis();
    int ttl = 100000;
    final long expiration = timestamp + ttl;
    basicContentHeaderProperties.setExpiration(expiration);
    basicContentHeaderProperties.setTimestamp(timestamp);
    AMQMessage message = createTestMessage(basicContentHeaderProperties, timestamp);
    final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    final DeliveryProperties deliveryProperties = convertedMessage.getStoredMessage().getMetaData().getDeliveryProperties();
    assertEquals("Unexpected TTL", ttl, deliveryProperties.getTtl());
    assertEquals("Unexpected expiration", expiration, deliveryProperties.getExpiration());
}
Also used : MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 25 with DeliveryProperties

use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties in project qpid-broker-j by apache.

the class PropertyConverter_0_8_to_0_10Test method testTimestampConversion.

public void testTimestampConversion() {
    BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
    final long timestamp = System.currentTimeMillis() - 10000;
    basicContentHeaderProperties.setTimestamp(timestamp);
    AMQMessage message = createTestMessage(basicContentHeaderProperties);
    final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    final DeliveryProperties deliveryProperties = convertedMessage.getStoredMessage().getMetaData().getDeliveryProperties();
    assertEquals("Unexpected timestamp", timestamp, deliveryProperties.getTimestamp());
}
Also used : MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Aggregations

DeliveryProperties (org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties)81 MessageTransferMessage (org.apache.qpid.server.protocol.v0_10.MessageTransferMessage)54 MessageProperties (org.apache.qpid.server.protocol.v0_10.transport.MessageProperties)39 Message_1_0 (org.apache.qpid.server.protocol.v1_0.Message_1_0)27 AMQMessage (org.apache.qpid.server.protocol.v0_8.AMQMessage)25 BasicContentHeaderProperties (org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties)21 Properties (org.apache.qpid.server.protocol.v1_0.type.messaging.Properties)20 InternalMessage (org.apache.qpid.server.message.internal.InternalMessage)17 Header (org.apache.qpid.server.protocol.v1_0.type.messaging.Header)16 Matchers.anyString (org.mockito.Matchers.anyString)16 AMQShortString (org.apache.qpid.server.protocol.v0_8.AMQShortString)14 ApplicationProperties (org.apache.qpid.server.protocol.v1_0.type.messaging.ApplicationProperties)14 Header (org.apache.qpid.server.protocol.v0_10.transport.Header)10 MessagePublishInfo (org.apache.qpid.server.protocol.v0_8.transport.MessagePublishInfo)7 Date (java.util.Date)5 MessageAnnotations (org.apache.qpid.server.protocol.v1_0.type.messaging.MessageAnnotations)5 MessageMetaData_0_10 (org.apache.qpid.server.protocol.v0_10.MessageMetaData_0_10)4 MessageDeliveryMode (org.apache.qpid.server.protocol.v0_10.transport.MessageDeliveryMode)4 DeliveryAnnotations (org.apache.qpid.server.protocol.v1_0.type.messaging.DeliveryAnnotations)4 Method (org.apache.qpid.server.protocol.v0_10.transport.Method)3