Compare commits
5 Commits
develop
...
bd6f979f76
| Author | SHA1 | Date | |
|---|---|---|---|
| bd6f979f76 | |||
| 3e558576ac | |||
| c667bfc35a | |||
| f9bbe50bb7 | |||
| d618858629 |
11
pom.xml
11
pom.xml
@@ -43,17 +43,6 @@
|
|||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-amqp-test</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
package br.com.stackpanel.duck_api.config;
|
|
||||||
|
|
||||||
import org.springframework.amqp.core.Queue;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
import static br.com.stackpanel.duck_api.entity.enums.QueueNames.QUEUE_NOTIFICATION_CAD;
|
|
||||||
import static br.com.stackpanel.duck_api.entity.enums.QueueNames.QUEUE_NOTIFICATION_ERROR;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
public class RabbitConfig {
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public Queue queueNotificationError() {
|
|
||||||
return new Queue(QUEUE_NOTIFICATION_ERROR.label, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public Queue queueNotificationCad() {
|
|
||||||
return new Queue(QUEUE_NOTIFICATION_CAD.label, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package br.com.stackpanel.duck_api.entity.enums;
|
|
||||||
|
|
||||||
public enum QueueNames {
|
|
||||||
|
|
||||||
QUEUE_NOTIFICATION_ERROR("QUEUE_NOTIFICATION_ERROR"),
|
|
||||||
QUEUE_NOTIFICATION_CAD("QUEUE_NOTIFICATION_CAD");
|
|
||||||
|
|
||||||
|
|
||||||
public final String label;
|
|
||||||
|
|
||||||
private QueueNames(String label) {
|
|
||||||
this.label = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package br.com.stackpanel.duck_api.service;
|
|
||||||
|
|
||||||
public interface RabbitPublisherService {
|
|
||||||
|
|
||||||
void sendNotificationCad(String notificationCad);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
package br.com.stackpanel.duck_api.service.impl;
|
|
||||||
|
|
||||||
import br.com.stackpanel.duck_api.service.RabbitPublisherService;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
||||||
|
|
||||||
import static br.com.stackpanel.duck_api.entity.enums.QueueNames.QUEUE_NOTIFICATION_ERROR;
|
|
||||||
|
|
||||||
public class RabbitPublisherServiceImpl implements RabbitPublisherService {
|
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(RabbitPublisherServiceImpl.class);
|
|
||||||
private final RabbitTemplate rabbitTemplate;
|
|
||||||
|
|
||||||
public RabbitPublisherServiceImpl(RabbitTemplate rabbitTemplate) {
|
|
||||||
this.rabbitTemplate = rabbitTemplate;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendNotificationCad(String notificationCad) {
|
|
||||||
log.info("Sending notification Cad: {}", notificationCad);
|
|
||||||
rabbitTemplate.convertAndSend(QUEUE_NOTIFICATION_ERROR.label, notificationCad);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,10 +5,4 @@ spring.datasource.password=${db_pass}
|
|||||||
spring.datasource.username=${db_user}
|
spring.datasource.username=${db_user}
|
||||||
spring.datasource.driver-class-name=org.postgresql.Driver
|
spring.datasource.driver-class-name=org.postgresql.Driver
|
||||||
spring.jpa.hibernate.ddl-auto=update
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
spring.jpa.show-sql=true
|
spring.jpa.show-sql=true
|
||||||
|
|
||||||
|
|
||||||
spring.rabbitmq.host=rabbit.stackpanel.com.br
|
|
||||||
spring.rabbitmq.port=5672
|
|
||||||
spring.rabbitmq.username=${rabbit_username}
|
|
||||||
spring.rabbitmq.password=${rabbit_password}
|
|
||||||
@@ -4,9 +4,3 @@ spring.datasource.url=${db_host:jdbc:postgresql://db.stackpanel.com.br:5432/nexu
|
|||||||
spring.datasource.password=${db_pass}
|
spring.datasource.password=${db_pass}
|
||||||
spring.datasource.username=${db_user}
|
spring.datasource.username=${db_user}
|
||||||
spring.datasource.driver-class-name=org.postgresql.Driver
|
spring.datasource.driver-class-name=org.postgresql.Driver
|
||||||
|
|
||||||
|
|
||||||
spring.rabbitmq.host=rabbit.stackpanel.com.br
|
|
||||||
spring.rabbitmq.port=5672
|
|
||||||
spring.rabbitmq.username=${rabbit_username}
|
|
||||||
spring.rabbitmq.password=${rabbit_password}
|
|
||||||
Reference in New Issue
Block a user