Example usage for org.springframework.integration.mongodb.store MessageDocument setGroupCreatedTime

List of usage examples for org.springframework.integration.mongodb.store MessageDocument setGroupCreatedTime

Introduction

In this page you can find the example usage for org.springframework.integration.mongodb.store MessageDocument setGroupCreatedTime.

Prototype

public void setGroupCreatedTime(long groupCreatedTime) 

Source Link

Usage

From source file:org.springframework.integration.mongodb.store.AbstractConfigurableMongoDbMessageStore.java

protected void addMessageDocument(final MessageDocument document) {
    if (document.getGroupCreatedTime() == 0) {
        document.setGroupCreatedTime(System.currentTimeMillis());
    }/*from w  ww. j a va  2s .  c  o m*/
    document.setCreatedTime(System.currentTimeMillis());
    try {
        this.mongoTemplate.insert(document, this.collectionName);
    } catch (DuplicateKeyException e) {
        if (this.logger.isDebugEnabled()) {
            this.logger.debug("The Message with id [" + document.getMessageId() + "] already exists.\n"
                    + "Ignoring INSERT and SELECT existing...");
        }
    }
}