skip to Main Content

Redis – Java 8 Optional <List> returning True Why?

I have a REST Controller @GetMapping("/getByClientId/{clientId}") public ResponseEntity<Optional<List<EquityFeeds>>> getByClientId(@PathVariable("clientId") final String clientId) { Optional<List<EquityFeeds>> cId = Optional.ofNullable(equityFeedsService.findByClientId(clientId)); System.out.println("Client Id: "+cId); if(cId.isPresent()) { return ResponseEntity.ok(cId); } else { cId.orElseThrow(() -> new ClientIdNotFoundException(clientId)); } return ResponseEntity.ok(cId); } Service Class Code: public List<EquityFeeds>…

VIEW QUESTION

(Docker+SpringBoot+Mysql) Mysql connection refused – Phpmyadmin

Problem Description Spring Boot(app) container cant connect to "mysql" container Problem Output Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. application.properties spring.datasource.username = root spring.datasource.url = jdbc:mysql://mysql:3306/fms?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=false spring.datasource.password = manager@123 docker-compose.yml version:…

VIEW QUESTION

Redis – Docker compose for MongoDB ReplicaSet

I have been trying to dockerize my spring boot application which depends on redis, kafka and mongodb. Following is the docker-compose.yml: version: '3.3' services: my-service: image: my-service build: context: ../../ dockerfile: Dockerfile restart: always container_name: my-service environment: KAFKA_CONFLUENT_BOOTSTRAP_SERVERS: kafka:9092 MONGO_HOSTS:…

VIEW QUESTION
Back To Top
Search