Categorii: Tot

realizată de Frank Dou 17 ani în urmă

412

JMS

JMS

JMS

JBOSS的实现

每一种组件é

Persistence Manager
Message Cache
Status Manager
Destination Manager
Security Manager
Invocation Layer

可靠的JMS

JMS提供的可靠性机制
高级的机制
基本的机制

建立临时Destination

消息持久化

管理消息过期

管理消息应答

怎样才算是消息è

对JMS的各参与者来说,如何实现可靠性
Other Application

优先级

控制消息的过期

Consumer

The most reliable way to consume a message is to do so within a transaction, either from a queue or from a durable subscription to a topic

Producer

The most reliable way to produce a message is to send a PERSISTENT message within a transaction

为什么用JMS

不è

API编程模型

可以用来查看Queue中的内容

QueueBrowser browser = session.createBrowser(queue);

Topic没有对应的Browser

Message Selector

建立Consumer的时候,可以指定Message Selector,è

Message Consumer

MessageConsumer consumer = session.createConsumer(dest);

MessageConsumer consumer = session.createConsumer(queue);

MessageConsumer consumer = session.createConsumer(topic);

异步

Message Listeners

Listener myListener = new Listener();

consumer.setMessageListener(myListener);

Session会串è

同步

connection.start();

Message m = consumer.receive();

connection.start();

Message m = consumer.receive(1000); // time out after a second

MessageProducer producer = session.createProducer(dest);

producer.send(message);

或è

MessageProperties
MessageHeaders

以下是JMS的Header类型:

JMSDestination send or publish method

JMSDeliveryMode send or publish method

JMSExpiration send or publish method

JMSPriority send or publish method

JMSMessageID send or publish method

JMSTimestamp send or publish method

JMSCorrelationID Client

JMSReplyTo Client

JMSType Client

JMSRedelivered JMS provider

MessageBodies

TextMessage文本类型

MapMessage String作为key, 基本类型作为value的消息

StreamMessage流类型

ObjectMessage可串è

Connection

消息双发之é

Session
建立如下对象

临时Queue和Topic

Queue Browser

Message

Message Consumers

Message Producer

Administration Object
ConnectionFactory

创建到Provider的è

TopicConnectionFactory

QueueConnectionFactory

Destination

消息提供è

Topic

Queue

分类

Publish/Subscribe

一个消息有多个消è

Point-to-Point

一个消息只有一个消è