com.dell.cpsd.rcm.evaluation.client.amqp.config.RcmEvaluationProducerConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rcm-evaluation-service-api Show documentation
Show all versions of rcm-evaluation-service-api Show documentation
This repository contains the source code for the rcm evaluation service API.
Use this repository to share contracts between services so you can create POJOs using defined JSON schemas and to create message transformers for the RCM evaluation service.
The newest version!
/**
* Copyright © 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
* Dell EMC Confidential/Proprietary Information
*/
package com.dell.cpsd.rcm.evaluation.client.amqp.config;
import com.dell.cpsd.common.logging.ILogger;
import com.dell.cpsd.rcm.evaluation.client.log.RFESLoggingManager;
import com.dell.cpsd.rcm.evaluation.client.log.RFESMessageCode;
import org.springframework.amqp.core.Exchange;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Bean;
import com.dell.cpsd.rcm.evaluation.client.amqp.producer.AmqpRcmEvaluationProducer;
import com.dell.cpsd.rcm.evaluation.client.amqp.producer.IAmqpRcmEvaluationProducer;
/**
* The configuration for the service message producer.
*
*
* Copyright © 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
* Dell EMC Confidential/Proprietary Information
*
*
* @version 1.0
*
* @since SINCE-TBD
*/
@Configuration
public class RcmEvaluationProducerConfig
{
/*
* The logger for this class.
*/
private static final ILogger LOGGER =
RFESLoggingManager.getLogger(RcmEvaluationProducerConfig.class);
/*
* The Spring RabbitMQ template.
*/
@Autowired
private RabbitTemplate rabbitTemplate;
/*
* The service request exchange.
*/
@Autowired
@Qualifier("rcmEvaluationRequestExchange")
private Exchange exchange;
/*
* The routing key for the service request message queue.
*/
@Autowired
@Qualifier("rcmEvaluationRequestRoutingKey")
private String routingKey;
/*
* The host name of the client.
*/
@Autowired
@Qualifier("hostName")
private String hostname;
/**
* This returns the service message producer that publishes to the
* exchange.
*
* @return The service message producer.
*
* @since SINCE-TBD
*/
@Bean
IAmqpRcmEvaluationProducer rcmEvaluationProducer()
{
Object[] lparams = {routingKey};
LOGGER.info(RFESMessageCode.PRODUCER_ROUTING_I.getMessageCode(), lparams);
return new AmqpRcmEvaluationProducer(
rabbitTemplate, exchange, routingKey, hostname);
}
}