JMS - ExceptionListener
If a JMS provider detects a problem with a connection, it will inform the connection’s ExceptionListener, if one has been registered. To retrieve an ExceptionListener, the JMS provider calls the connection’s getExceptionListerer() method. This method returns the ExceptionListener for the connection. If no ExceptionListener is registered, the value null is returned. The connection can then use the listener by calling the listener’s onException() method, passing it a JMSException describing the problem.
This allows a client to be asynchronously notified of a problem. Some connections only consume messages, so they would have no other way to learn their connection has failed.
A Connection serializes execution of its ExceptionListener.
A JMS provider should attempt to resolve connection problems itself prior to notifying the client of them.
The exceptions delivered to ExceptionListener are those that have no other place to be reported. If an exception is thrown on a JMS call it, by definition, must not be delivered to an ExceptionListener (in other words, ExceptionListener is not for the purpose of monitoring all exceptions thrown by a connection).
Samlple Code:
connection.setExceptionListener(new ExceptionListener() {
@Override
public void onException(JMSException e) {
// handle the exception
}
});
JMS - ExceptionListener的更多相关文章
- JMS ActiveMQ研究文档
1. 背景 当前,CORBA.DCOM.RMI等RPC中间件技术已广泛应用于各个领域.但是面对规模和复杂度都越来越高的分布式系统,这些技术也显示出其局限性:(1)同步通信:客户发出调用后,必须等待服务 ...
- JMS连接WMQ及收发消息
因为对JMS的了解也只算入门级,有些概念也很模糊,不过,卤煮会尽可能去介绍的.另外,sample code都调试过可以跑. 1.神马是JMS? jms即Java消息服务(Java Message Se ...
- 4.java JMS技术
1.什么是JMS JMS即Java消息服务(Java Message Service)应用程序接口,是一个Java平台中关于面向消息中间件(MOM)的API,用于在两个应用程序之间, 或分布式系统中发 ...
- Spring整合jms消息
整个项目目录结构如下: JmsSpringContext.java package com.wulj.jms.internal.activisor; import org.slf4j.Logger; ...
- Atomikos 中文说明文档【转】
Atomikos 翻译文档(英文文档来源:下载安装包中START_HERE.html) ----译者:周枫 请尊重劳动成果,转载请标明 ...
- ActiveMQ入门示例
1.ActiveMQ下载地址 http://activemq.apache.org/download.html 2.ActiveMQ安装,下载解压之后如下目录
- ActiveMQ的使用
ActiveMQ使用分为两大块:生产者和消费者 一.准备 项目导入jar包:activemq-all-5.15.3.jar 并buildpath 二.生产者 创建连接工厂 ActiveMQCon ...
- day4 java消息中间件服务
PS: 讲个故事,老王要给他的两个女儿讲故事,他要一个一个讲很费劲,后来他使用了微信公众号,让订阅微信公众号的人关注就减轻了负担. PS: 传统的如果一个用户进行登录,会调用分多的服务,如果没有消息中 ...
- ActiveMq使用笔记
java JMS技术 .1. 什么是JMS JMS即Java消息服务(Java Message Service)应用程序接口是一个Java平台中关于面向消息中间件(MOM)的API,用于在两个应用 ...
随机推荐
- PAC(Proxy Auto Config)代理自动配置文件的编写
Proxy Auto Config文件格式说明 PAC文件实际上是一个Script, 通过PAC我们可以让系统根据情况判断使用哪一个Proxy来访问目标网址, 这样做的好处: 分散Proxy的流量,避 ...
- [IoC容器Unity] :Unity预览
1.引言 高内聚,低耦合成为一个OO架构设计的一个参考标准.高内聚是一个模块或者一个类中成员跟这个模块或者类的关系尽量高,低耦合是不同模块或者不同类之间关系尽量简单. 拿咱国家举例来说,假如你是中国人 ...
- LinkedList类
LinkedList类 LinkedList类和ArrayList,Vector基本相同,都有增.删.改.查等方法.LinkedList是继承List接口. import java.util.*; p ...
- 表单校验之datatype
凡要验证格式的元素均需绑定datatype属性,datatype可选值内置有10类,用来指定不同的验证格式. 如果还不能满足您的验证需求,可以传入自定义datatype,自定义datatype是一个非 ...
- Codeforces Round #334 (Div. 2) D. Moodular Arithmetic 环的个数
D. Moodular Arithmetic Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/60 ...
- Codeforces Round #Pi (Div. 2) D. One-Dimensional Battle Ships set区间分解
D. One-Dimensional Battle ShipsTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/co ...
- c# windowsForm打印
在windows应用程序中文档的打印是一项非常重要的功能,在以前一直是一个非常复杂的工作,Microsoft .net Framework的打 印功能都以组件的方式提供,为程序员提供了很大的方便,但是 ...
- 使用GLSL实现更多数量的局部光照 【转】
原文 http://www.cnblogs.com/CGDeveloper/archive/2008/07/02/1233816.html 众所周知,OpenGL固定管线只提供了最多8盏灯光.如何使得 ...
- 操作cookie
$.extend($, { setCookie: function(c_name, value, expiredays) { var exdate = new Date(); exdate.setDa ...
- C#多线程的介绍(园子里比较全的一篇)
一.多线程的概念 Windows是一个多任务的系统,如果你使用的是windows 2000及其以上版本,你可以通过任务管理器查看当前系统运行的程序和进程.什么是进程呢?当一个程序开始运行时,它就是一 ...