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

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

Introduction

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

Prototype

public UUID getMessageId() 

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 .ja v a2s.  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...");
        }
    }
}