/**
 * Copyright (c) 2015 Bosch Software Innovations GmbH and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.eclipse.hawkbit.amqp;

import java.util.HashMap;
import java.util.Map;

import org.springframework.amqp.core.Queue;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Bean which holds the necessary properties for configuring the AMQP deadletter
 * queue.
 */
@ConfigurationProperties("hawkbit.dmf.rabbitmq.deadLetter")
public class AmqpDeadletterProperties {

    /**
     * Message time to live (ttl) for the deadletter queue. Default ttl is 3
     * weeks.
     */
    private int ttl = 1_814_400_000;

    /**
     * Return the deadletter arguments.
     * 
     * @param exchange
     *            the deadletter exchange
     * @return map which holds the properties
     */
    public Map<String, Object> getDeadLetterExchangeArgs(final String exchange) {
        final Map<String, Object> args = new HashMap<>();
        args.put("x-dead-letter-exchange", exchange);
        return args;
    }

    /**
     * Create a deadletter queue with ttl for messages
     * 
     * @param queueName
     *            the deadlette queue name
     * @return the deadletter queue
     */
    public Queue createDeadletterQueue(final String queueName) {
        return new Queue(queueName, true, false, false, getTTLArgs());
    }

    private Map<String, Object> getTTLArgs() {
        final Map<String, Object> args = new HashMap<>();
        args.put("x-message-ttl", getTtl());
        return args;
    }

    public int getTtl() {
        return ttl;
    }

    public void setTtl(final int ttl) {
        this.ttl = ttl;
    }

}

@@ -347,24 +347,51 @@
 kbit.amqp;%0A%0A
+import java.time.Duration;%0A
 import java.
@@ -871,31 +871,49 @@
 ate 
-int
+long
  ttl = 
-1_814_400_000
+Duration.ofDays(21).toMillis()
 ;%0A%0A 
@@ -1822,19 +1822,20 @@
  public 
-int
+long
  getTtl(
@@ -1898,11 +1898,12 @@
 nal 
-int
+long
  ttl

Use java 8 duration to calculate ttl