diff --git a/pom.xml b/pom.xml index 7ce2fed..09a5ded 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 3.4.4 + 3.2.1 com.example.mmad.testapp @@ -83,26 +83,9 @@ org.springframework.boot spring-boot-starter-web - - - - - - - - - org.springframework.boot - spring-boot-starter-amqp - - - org.springframework.amqp - spring-rabbit-stream - - - org.springframework.amqp - spring-rabbit-stream - 3.0.0 + org.springframework.cloud + spring-cloud-starter-config diff --git a/src/main/java/com/example/mmad/testapp/controller/PersonController.java b/src/main/java/com/example/mmad/testapp/controller/PersonController.java index 97e25d5..010cbbb 100755 --- a/src/main/java/com/example/mmad/testapp/controller/PersonController.java +++ b/src/main/java/com/example/mmad/testapp/controller/PersonController.java @@ -2,7 +2,6 @@ package com.example.mmad.testapp.controller; import com.example.mmad.testapp.model.PersonModel; import com.example.mmad.testapp.service.PersonService; -import com.example.mmad.testapp.service.StreamProducer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -15,18 +14,15 @@ import javax.validation.Valid; public class PersonController { private PersonService personService; - private StreamProducer streamProducer; @Autowired - public void setPersonService(PersonService personService, StreamProducer streamProducer) { - this.streamProducer = streamProducer; + public void setPersonService(PersonService personService) { this.personService = personService; } @PostMapping("/list") @ResponseStatus(HttpStatus.OK) public String listPosts() { - streamProducer.sendMessage("hi hi hi"); return "aaa"; } diff --git a/src/main/java/com/example/mmad/testapp/service/StreamProducer.java b/src/main/java/com/example/mmad/testapp/service/StreamProducer.java deleted file mode 100644 index a8e7672..0000000 --- a/src/main/java/com/example/mmad/testapp/service/StreamProducer.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.example.mmad.testapp.service; - -import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.rabbit.stream.producer.RabbitStreamTemplate; -import org.springframework.stereotype.Service; - -@Service -@RequiredArgsConstructor -public class StreamProducer { - @Autowired - private RabbitStreamTemplate rabbitStreamTemplate; - - public void sendMessage(String message) { - rabbitStreamTemplate.convertAndSend(message); - } -} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 22b3d8e..e33f2d0 100755 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,19 +1,5 @@ -spring.datasource.driver-class-name=org.postgresql.Driver - - -spring.datasource.url=jdbc:postgresql://85.198.8.43:7832/mmrztest -spring.datasource.username=mmrz -spring.datasource.password=fEWp7g44rHf8 - -#spring.datasource.url=jdbc:postgresql://localhost:5432/version -#spring.datasource.username=cloud -#spring.datasource.password=cloud - -#spring.datasource.url=jdbc:postgresql://localhost:5432/mmaddb -#spring.datasource.username=mmad -#spring.datasource.password=me9775 - -spring.liquibase.change-log=classpath:db/changelog/liquibase-master.xml - -spring.sql.init.mode=always - +spring.application.name=service-a +eureka.client.service-url.defaultZone=http://localhost:8761/eureka +spring.config.import=configserver:http://localhost:8888/ +eureka.client.register-with-eureka=true +eureka.client.fetch-registry=true diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml deleted file mode 100755 index 2db2990..0000000 --- a/src/main/resources/application.yml +++ /dev/null @@ -1,22 +0,0 @@ -spring: - application: - name: servicea -server: - port: 8085 - -eureka: - client: - service-url: - defaultZone: http://localhost:8761/eureka - -rabbitmq: - stream: - name: my-stream - host: localhost - port: 5552 - - -logging: - level: - org.springframework.cloud.stream: DEBUG - org.springframework.amqp: DEBUG