Example usage for org.springframework.amqp.rabbit.stocks.domain TradeResponse setTicker

List of usage examples for org.springframework.amqp.rabbit.stocks.domain TradeResponse setTicker

Introduction

In this page you can find the example usage for org.springframework.amqp.rabbit.stocks.domain TradeResponse setTicker.

Prototype

public void setTicker(String ticker) 

Source Link

Usage

From source file:org.springframework.amqp.rabbit.stocks.service.stubs.ExecutionVenueServiceStub.java

public TradeResponse executeTradeRequest(TradeRequest request) {
    TradeResponse response = new TradeResponse();
    response.setAccountName(request.getAccountName());
    response.setOrderType(request.getOrderType());
    response.setPrice(calculatePrice(request.getTicker(), request.getQuantity(), request.getOrderType(),
            request.getPrice(), request.getUserName()));
    response.setQuantity(request.getQuantity());
    response.setTicker(request.getTicker());
    response.setRequestId(request.getId());
    response.setConfirmationNumber(UUID.randomUUID().toString());

    try {//from  w w  w  .  jav a2s  .  c  o m
        log.info("Sleeping 2 seconds to simulate processing..");
        Thread.sleep(2000);
    } catch (InterruptedException e) {
        log.error("Didn't finish sleeping", e);
    }
    return response;
}