iamjerryyeung

Thursday, March 28, 2013

java JMS

JMS special things: 1. Use JNDI to get the topic, queue factory, as well as topic and queue 2. You need factory -> connection -> session, where session is single threaded 3. JMS design is on interface, provider(vendor) will have its own implementation 4. The message object cannot be reused when received and then send it out 5. The behavior of multiple consumers/receivers on one queue is not documented 6. JMS support transaction both usertransaction and XA. For UserTransaction, it is per leg. From publisher to provider is one leg, from provider to consumer is another leg 7. JMS has headers and user properties and payload, message filter can only apply on header and user properties 8. Pub/Sub (TOPIC) there is no buffer to keep the sent message (except for durable). If there is no subscriber during the publish, the message is gone. 9. Point-to-Point (Queue) always has a buffer to hold customer data until consumer is up 10. JMS provides Requestor for handling the RPC case where temporary queue or topic is created for the response. 11. Message has expiration time which is used to purge the message 12. Consumer can acknowledge the message automatically or client ack or no duplicate 13. Handle/receving message can be sync or aysnc (message listner which cannot be reused across session). Both need to call the connection.start() 14. Acknowledge (client) in transaction has no effect 15. Acknowledge a message will automatically acknowledge the previous ones

0 Comments:

Post a Comment

<< Home