Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6A624200C4B for ; Mon, 20 Mar 2017 23:17:54 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 675AB160B76; Mon, 20 Mar 2017 22:17:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B034C160B71 for ; Mon, 20 Mar 2017 23:17:53 +0100 (CET) Received: (qmail 69972 invoked by uid 500); 20 Mar 2017 22:17:52 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 69961 invoked by uid 99); 20 Mar 2017 22:17:52 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Mar 2017 22:17:52 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6D074DFDC8; Mon, 20 Mar 2017 22:17:52 +0000 (UTC) From: jdanekrh To: dev@activemq.apache.org Reply-To: dev@activemq.apache.org References: In-Reply-To: Subject: [GitHub] activemq-artemis pull request #1110: Fixing expiry on AMQP Content-Type: text/plain Message-Id: <20170320221752.6D074DFDC8@git1-us-west.apache.org> Date: Mon, 20 Mar 2017 22:17:52 +0000 (UTC) archived-at: Mon, 20 Mar 2017 22:17:54 -0000 Github user jdanekrh commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/1110#discussion_r107030877 --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SendingAndReceivingTest.java --- @@ -91,6 +95,45 @@ public void testSendingBigMessage() throws Exception { } } + @Test(timeout = 60000) + public void testSendMessageThenAllowToExpireUsingTimeToLive() throws Exception { + AddressSettings as = new AddressSettings(); + as.setExpiryAddress(SimpleString.toSimpleString("DLQ")); + HierarchicalRepository repos = server.getAddressSettingsRepository(); + repos.addMatch("exampleQueue", as); + + Connection connection = null; + ConnectionFactory connectionFactory = new JmsConnectionFactory("amqp://localhost:61616"); + + try { + connection = connectionFactory.createConnection(); + Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + String address = "exampleQueue"; + Queue queue = session.createQueue(address); + + MessageProducer sender = session.createProducer(queue); + sender.setTimeToLive(10); + + Message message = session.createMessage(); + sender.send(message); + connection.start(); + + MessageConsumer consumer = session.createConsumer(queue); + Message m = consumer.receive(5000); --- End diff -- there must be a way to not to spend 5s waiting here --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---