This closes #1169
This commit is contained in:
commit
5adce230a3
|
@ -1,4 +1,4 @@
|
||||||
<!-- The web server is only bound to loalhost by default -->
|
<!-- The web server is only bound to loalhost by default -->
|
||||||
<web bind="${web.protocol}://${http.host}:${http.port}" path="web"${extra.web.attributes}>
|
<web bind="${web.protocol}://${http.host}:${http.port}" path="web"${extra.web.attributes}>
|
||||||
<app url="jolokia" war="jolokia-war-1.3.5.war"/>
|
<app url="jolokia" war="jolokia.war"/>
|
||||||
</web>
|
</web>
|
||||||
|
|
|
@ -139,6 +139,7 @@
|
||||||
</includes>
|
</includes>
|
||||||
<outputDirectory>web</outputDirectory>
|
<outputDirectory>web</outputDirectory>
|
||||||
<unpack>false</unpack>
|
<unpack>false</unpack>
|
||||||
|
<outputFileNameMapping>jolokia.war</outputFileNameMapping>
|
||||||
</dependencySet>
|
</dependencySet>
|
||||||
</dependencySets>
|
</dependencySets>
|
||||||
<fileSets>
|
<fileSets>
|
||||||
|
|
|
@ -402,7 +402,7 @@ public class AMQPMessage extends RefCountMessage {
|
||||||
if (section instanceof Properties) {
|
if (section instanceof Properties) {
|
||||||
_properties = (Properties) section;
|
_properties = (Properties) section;
|
||||||
|
|
||||||
if (_properties.getAbsoluteExpiryTime() != null) {
|
if (_properties.getAbsoluteExpiryTime() != null && _properties.getAbsoluteExpiryTime().getTime() > 0) {
|
||||||
this.expiration = _properties.getAbsoluteExpiryTime().getTime();
|
this.expiration = _properties.getAbsoluteExpiryTime().getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,41 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport {
|
||||||
connection.close();
|
connection.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(timeout = 60000)
|
||||||
|
public void testSendMessageThatIsExpiredUsingTTLWhenAbsoluteIsZero() throws Exception {
|
||||||
|
AmqpClient client = createAmqpClient();
|
||||||
|
AmqpConnection connection = addConnection(client.connect());
|
||||||
|
AmqpSession session = connection.createSession();
|
||||||
|
|
||||||
|
AmqpSender sender = session.createSender(getTestName());
|
||||||
|
|
||||||
|
// Get the Queue View early to avoid racing the delivery.
|
||||||
|
final Queue queueView = getProxyToQueue(getTestName());
|
||||||
|
assertNotNull(queueView);
|
||||||
|
|
||||||
|
AmqpMessage message = new AmqpMessage();
|
||||||
|
message.setAbsoluteExpiryTime(0);
|
||||||
|
// AET should override any TTL set
|
||||||
|
message.setTimeToLive(1000);
|
||||||
|
message.setText("Test-Message");
|
||||||
|
sender.send(message);
|
||||||
|
sender.close();
|
||||||
|
|
||||||
|
assertEquals(1, queueView.getMessageCount());
|
||||||
|
|
||||||
|
Thread.sleep(1000);
|
||||||
|
|
||||||
|
// Now try and get the message
|
||||||
|
AmqpReceiver receiver = session.createReceiver(getTestName());
|
||||||
|
receiver.flow(1);
|
||||||
|
AmqpMessage received = receiver.receive(1, TimeUnit.SECONDS);
|
||||||
|
assertNull(received);
|
||||||
|
|
||||||
|
assertEquals(1, queueView.getMessagesExpired());
|
||||||
|
|
||||||
|
connection.close();
|
||||||
|
}
|
||||||
|
|
||||||
@Test(timeout = 60000)
|
@Test(timeout = 60000)
|
||||||
public void testSendMessageThatIsNotExpiredUsingAbsoluteTimeWithElspsedTTL() throws Exception {
|
public void testSendMessageThatIsNotExpiredUsingAbsoluteTimeWithElspsedTTL() throws Exception {
|
||||||
AmqpClient client = createAmqpClient();
|
AmqpClient client = createAmqpClient();
|
||||||
|
|
Loading…
Reference in New Issue