读书人

客户端监控联接ActiveMQ状态

发布时间: 2013-07-16 22:38:05 作者: rapoo

客户端监控连接ActiveMQ状态

1、spring配置文件中配置exceptionListener

<bean id="exceptionListener" ref="connectionFactory"></property>

<property name="destination" ref="messageListenerQueue"></property>

<property name="messageListener" ref="messageListener"></property>

<property name="exceptionListener" ref="exceptionListener"></property>

</bean>

2、创建TempExceptionListener实现javax.jms.ExceptionListener接口

@Override

? ? public void onException(JMSException e) {

? ? ? ? LOG.error("TempExceptionListener 收到消息:" + e);

? ? ? ? LOG.warn("发送监控告警~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");

? ? ? ??

? ? }

读书人网 >开源软件

热点推荐