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

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

Introduction

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

Prototype

public Long getGroupCreatedTime() 

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 ww  w  .  j  a  v  a  2  s. c  om*/
    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...");
        }
    }
}