springboot+activemq 시작 보고서 의 오 류 를 해결 합 니 다.

springboot+activemq 시작 메시지 설명 오류
Description:
Field jmsMessagingTemplate in com.haozz.demo.mq.PromoteActProducer required a bean of type 'org.springframework.jms.core.JmsMessagingTemplate' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
The following candidates were found but could not be injected:
- Bean method 'jmsMessagingTemplate' in 'JmsAutoConfiguration.MessagingTemplateConfiguration' not loaded because Ancestor org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration did not match
Action:
Consider revisiting the entries above or defining a bean of type 'org.springframework.jms.core.JmsMessagingTemplate' in your configuration.
원인 총 결 에는 다음 과 같은 세 가지 이유 가 있다.
1.spring.activemq.pool.enabled=true,스 레 드 탱크 가 열 리 고 뒤에 빈 칸 이 있 으 며 스 레 드 탱크 가방 을 도입 하지 않 았 습 니 다.

       <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-pool</artifactId>
        </dependency>
2.springboot 버 전 문 제 는 지원 되 지 않 습 니 다.2.0 버 전 으로 시작 하 는 것 을 권장 합 니 다.

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.1.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
추측:2.1.0+버 전 은 자신의 스 레 드 탱크 관리 가 있어 충돌 한 것 으로 추정 된다.
3.spring.activemq.pool.enabled=false,스 레 드 풀 닫 기
springboot 통합 activemq 구덩이 밟 기

시작 할 때 꺼졌어 요.
설정 은 다음 과 같 습 니 다.

server:
 port: 8762
#    context-path: /memeber
eureka:
 client:
   service-url:
     defaultZone: http://localhost:8761/eureka/
spring:
   application:
       name: member
   redis:
       host: 127.0.0.1
       password: 123456
       port: 6379
       pool:
           max-idle: 100
           min-idle: 1
           max-active: 1000
           max-wait: -1
   datasource:
       name: test1
       url: jdbc:mysql://127.0.0.1:3306/dandan-member
       username: root
       password: 123456
       type: com.alibaba.druid.pool.DruidDataSource
       driver-class-name: com.mysql.jdbc.Driver
       filters: stat
       maxActive: 20
       initialSize: 1
       maxWait: 60000
       minIdle: 1
       timeBetweenEvictionRunsMillis: 60000
       minEvictableIdleTimeMillis: 300000
       validationQuery: select 'x'
       testWhileIdle: true
       testOnBorrow: false
       testOnReturn: false
       poolPreparedStatements: true
       maxOpenPreparedStatements: 20
    ##activemq    
activemq:
   broker-url: tcp://localhost:61616
   in-memory: true
   pool:
     enabled: false
##  
messages:
    queue: messages_queue
해결 은 다음 과 같다.
원래 activemq 는 spring 에 없 었 습 니 다.바로 앞 에 있 었 습 니 다.spring 과 동급 입 니 다.
해결 후 설정 은 다음 과 같 습 니 다.

server:
 port: 8762
#    context-path: /memeber
eureka:
 client:
   service-url:
     defaultZone: http://localhost:8761/eureka/
spring:
   application:
       name: member
   redis:
       host: 127.0.0.1
       password: 123456
       port: 6379
       pool:
           max-idle: 100
           min-idle: 1
           max-active: 1000
           max-wait: -1
   datasource:
       name: test1
       url: jdbc:mysql://127.0.0.1:3306/dandan-member
       username: root
       password: 123456
       type: com.alibaba.druid.pool.DruidDataSource
       driver-class-name: com.mysql.jdbc.Driver
       filters: stat
       maxActive: 20
       initialSize: 1
       maxWait: 60000
       minIdle: 1
       timeBetweenEvictionRunsMillis: 60000
       minEvictableIdleTimeMillis: 300000
       validationQuery: select 'x'
       testWhileIdle: true
       testOnBorrow: false
       testOnReturn: false
       poolPreparedStatements: true
       maxOpenPreparedStatements: 20
    ##activemq    
   activemq:
       broker-url: tcp://localhost:61616
       in-memory: true
       pool:
          enabled: false
##  
messages:
    queue: messages_queue
건의yml 들 여 쓰기 에는 네 개의 바이트 가 필요 합 니 다.한 바이트 로 는 구별 하기 어렵다.
이상 은 개인 적 인 경험 이 므 로 여러분 에 게 참고 가 되 기 를 바 랍 니 다.여러분 들 도 저 희 를 많이 응원 해 주시 기 바 랍 니 다.

좋은 웹페이지 즐겨찾기