All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dell.cpsd.common.rabbitmq.retrypolicy.DefaultMessageKeyGenerator Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
/**
 * Copyright © 2017 Dell Inc. or its subsidiaries.  All Rights Reserved.
 * Dell EMC Confidential/Proprietary Information
 */

package com.dell.cpsd.common.rabbitmq.retrypolicy;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.retry.MessageKeyGenerator;

/**
 * Default message key generator.
 * 

*

* Copyright © 2017 Dell Inc. or its subsidiaries. All Rights Reserved. * Dell EMC Confidential/Proprietary Information *

*/ public class DefaultMessageKeyGenerator implements MessageKeyGenerator { private static final String UNDEFINED_MESSAGE_KEY = "UNDEFINED"; @Override public Object getKey(Message message) { if (message.getMessageProperties().getMessageId() != null) { return message.getMessageProperties().getMessageId(); } else { return UNDEFINED_MESSAGE_KEY; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy