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

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

Introduction

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

Prototype

public void setCreatedTime(long createdTime) 

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 www . j  av  a2  s  . co  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...");
        }
    }
}