@Bean注入queue后, 没有实际创建

本文描述了一个关于队列重建的问题:删除队列后无法自动重建,导致相关服务启动失败。通过监听另一队列触发了所有队列的自动创建。具体原因不明,可能是软件BUG。

问题描述:创建好A队列后,在web界面删除A队列,最后发现A队列不能自动创建,导致另一个监听A队列的服务启动失败
解决:在本服务中监听一个B队列后,conf中的所有mq组件都自动创建完成
原因:未知。。。BUG???

// @Bean(value = SIGNALING_ASYNC_TASK_EXECUTOR, destroyMethod = "shutdown") // public ExecutorService signalingExecutor(PrometheusMeterRegistry registry, // SignalingExecutorProperty signalingExecutorProperty) { // return buildExecutor(SIGNALING_ASYNC_TASK_EXECUTOR, registry, signalingExecutorProperty); // } // // @Bean(value = PASSTHROUGH_ASYNC_TASK_EXECUTOR, destroyMethod = "shutdown") // public ExecutorService passthroughExecutor(PrometheusMeterRegistry registry, // PassthroughExecutorProperty passthroughExecutorProperty) { // return buildExecutor(PASSTHROUGH_ASYNC_TASK_EXECUTOR, registry, passthroughExecutorProperty); // } // // @Bean(value = PRECONNECTION_REQUEST_RELAY_EXECUTOR, destroyMethod = "shutdown") // public ExecutorService preConnRequestRelayExecutor(PrometheusMeterRegistry registry, // PreConnectionExecutorProperty preConnectionExecutorProperty) { // return buildExecutor(PRECONNECTION_REQUEST_RELAY_EXECUTOR, registry, preConnectionExecutorProperty); // } // // @Bean(value = PRECONNECTION_PASSTHROUGH_EXECUTOR, destroyMethod = "shutdown") // public ExecutorService preConnPassthroughExecutor(PrometheusMeterRegistry registry, // PreConnectionPassthroughExecutorProperty executorProperty) { // return buildExecutor(PRECONNECTION_PASSTHROUGH_EXECUTOR, registry, executorProperty); // } // // @Bean(value = STREAM_MANAGE_EXECUTOR, destroyMethod = "shutdown") // public ExecutorService streamManageExecutor(PrometheusMeterRegistry registry, // StreamManageExecutorProperty executorProperty) { // return buildExecutor(STREAM_MANAGE_EXECUTOR, registry, executorProperty); // } // // @Bean(value = USER_AND_DEVICE_INFO_REQUEST_EXECUTOR, destroyMethod = "shutdown") // public ExecutorService userAndDeviceInfoRequestExecutor(PrometheusMeterRegistry registry, // UserAndDeviceInfoRequestExecutorProperty executorProperty) { // return buildExecutor(USER_AND_DEVICE_INFO_REQUEST_EXECUTOR, registry, executorProperty); // } // // @Bean(value = PROLONG_EXECUTOR, destroyMethod = "shutdown") // public ExecutorService prolongExecutor(PrometheusMeterRegistry registry, // ProlongExecutorProperty executorProperty) { // return buildExecutor(PROLONG_EXECUTOR, registry, executorProperty); // } // // @Bean(value = PLAYER_NUM_EXECUTOR, destroyMethod = "shutdown") // public ExecutorService playerNumExecutor(PrometheusMeterRegistry registry, // PlayerNumExecutorProperty executorProperty) { // return buildExecutor(PLAYER_NUM_EXECUTOR, registry, executorProperty); // } // // @Bean(value = SESSION_EXECUTOR, destroyMethod = "shutdown") // public ScheduledExecutorService sessionScheduledExecutorService(PrometheusMeterRegistry registry, // SessionExecutorProperty sessionExecutorProperty) { // RejectedExecutionHandler handler = new MetricRejectedExecutionHandler(registry, SESSION_EXECUTOR); // // ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor( // sessionExecutorProperty.getCorePoolSize(), // new ThreadFactoryBuilder().setNameFormat(SESSION_EXECUTOR + "-pool-%d").build(), handler); // return ExecutorServiceMetrics.monitor(registry, scheduledThreadPoolExecutor, SESSION_EXECUTOR); // } // @Bean(value = GRPC_SERVER_EXECUTOR, destroyMethod = "shutdown") // public ExecutorService grpcServerExecutorService(PrometheusMeterRegistry registry, // GrpcServerExecutorProperty executorProperty) { // return buildExecutor(GRPC_SERVER_EXECUTOR, registry, executorProperty); // } // // @Bean(value = TRACK_SESSION_EXECUTOR, destroyMethod = "shutdown") // public ExecutorService trackSessionExecutorService(PrometheusMeterRegistry registry, // TrackSessionExecutorProperty executorProperty) { // return buildExecutor(TRACK_SESSION_EXECUTOR, registry, executorProperty); // } // // @Bean(value = RELAY_CLIENT_EXECUTOR, destroyMethod = "shutdown") // public ExecutorService relayClientExecutorService(PrometheusMeterRegistry registry, // RelayClientExecutorProperty executorProperty) { // return buildExecutor(RELAY_CLIENT_EXECUTOR, registry, executorProperty); // } // // private ExecutorService buildExecutor(String executorName, PrometheusMeterRegistry registry, // ExecutorProperty executorProperty) { // RejectedExecutionHandler handler = new MetricRejectedExecutionHandler(registry, executorName); // // ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); // threadPoolTaskExecutor.setCorePoolSize(executorProperty.getCorePoolSize()); // threadPoolTaskExecutor.setMaxPoolSize(executorProperty.getMaxPoolSize()); // threadPoolTaskExecutor.setKeepAliveSeconds(executorProperty.getKeepAliveSeconds()); // threadPoolTaskExecutor.setQueueCapacity(executorProperty.getQueueSize()); // threadPoolTaskExecutor.setThreadFactory( // new ThreadFactoryBuilder().setNameFormat(executorName + "-pool-%d").build()); // threadPoolTaskExecutor.setRejectedExecutionHandler(handler); // threadPoolTaskExecutor.setTaskDecorator(new ContextTaskDecorator()); // threadPoolTaskExecutor.initialize(); // // return ExecutorServiceMetrics.monitor(registry, threadPoolTaskExecutor.getThreadPoolExecutor(), executorName); // } // // @AllArgsConstructor // public static class MetricRejectedExecutionHandler implements RejectedExecutionHandler { // // private PrometheusMeterRegistry registry; // private String executorName; // // @Override // public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { // registry.counter("executor.rejected.tasks.total", "name", executorName).increment(); // throw new RejectedExecutionException("Task " + r.toString() + " rejected from " + executor.toString()); // } // }如上是旧的线程池初始化实现,有新的实现是通过配置文件由spring直接初始化,如何加一个开关在两者之间切换
最新发布
11-29
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值