JMS - Temporary Destination

Although sessions are used to create temporary destinations, this is only for convenience. Their scope is actually the entire connection. Their lifetime is that of their connection, and any of the connection’s sessions is allowed to create a MessageConsumer for them.

Temporary destinations (TemporaryQueue or TemporaryTopic objects) are destinations that are system-generated uniquely for their connection. Only their own connection is allowed to create MessageConsumers for them.

One typical use for a temporary destination is as the JMSReplyTo destination for service requests.

Each TemporaryQueue or TemporaryTopic object is unique. It cannot be copied.

Since temporary destinations may allocate resources outside the JVM, they should be deleted if they are no longer needed. They will be automatically deleted when they are garbage collected or when their connection is closed.

TemporaryQueue

A TemporaryQueue is a unique Queue object created for the duration of a Connection or QueueConnection. It is a system-defined queue that can be consumed only by the Connection or QueueConnection that created it.

A TemporaryTopic

A TemporaryTopic is a unique Topic object created for the duration of a Connection or TopicConnection. It is a system-defined Topic that can be consumed only by the Connection or TopicConnection that created it.

By definition, it does not make sense to create a durable subscription to a temporary topic. To do this is a programming error that may or may not be detected by a JMS provider.

时间: 2024-10-28 01:15:03

JMS - Temporary Destination的相关文章

Table of Contents - JMS

JMS Specification v1.1 JMS 基本概念 Message QueueBrowser 消息选择器 消息确认 ConnectionMetaData ExceptionListener 事务性消息 Temporary Destination Exceptions

深入浅出JMS(四)--Spring和ActiveMQ整合的完整实例

基于spring+JMS+ActiveMQ+Tomcat,做一个Spring4.1.0和ActiveMQ5.11.1整合实例,实现了Point-To-Point的异步队列消息和PUB/SUB(发布/订阅)模型,简单实例,不包含任何业务. 环境准备 工具 JDK1.6或1.7 Spring4.1.0 ActiveMQ5.11.1 Tomcat7.x 目录结构 所需jar包 项目的配置 配置ConnectionFactory connectionFactory是Spring用于创建到JMS服务器链接

JMS是一种应用于异步消息传递的标准API

JMS是一种应用于异步消息传递的标准API,作为Java平台的一部分,JMS可以允许不同应用.不同模块之间实现可靠.异步数据通信. 一些概念 JMS provider    An implementation of the JMS interface for a Message Oriented Middleware (MOM). Providers are implemented as either a Java JMS implementation or an adapter to a no

Spring整合ActiveMQ:spring+JMS+ActiveMQ+Tomcat

一.目录结构 相关jar包 二.关键配置activmq.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi=&quo

SpringFramework4系列之SpringJMS:(五)Jms namespace的使用

Spring jms 的命名空间 xmlns:jms="  xsi:schemaLocation=" http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms.xsd" Spring jms 的命名空间元素 SpringJMS 提供了 三种 命名空间元素 <jms:annotation-drive> <jms:listener-

使用Spring JMS轻松实现异步消息传递

异步进程通信是面向服务架构(SOA)一个重要的组成部分,因为企业里很多系统通信,特别是与外部组织间的通信,实质上都是异步的.Java消息服务(JMS)是用于编写使用异步消息传递的JEE应用程序的API.传统的使用JMS API进行消息传递的实现包括多个步骤,例如JNDI查询队列连接工厂和Queue资源,在实际发送和接收消息前创建一个JMS会话. Spring框架则简化了使用JEE组件(包括JMS)的任务.它提供的模板机制隐藏了典型的JMS实现的细节,这样开发人员可以集中精力放在处理消息的实际工作

ActiveMQ抛出异常javax.jms.IllegalStateException: The Session is closed

初始配置 maven 1 <dependency> 2 <groupId>org.springframework</groupId> 3 <artifactId>spring-jms</artifactId> 4 <version>4.2.0.RELEASE</version> 5 </dependency> 6 <dependency> 7 <groupId>org.apache.ac

JMS - 基于JMS的RPC

现在试试通过JMS,在应用程序之间发送消息.先看看spring提供的RPC方案(其实还有其他方案,只是没见过谁用).需要使用到这两个类:·org.springframework.jms.remoting.JmsInvokerServiceExporter将bean导出为基于消息的服务·org.springframework.jms.remoting.JmsInvokerProxyFactoryBean让客户端调用服务 比较一下JmsInvokerServiceExporter和RmiServic

spring整合jms

借鉴别人(http://shmilyaw-hotmail-com.iteye.com/blog/2208966),结合自己所用的体会写的,本人用的是servicemix搭的activemq 一.依赖 为了运行示例,我们需要有一个activemq的服务器.activemq的下载地址如下:http://activemq.apache.org/download.html 下载到本地解压到某个目录.然后进入到bin目录下 看你电脑是32,还是64,打开相应的文件夹,如下 这样activemq服务器就运行