簡介
本文說明如何清除進階訊息佇列通訊協定(AMQP)波動訊號佇列的疑難排解程式
貢獻了Aswathi Surendran、Gustavo Bell Cisco TAC工程師。
必要條件
需求
思科建議您瞭解以下主題:
採用元件
本檔案中的資訊是根據以下軟體版本:
- CloudCenter 4.3.x版到4.6.x版
- CloudCenter消息匯流排(RabbitMQ_Server)
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
背景資訊
池的活動執行緒大小為64,其中提交到作業對應的執行緒超過3000,將拒絕該執行緒,因為代碼一次不能處理超過64個執行緒,因此它將等待前一個任務完成並執行其他任務。
任何大於已執行執行緒池可使用的任務將被拒絕。
問題
filecliqr-connection.log位於/usr/local/tomcatgua/logs/report error:
Caused by: org.springframework.core.task.TaskRejectedException: Executor [java.util.concurrent.ThreadPoolExecutor@6737f4fb[Running, pool size = 64, active threads = 64, queued tasks = 3000, completed tasks = 413]] did not accept task: org.springframework.aop.interceptor.AsyncExecutionInterceptor$1@6b0517b3
at org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.submit(ThreadPoolTaskExecutor.java:284)
at org.springframework.aop.interceptor.AsyncExecutionAspectSupport.doSubmit(AsyncExecutionAspectSupport.java:186)
at org.springframework.aop.interceptor.AsyncExecutionInterceptor.invoke(AsyncExecutionInterceptor.java:123)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at com.sun.proxy.$Proxy84.processMessage(Unknown Source)
at com.osmosix.commons.messaging.listeners.impl.DefaultNodeMessageListener.handleMessage(DefaultNodeMessageListener.java:35)
at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:269)
at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.invokeListenerMethod(MessageListenerAdapter.java:383)
... 12 more
Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@3911a213 rejected from java.util.concurrent.ThreadPoolExecutor@6737f4fb[Running, pool size = 64, active threads = 64, queued tasks = 3000, completed tasks = 413]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.submit(ThreadPoolTaskExecutor.java:281)
... 23 more
2016-10-19 02:32:32,205 INFO annotation.RequestMappingHandlerMapping [localhost-startStop-1] - Mapped "{[/image/service/dltargetlocal],methods=[POST]}" onto public java.util.Map<java.lang.String, ?> com.osmosix.gateway.image.transform.ImageTransformController.downloadToTargetLocal(com.osmosix.commons.image.transform.DownloadImageFileRequest)
2016-10-19 02:32:32,206 WARN listener.ConditionalRejectingErrorHandler [SimpleAsyncTaskExecutor-1] - Execution of Rabbit message listener failed.
org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener method 'handleMessage' threw exception
at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.invokeListenerMethod(MessageListenerAdapter.java:391)
at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.onMessage(MessageListenerAdapter.java:294)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:757)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:680)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$001(SimpleMessageListenerContainer.java:93)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$1.invokeListener(SimpleMessageListenerContainer.java:183)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.invokeListener(SimpleMessageListenerContainer.java:1352)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:661)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:1096)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:1080)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$800(SimpleMessageListenerContainer.java:93)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1197)
at java.lang.Thread.run(Thread.java:745)
解析
步驟1。 通過SSH登入到RabbitMQ伺服器。
步驟2.切換到root使用者。
# sudo -i
步驟3.啟用管理外掛。
# rabbitmq-plugins enable rabbitmq_management
步驟4.啟用對rabbitmqadmin命令的訪問。
# chmod +x `find /var/lib/rabbitmq/ -name "rabbitmqadmin"`
# ln -s `find /var/lib/rabbitmq/ -name "rabbitmqadmin"` /usr/sbin
步驟5.可以通過GUI訪問RabbitMQ。
http://
:15672 (username=cliqr password=cliqr)
附註:使用您的RabbitMQ伺服器地址替換配置中的RabbitMQ_Server_IP
導航隊列頁籤以檢視詳細資訊
或
CLI:
# rabbitmqadmin -V /cliqr -u cliqr -p cliqr list queues
# rabbitmqadmin -V /cliqr -u cliqr -p cliqr list exchanges
# rabbitmqadmin -V /cliqr -u cliqr -p cliqr list channels
步驟6.刪除網關心跳隊列。
#rabbitmqadmin -V /cliqr delete queue name=cliqr.gateway.heartbeat.queue --username=cliqr --password=cliqr
步驟7. 在RabbitServer中重新啟動tomcat服務。
#/etc/init.d/tomcatgua stop
#/etc/init.d/tomcatgua start
注意:如果缺少cliqr.gateway.heartbeat.queue,請按照以下步驟重新啟動CCO tomcat服務:
步驟8. 通過SSH登入到CCO伺服器。
步驟9.切換到根使用者。
# sudo -i
步驟10.重新啟動Tomcat伺服器。
#/etc/init.d/tomcat stop
#/etc/init.d/tomcat start