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缩进要四个字节。一个字节不容易分辨