From 2ecaad67b3f8fb8a7a7276f531dd8ec6042eb0cb Mon Sep 17 00:00:00 2001 From: aminmb37 Date: Wed, 4 Nov 2020 00:52:37 +0100 Subject: [PATCH] Configuring JMS. --- pom.xml | 7 +++++++ .../inventory/service/config/JmsConfig.java | 18 ++++++++++++++++++ src/main/resources/application.properties | 5 ++++- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/main/java/guru/sfg/beer/inventory/service/config/JmsConfig.java diff --git a/pom.xml b/pom.xml index 136e9e636..44c2f0f49 100644 --- a/pom.xml +++ b/pom.xml @@ -14,4 +14,11 @@ mssc-beer-inventory-service MSSC Beer Inventory Service + + + org.springframework.boot + spring-boot-starter-artemis + + + diff --git a/src/main/java/guru/sfg/beer/inventory/service/config/JmsConfig.java b/src/main/java/guru/sfg/beer/inventory/service/config/JmsConfig.java new file mode 100644 index 000000000..56f35b51b --- /dev/null +++ b/src/main/java/guru/sfg/beer/inventory/service/config/JmsConfig.java @@ -0,0 +1,18 @@ +package guru.sfg.beer.inventory.service.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.jms.support.converter.MappingJackson2MessageConverter; +import org.springframework.jms.support.converter.MessageConverter; +import org.springframework.jms.support.converter.MessageType; + +@Configuration +public class JmsConfig { + @Bean + public MessageConverter jacksonJmsMessageConverter() { + MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter(); + converter.setTargetType(MessageType.TEXT); + converter.setTypeIdPropertyName("_type"); + return converter; + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 927bb65f0..039c01479 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,2 +1,5 @@ logging.level.guru=debug -server.port=8082 \ No newline at end of file +server.port= +#artemis docker image user & pass +spring.artemis.user=artemis +spring.artemis.password=simetraehcapa \ No newline at end of file