bot-service/src/main/java/eu/stefanangelov/chatbot/botservice/nlu/service/NLURestService.java
/**
     * Send rest post request to NLU service
     *
     * @param userMessage incoming user message
     * @return response from REST call
     */
Send rest post request to NLU service
@param userMessage incoming user message
@return response from REST call
Send rest post request to NLU service @param userMessage incoming user message @return response from REST call
@Cacheable(cacheNames = "NLU")
    public NluResponse apply(UserMessage userMessage) {
        Assert.notNull(userMessage, "User message can't be null");
        Assert.notNull(userMessage.getContent(), "Content from user can't be null");
        NluRequest nluRequest = new NluRequest(userMessage.getContent());
        log.info("Send request to NLU Service");
        return restTemplate.postForEntity(nluServiceURI, nluRequest, NluResponse.class).getBody();
    }
@ Cacheable ( cacheNames = "NLU" ) public NluResponse apply ( UserMessage userMessage ) { Assert . notNull ( userMessage , "User message can't be null" ) ; Assert . notNull ( userMessage . getContent ( ) , "Content from user can't be null" ) ; NluRequest nluRequest = new NluRequest ( userMessage . getContent ( ) ) ; log . info ( "Send request to NLU Service" ) ; return restTemplate . postForEntity ( nluServiceURI , nluRequest , NluResponse . class ) . getBody ( ) ; }
Send rest post request to NLU service
 @param userMessage incoming user message
 @return response from REST call
Send rest post request to NLU service @param userMessage incoming user message @return response from REST call