출처 : https://memorynotfound.com/spring-boot-embedded-activemq-configuration-example/
https://howtodoinjava.com/spring-boot/spring-boot-jmstemplate-activemq/
참고사이트)
https://yonguri.tistory.com/56
https://ddakker.tistory.com/328
https://examples.javacodegeeks.com/enterprise-java/jms/jms-message-types-example/
https://livebook.manning.com/book/spring-in-action-fifth-edition/chapter-8/53
@JmsListener
1. 허용된 인자 유형)
java.lang.String : TextMessage 형태를 String 형태의 메시지 페이로드로 받는다.
java.util.Map : MapMessage 형태를 Map 형태의 메시지 페이로드로 받는다.
byte[] : BytesMessage 형태를 byte[] 형태의 메시지 페이로드로 받는다.
javax.jms.Message : 실제 JMS 메시지를 받는다.
javax.jms.Session : Session 객체에 접근하기 위해 사요자 정의 응답을 전송한다.
@Header 애노테이션이 붙은 인자 : JMS 메시지로부터 헤더 값을 추출한다.
@Headers 애노테이션이 붙은 인자 : 모든 JMS 메시지에서 헤더 값을 추출하는 것으로 java.util.Map만 사용 가능하다.
리스터 컨테이너 설정
spring.jms.listener.acknowledge-mode : 컨테이너 인식 모드를 설정한다. 기본값 automatic(자동)
spring.jms.listener.auto-startup : 시작시 컨테이너를 자동으로 실행할 것인지를 설정한다. 기본값 true
spring.jms.listener.concurrency : 동시 컨슈머의 최소 개수를 설정한다. 기본값 none으로 1개의 동시 컨슈머다.(스프링 기본값)
spring.jms.listener.max-concurrency : 동시 컨슈머의 최대 갯수, 이하동일
spring.jms.pub-sub-domain : 기본 목적지가 토픽이다. 기본값 false로 큐를 의미한다.
POM.XML
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
package com.example.demo.activemqApp;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
import org.springframework.jms.config.JmsListenerContainerFactory;
import org.springframework.jms.support.converter.MappingJackson2MessageConverter;
import org.springframework.jms.support.converter.MessageConverter;
import org.springframework.jms.support.converter.MessageType;
@EnableJms
@Configuration
public class ActiveMQConfig {
public static final String ORDER_QUEUE = "order-queue";
@Bean
public JmsListenerContainerFactory<?> queueListenerFactory() {
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setMessageConverter(messageConverter());
return factory;
}
@Bean
public MessageConverter messageConverter() {
MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
converter.setTargetType(MessageType.TEXT);
converter.setTypeIdPropertyName("_type");
return converter;
}
}
package com.example.demo.activemqApp;
import java.io.Serializable;
import java.util.Date;
public class Order implements Serializable {
private String id;
private Date timestamp;
public Order() {
}
public Order(String id, Date timestamp) {
this.id = id;
this.timestamp = timestamp;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Date getTimestamp() {
return timestamp;
}
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
@Override
public String toString() {
return "Order{" +
"id='" + id + '\'' +
", timestamp=" + timestamp +
'}';
}
}
package com.example.demo.activemqApp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Service;
import static com.example.demo.activemqApp.ActiveMQConfig.ORDER_QUEUE;
@Service
public class OrderSender {
private static Logger log = LoggerFactory.getLogger(OrderSender.class);
@Autowired
private JmsTemplate jmsTemplate;
public void send(Order myMessage) {
log.info("sending with convertAndSend() to queue <" + myMessage + ">");
jmsTemplate.convertAndSend(ORDER_QUEUE, myMessage);
}
}
package com.example.demo.activemqApp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.handler.annotation.Headers;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;
import javax.jms.Session;
import static com.example.demo.activemqApp.ActiveMQConfig.ORDER_QUEUE;
@Component
public class OrderConsumer {
private static Logger log = LoggerFactory.getLogger(OrderConsumer.class);
@JmsListener(destination = ORDER_QUEUE)
public void receiveMessage(@Payload Order order,
@Headers MessageHeaders headers,
Message message, Session session) {
log.info("- - - - - - - - - - - - - - - - - - - - - - - -");
log.info("###### Message Order #####");
log.info("- - - - - - - - - - - - - - - - - - - - - - - -");
log.info("received <" + order + ">");
log.info("- - - - - - - - - - - - - - - - - - - - - - - -");
log.info("###### Message Details #####");
log.info("- - - - - - - - - - - - - - - - - - - - - - - -");
log.info("headers: " + headers);
log.info("message: " + message);
log.info("session: " + session);
log.info("- - - - - - - - - - - - - - - - - - - - - - - -");
}
}
package com.example.demo.activemqApp;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.concurrent.TimeUnit;
@Slf4j
@Component
public class Run implements ApplicationRunner {
@Autowired
private OrderSender orderSender;
@Override
public void run(ApplicationArguments args) throws Exception {
log.info("Spring Boot Embedded ActiveMQ Configuration Example");
for (int i = 0; i < 5; i++){
Order myMessage = new Order(i + " - Sending JMS Message using Embedded activeMQ", new Date());
orderSender.send(myMessage);
TimeUnit.SECONDS.sleep(3 );
}
log.info("Waiting for all ActiveMQ JMS Messages to be consumed");
TimeUnit.SECONDS.sleep(3 );
System.exit(-1);
}
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.2.4.RELEASE) 2020-02-17 00:12:02.114 INFO 14804 --- [ restartedMain] com.example.demo.DemoApplication : Starting DemoApplication on DESKTOP-6HPEM1U with PID 14804 (D:\example\springboot2_DB_example1\target\classes started by k in D:\example\springboot2_DB_example1) 2020-02-17 00:12:02.117 INFO 14804 --- [ restartedMain] com.example.demo.DemoApplication : No active profile set, falling back to default profiles: default 2020-02-17 00:12:02.160 INFO 14804 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2020-02-17 00:12:02.160 INFO 14804 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2020-02-17 00:12:02.918 INFO 14804 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2020-02-17 00:12:02.927 INFO 14804 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2020-02-17 00:12:02.927 INFO 14804 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.30] 2020-02-17 00:12:03.003 INFO 14804 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2020-02-17 00:12:03.003 INFO 14804 --- [ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 842 ms 2020-02-17 00:12:03.166 INFO 14804 --- [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2020-02-17 00:12:03.278 INFO 14804 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 2020-02-17 00:12:03.495 INFO 14804 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2020-02-17 00:12:03.498 INFO 14804 --- [ restartedMain] com.example.demo.DemoApplication : Started DemoApplication in 1.71 seconds (JVM running for 2.463) 2020-02-17 00:12:03.499 INFO 14804 --- [ restartedMain] com.example.demo.activemqApp.Run : Spring Boot Embedded ActiveMQ Configuration Example 2020-02-17 00:12:03.503 INFO 14804 --- [ restartedMain] c.example.demo.activemqApp.OrderSender : sending with convertAndSend() to queue <Order{id='0 - Sending JMS Message using Embedded activeMQ', timestamp=Mon Feb 17 00:12:03 KST 2020}> 2020-02-17 00:12:03.567 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:03.568 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : ###### Message Order ##### 2020-02-17 00:12:03.568 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:03.568 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : received <Order{id='0 - Sending JMS Message using Embedded activeMQ', timestamp=Mon Feb 17 00:12:03 KST 2020}> 2020-02-17 00:12:03.568 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:03.568 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : ###### Message Details ##### 2020-02-17 00:12:03.568 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:03.568 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : headers: {jms_redelivered=false, jms_deliveryMode=2, jms_destination=queue://order-queue, _type=com.example.demo.activemqApp.Order, jms_priority=4, id=0dd03ef5-2b98-c800-cc64-48c9fd00f1c4, jms_timestamp=1581865923538, jms_expiration=0, jms_messageId=ID:DESKTOP-6HPEM1U-6178-1581865923314-1:1:2:1:1, timestamp=1581865923567} 2020-02-17 00:12:03.569 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : message: org.springframework.jms.listener.adapter.AbstractAdaptableMessageListener$MessagingMessageConverterAdapter$LazyResolutionMessage@2d992008 2020-02-17 00:12:03.569 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : session: Cached JMS Session: ActiveMQSession {id=ID:DESKTOP-6HPEM1U-6178-1581865923314-1:1:1,started=true} java.lang.Object@601b5147 2020-02-17 00:12:03.569 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:06.873 INFO 14804 --- [ restartedMain] c.example.demo.activemqApp.OrderSender : sending with convertAndSend() to queue <Order{id='1 - Sending JMS Message using Embedded activeMQ', timestamp=Mon Feb 17 00:12:06 KST 2020}> 2020-02-17 00:12:06.877 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:06.877 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : ###### Message Order ##### 2020-02-17 00:12:06.877 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:06.877 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : received <Order{id='1 - Sending JMS Message using Embedded activeMQ', timestamp=Mon Feb 17 00:12:06 KST 2020}> 2020-02-17 00:12:06.878 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:06.878 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : ###### Message Details ##### 2020-02-17 00:12:06.878 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:06.878 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : headers: {jms_redelivered=false, jms_deliveryMode=2, jms_destination=queue://order-queue, _type=com.example.demo.activemqApp.Order, jms_priority=4, id=a56dfd97-d8a4-771e-7ac0-9eb10def60fd, jms_timestamp=1581865926873, jms_expiration=0, jms_messageId=ID:DESKTOP-6HPEM1U-6178-1581865923314-1:1:2:1:2, timestamp=1581865926877} 2020-02-17 00:12:06.878 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : message: org.springframework.jms.listener.adapter.AbstractAdaptableMessageListener$MessagingMessageConverterAdapter$LazyResolutionMessage@5ca7556e 2020-02-17 00:12:06.878 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : session: Cached JMS Session: ActiveMQSession {id=ID:DESKTOP-6HPEM1U-6178-1581865923314-1:1:1,started=true} java.lang.Object@601b5147 2020-02-17 00:12:06.878 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:09.954 INFO 14804 --- [ restartedMain] c.example.demo.activemqApp.OrderSender : sending with convertAndSend() to queue <Order{id='2 - Sending JMS Message using Embedded activeMQ', timestamp=Mon Feb 17 00:12:09 KST 2020}> 2020-02-17 00:12:09.958 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:09.958 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : ###### Message Order ##### 2020-02-17 00:12:09.959 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:09.959 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : received <Order{id='2 - Sending JMS Message using Embedded activeMQ', timestamp=Mon Feb 17 00:12:09 KST 2020}> 2020-02-17 00:12:09.959 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:09.959 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : ###### Message Details ##### 2020-02-17 00:12:09.959 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:09.959 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : headers: {jms_redelivered=false, jms_deliveryMode=2, jms_destination=queue://order-queue, _type=com.example.demo.activemqApp.Order, jms_priority=4, id=d1a9b1b6-78f5-4271-07e9-e91e2bc9fd22, jms_timestamp=1581865929954, jms_expiration=0, jms_messageId=ID:DESKTOP-6HPEM1U-6178-1581865923314-1:1:2:1:3, timestamp=1581865929958} 2020-02-17 00:12:09.959 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : message: org.springframework.jms.listener.adapter.AbstractAdaptableMessageListener$MessagingMessageConverterAdapter$LazyResolutionMessage@d01aed4 2020-02-17 00:12:09.959 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : session: Cached JMS Session: ActiveMQSession {id=ID:DESKTOP-6HPEM1U-6178-1581865923314-1:1:1,started=true} java.lang.Object@601b5147 2020-02-17 00:12:09.959 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:13.029 INFO 14804 --- [ restartedMain] c.example.demo.activemqApp.OrderSender : sending with convertAndSend() to queue <Order{id='3 - Sending JMS Message using Embedded activeMQ', timestamp=Mon Feb 17 00:12:13 KST 2020}> 2020-02-17 00:12:13.035 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:13.035 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : ###### Message Order ##### 2020-02-17 00:12:13.035 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:13.035 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : received <Order{id='3 - Sending JMS Message using Embedded activeMQ', timestamp=Mon Feb 17 00:12:13 KST 2020}> 2020-02-17 00:12:13.035 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:13.036 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : ###### Message Details ##### 2020-02-17 00:12:13.036 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:13.036 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : headers: {jms_redelivered=false, jms_deliveryMode=2, jms_destination=queue://order-queue, _type=com.example.demo.activemqApp.Order, jms_priority=4, id=985488be-9902-1727-b8ed-0261f512bc32, jms_timestamp=1581865933029, jms_expiration=0, jms_messageId=ID:DESKTOP-6HPEM1U-6178-1581865923314-1:1:2:1:4, timestamp=1581865933035} 2020-02-17 00:12:13.036 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : message: org.springframework.jms.listener.adapter.AbstractAdaptableMessageListener$MessagingMessageConverterAdapter$LazyResolutionMessage@53d6ba3 2020-02-17 00:12:13.036 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : session: Cached JMS Session: ActiveMQSession {id=ID:DESKTOP-6HPEM1U-6178-1581865923314-1:1:1,started=true} java.lang.Object@601b5147 2020-02-17 00:12:13.036 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:16.095 INFO 14804 --- [ restartedMain] c.example.demo.activemqApp.OrderSender : sending with convertAndSend() to queue <Order{id='4 - Sending JMS Message using Embedded activeMQ', timestamp=Mon Feb 17 00:12:16 KST 2020}> 2020-02-17 00:12:16.102 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:16.102 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : ###### Message Order ##### 2020-02-17 00:12:16.102 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:16.102 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : received <Order{id='4 - Sending JMS Message using Embedded activeMQ', timestamp=Mon Feb 17 00:12:16 KST 2020}> 2020-02-17 00:12:16.103 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:16.103 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : ###### Message Details ##### 2020-02-17 00:12:16.103 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:16.103 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : headers: {jms_redelivered=false, jms_deliveryMode=2, jms_destination=queue://order-queue, _type=com.example.demo.activemqApp.Order, jms_priority=4, id=ccef0481-ad60-3f31-83cf-3b5023ab41f5, jms_timestamp=1581865936095, jms_expiration=0, jms_messageId=ID:DESKTOP-6HPEM1U-6178-1581865923314-1:1:2:1:5, timestamp=1581865936102} 2020-02-17 00:12:16.103 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : message: org.springframework.jms.listener.adapter.AbstractAdaptableMessageListener$MessagingMessageConverterAdapter$LazyResolutionMessage@60a31ef0 2020-02-17 00:12:16.103 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : session: Cached JMS Session: ActiveMQSession {id=ID:DESKTOP-6HPEM1U-6178-1581865923314-1:1:1,started=true} java.lang.Object@601b5147 2020-02-17 00:12:16.103 INFO 14804 --- [enerContainer-1] c.e.demo.activemqApp.OrderConsumer : - - - - - - - - - - - - - - - - - - - - - - - - 2020-02-17 00:12:19.153 INFO 14804 --- [ restartedMain] com.example.demo.activemqApp.Run : Waiting for all ActiveMQ JMS Messages to be consumed 2020-02-17 00:12:22.260 INFO 14804 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' Process finished with exit code -1 | cs |
'WEB > 스프링 부트 2' 카테고리의 다른 글
RabbitMQ (0) | 2020.02.17 |
---|---|
JMS, ActiveMQ (0) | 2020.02.15 |
JavaMail (0) | 2020.02.14 |
JDBC, Mapper / JPA / TestEntityManagerTest / SessionFactory (0) | 2020.02.14 |
MySQL 연결 / 스프링 schema.sql, data.sql / Flyway (0) | 2020.02.13 |