vttranlina commented on a change in pull request #841:
URL: https://github.com/apache/james-project/pull/841#discussion_r783843162
##########
File path:
event-bus/distributed/src/test/java/org/apache/james/events/RabbitMQEventBusTest.java
##########
@@ -414,6 +415,34 @@ void
dispatchShouldPublishSerializedEventToRabbitMQWhenNotBlocking() {
assertThat(dequeueEvent()).isEqualTo(EVENT);
}
+ @Test
+ void messageShouldPresentWhenTTLNotExpired() {
+ Sender sender = rabbitMQExtension.getSender();
+ sender.delete(QueueSpecification.queue(WORK_QUEUE_NAME))
+ .block();
+ String ttlQueue = "test-ttl";
+
+ sender.declareQueue(QueueSpecification.queue(ttlQueue)
+ .durable(DURABLE)
+ .exclusive(false)
+ .autoDelete(false)
+
.arguments(QueueArguments.builder().queueTTL(100000).build()))
+ .block();
+ sender.bind(BindingSpecification.binding()
+ .exchange(TEST_NAMING_STRATEGY.exchange())
+ .queue(ttlQueue)
+ .routingKey(EMPTY_ROUTING_KEY))
+ .block();
+
+ eventBus.dispatch(EVENT, NO_KEYS).block();
+
+ byte[] messageBody =
rabbitMQExtension.getReceiverProvider().createReceiver().consumeAutoAck(ttlQueue)
+ .blockFirst()
+ .getBody();
+
+ assertThat(eventSerializer.asEvent(new String(messageBody,
StandardCharsets.UTF_8))).isEqualTo(EVENT);
+ }
Review comment:
I want to validate the TTL configure.
But It looks like not necessary
I will remove it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]