av Frank Dou för 17 årar sedan
412
Mer av detta
每一种组件é
建立临时Destination
消息持久化
管理消息过期
管理消息应答
怎样才算是消息è
优先级
控制消息的过期
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
The most reliable way to produce a message is to send a PERSISTENT message within a transaction
不è
可以用来查看Queue中的内容
QueueBrowser browser = session.createBrowser(queue);
Topic没有对应的Browser
建立Consumer的时候,可以指定Message Selector,è
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);
或è
以下是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
TextMessage文本类型
MapMessage String作为key, 基本类型作为value的消息
StreamMessage流类型
ObjectMessage可串è
消息双发之é
临时Queue和Topic
Queue Browser
Message
Message Consumers
Message Producer
创建到Provider的è
TopicConnectionFactory
QueueConnectionFactory
消息提供è
Topic
Queue
一个消息有多个消è
一个消息只有一个消è