Java Message Service (JMS) Web Apps and Services.

  • Published on
    29-Jan-2016

  • View
    216

  • Download
    0

Transcript

<ul><li><p>Java Message Service (JMS)</p><p>Web Apps and Services</p></li><li><p>ContentMessaging ConceptJMS Messaging ModelsJMS FeaturesJMS ApplicationPortal ArchitectureAction casesState diagramJMS Implementation PerformancePortal PerformanceSummary and Lessons Learned</p></li><li><p>Messaging ConceptMessage use for loosely coupled distributed communications Sender and receiver are not necessary on-line at the same timeJava API Package javax.jms</p></li><li><p>JMS Messaging ModelsPublish/Subscribe</p><p>Point-to-point</p><p>SenderReceiver </p></li><li><p>JMS FeaturesPersistencyReliabilityAsynchronous / Synchronous receiverMessage body types: text, byte, stream, map (name/value pair), object</p></li><li><p>JMS ApplicationConnection</p><p>Connection</p><p>Session</p><p>Session</p><p>TCP/IP</p><p>TCP/IP</p><p>Publisher orSender</p><p>Subscriber orReceiver</p><p>MessageAsynch or Synch ListenerClient AClient B</p></li><li><p>Portal Architecture Limited to news service It uses one server</p></li><li><p>Case 1: News browsing</p></li><li><p>Case 2: News submitting</p></li><li><p>Case 3: News submitting without listener (Persistent messages)</p></li><li><p>Case 4: Collecting persistent messages after listener recovers</p></li><li><p>State diagram for clientIdle (Servlet)All objects are closed and destroyedDisplaying complete newsTelling the user, the message is sent</p></li><li><p>State diagram for listenerIdle (Servlet)The receiver is listening to queue.</p><p>- The receiver is closed.- Persistency is active- Stopconsuming messagesAll objects are closed and destroyed- Stop consuming messages, persistency- The browser displays queue content without consuming messages</p></li><li><p>JMS Implementation on WLS 5.1 SP 8 Performance</p></li><li><p>JMS Test ConditionOne client connected to serverDecoupled for persistent messagesCoupled for non-persistent messagesAsynchronous receiverDestination: Topic and QueueText Message: 1000 characters in message bodyBytes Message: 1000 byte values in message bodyMap Message: 500 characters as String, one max value for byte, short, integer, long, float and double primitive typeNo news saving operation (neither to files nor database)</p></li><li><p>Delivery and Retrieval Time for Persistent Messages Processing 15.818.6Average retrieved messages / second25.519.1Average delivered messages / secondQueueTopicMap Message17.619.7Average retrieved messages / second27.419.2Average delivered messages / secondQueueTopicText Message15.617.7Average retrieved messages / second28.620.7Average delivered messages / secondQueueTopicBytes Message</p></li><li><p>Delivery and Retrieval Time for Non-Persistent Messages Processing 18.117.9Average retrieved messages / second29.229.2Average delivered messages / secondQueueTopicMap Message17.819.3Average retrieved messages / second28.629.6Average delivered messages / secondQueueTopicText Message13.813.4Average retrieved messages / second21.721.5Average delivered messages / secondQueueTopicBytes Message</p></li><li><p>JMS-based Portal Performance</p></li><li><p>Multiclients test on news portal12 concurrent clients by WebLoad toolSerialization for read and write methods to avoid database conflict One test agenda for 1 hour duration: Go to portal siteBrowse newsSubmit original news (ca 1 kB size)Browse newsLook at certain newsGive a comment (ca 1 kB size)Browse newsTotal average round time by 12 clients: 199.76 seconds</p></li><li><p>Multiclients test on news portal1,5, 10, 15, 20, 30 concurrent clients by Web Application Stress tool (15 minutes test)For 1 client: 4.5 messages/minute</p><p>Server overloaded, not complete data acquisition</p><p>Chart1</p><p>4078.86</p><p>18457.09</p><p>80955.41</p><p>198733.84</p><p>340670.24</p><p>380278.75</p><p>Number of concurrent clients</p><p>Response time (miliseconds)</p><p>Multiclients response time</p><p>Sheet1</p><p>Number of clients1510152030</p><p>Go to portal site (GET)157.472435.2513240.16101704466.6524927.06</p><p>Get latest news (GET)154.292430.9715107.891654529959.730528.79</p><p>Choose option to submit original news (POST)17.2426.448.9830.876954.1510407.82</p><p>Submit original news (POST)111.59104.72140.78600.84012.258782.79</p><p>Get latest news (GET)176.822982.2816151.8736404.8233004.4725903.24</p><p>Choose option to read detailed news (POST)3200.127134.7820624.8763897.521047882027.47</p><p>Give a comment (POST)21.32032.7129590.0725999.9465453.54</p><p>Submit a comment (POST)78.9491127.77620.784320.2563269.29</p><p>Get latest news (GET)161.093231.6915480.384087421474.8368978.75</p><p>4078.8618457.0980955.41198733.84340670.24380278.75</p><p>Sheet1</p><p>Number of concurrent clients</p><p>Response time (miliseconds)</p><p>Multiclients response time</p><p>Sheet2</p><p>Sheet3</p></li><li><p>SummaryJMS defines destination as mediator between sender and receiver to make decoupling possible.Queue destination gives faster processing time than topic.JMS does not specify how to administer messaging products. JDBC and database for saving news.The portal relies on JMS persistency feature to avoid messages loss when partial crash on JMS listener happens.JMS persistency does not help for whole server crash because all JMS objects fail as well.JMS persistency may help for server clustering. One server for sender and one server for receiver.JMS is useful for notification, chat program, short message service with applet use (more interaction and often times to be decoupled).</p></li><li><p>Lessons LearnedJAVA + J2EE Java Message Service (JMS)Java ServletJDBC + Oracle databaseJNDIWebLogic 5.1-7.0HTML</p></li></ul>

Recommended

View more >