chat-service/src/main/java/eu/stefanangelov/chatbot/chatservice/service/MessageService.java
/**
     * Send user message to bot service and save it into database
     * @param messageTO incoming user message from web socket
     * @return return response from chat service
     */
Send user message to bot service and save it into database
@param messageTO incoming user message from web socket
@return return response from chat service
Send user message to bot service and save it into database @param messageTO incoming user message from web socket @return return response from chat service
public MessageTO askBot(MessageTO messageTO){
        log.info("Send message to bot");
        ResponseEntity<MessageTO> botResponse = restTemplate.postForEntity(botServiceUrl, messageTO, MessageTO.class);
        log.info("Save bot response into database");
        Message message = modelMapper.map(botResponse.getBody(), Message.class);
        message.setCreated(new Date());
        messageRepository.save(message);
        log.info("Bot response is successfully persistent");
        return  botResponse.getBody();
    }
public MessageTO askBot ( MessageTO messageTO ) { log . info ( "Send message to bot" ) ; ResponseEntity < MessageTO > botResponse = restTemplate . postForEntity ( botServiceUrl , messageTO , MessageTO . class ) ; log . info ( "Save bot response into database" ) ; Message message = modelMapper . map ( botResponse . getBody ( ) , Message . class ) ; message . setCreated ( new Date ( ) ) ; messageRepository . save ( message ) ; log . info ( "Bot response is successfully persistent" ) ; return botResponse . getBody ( ) ; }
Send user message to bot service and save it into database
 @param messageTO incoming user message from web socket
 @return return response from chat service
Send user message to bot service and save it into database @param messageTO incoming user message from web socket @return return response from chat service