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,用于在两个应用 ...
随机推荐
- Javascript/Jquery——简单定时器的多种实现方法
第一种方法: <script language="javascript"> //使用setInterval间歇调用 (不建议使用该方法) $(function(){ s ...
- ios游戏开发 Sprite Kit教程:初学者 1
注:本文译自Sprite Kit Tutorial for Beginners 目录 Sprite Kit的优点和缺点 Sprite Kit vs Cocos2D-iPhone vs Cocos2D- ...
- UI进阶 KVO
KVO:(Key-Value-Observer)键值观察者,是观察者设计模式的一种具体实现 KVO触发机制:一个对象(观察者),监测另一对象(被观察者)的某属性是否发生变化,若被监测的属性发生的更改, ...
- ecshop支持手机号码登录、邮箱登录
修改 User.php 文件找到: if ($user->login($username, $password,isset($_POST['remember']))) 在它上边增加一段我们所要 ...
- 错误内存【读书笔记】C程序中常见的内存操作有关的典型编程错误
题记:写这篇博客要主是加深自己对错误内存的认识和总结实现算法时的一些验经和训教,如果有错误请指出,万分感谢. 对C/C++程序员来讲,内存管理是个不小的挑战,绝对值得慎之又慎,否则让由上万行代码构成的 ...
- Unity的使用
1.Ioc功能使用: 1.介绍对象的生命周期 顾名思义 在容器中存在的实例,是可以定义其生命周期的. Unity提供了 几种自带的 生命周期 管理类(常用的已标红) ContainerControll ...
- Python 动态语言
1.在C++中,Animal a = Person(); 这样写是不行的,因为a的内容不能使用Person的内容来填充. 2.在Python中,变量不需要声明,而且可以赋任何值.Python是如何做到 ...
- android常见错误-E/AndroidRuntime(13678): java.lang.NoClassDefFoundError:
08-01 11:09:39.791: E/AndroidRuntime(13678): FATAL EXCEPTION: main 08-01 11:09:39.791: E/AndroidRunt ...
- Codeforces Gym 100650B Countdown DFS
Problem B: CountdownTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/conte ...
- mysqldump原理1