Fixes incorrect units on timeout from millis to seconds.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/1fe1d1a3 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/1fe1d1a3 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/1fe1d1a3 Branch: refs/heads/master Commit: 1fe1d1a34e806ebfc53d0c6cb729e7e4aab804a1 Parents: e50835f Author: Todd Nine <tn...@apigee.com> Authored: Tue Oct 20 11:37:03 2015 -0600 Committer: Todd Nine <tn...@apigee.com> Committed: Tue Oct 20 11:44:35 2015 -0600 ---------------------------------------------------------------------- .../corepersistence/asyncevents/AmazonAsyncEventService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/usergrid/blob/1fe1d1a3/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java ---------------------------------------------------------------------- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 6f779b5..7034a67 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -25,6 +25,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -491,8 +492,11 @@ public class AmazonAsyncEventService implements AsyncEventService { final UUID newMessageId = UUIDGenerator.newTimeUUID(); + final int expirationTimeInSeconds = + ( int ) TimeUnit.MILLISECONDS.toSeconds( indexProcessorFig.getIndexMessageTtl() ); + //write to the map in ES - esMapPersistence.putString( newMessageId.toString(), jsonValue, indexProcessorFig.getIndexMessageTtl() ); + esMapPersistence.putString( newMessageId.toString(), jsonValue, expirationTimeInSeconds );