欢迎来到天天文库
浏览记录
ID:40961413
大小:446.35 KB
页数:45页
时间:2019-08-12
《Simplify Your JMS Code with Spring 》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、EnterpriseMessagingWithSpringJMSBruceSnyder,SeniorSoftwareEngineer,SpringSourceAgenda•VerybriefintroductiontoJMS•SynchronousJMSWithSpring•AsynchronousJMSWithSpring2WhatisJMS?•JMSis:–AnAPIforclient-sidecommunicationswithaJMSprovider–IncludedinJavaEE•Alsostandalone•JMSis
2、not:–Aspecforamessagebrokerimplementation3JMSisanAbstraction4JMSMessage5Point-to-PointMessaging6Publish/SubscribeMessaging7TypicalJMSUse8RawJMS9JMSWithSpring10Managedvs.Non-ManagedJMS•Managed–JMSproviderinaJavaEEcontainer–JMSresourcepooling–Transactionsupport–Supportfo
3、rEJBs•Non-Managed–StandaloneJMSprovider–ManualsetupofJMSresources–Noguaranteeoftransactions•Springsupportsbothenvironments11JMSWithSpring12SpringJMS•JMSTemplate–Sendandreceivemessagessynchronously•MessageListenerContainer–Receivemessagesasynchronously–Message-DrivenPOJ
4、Os(MDPs)13JmsTemplateSynchronous•browse()–Browsemessagesinaqueue•convertAndSend()–Sendmessagessynchronously–ConvertaJavaobjecttoaJMSmessage•send()–SendamessagesynchronouslyusingaMessageCreator•receive()andreceiveAndConvert()–Receivemessagessynchronously•execute()–Provi
5、desaccesstocallbacksformorecomplexscenarios•receiveSelected()andreceiveSelectedAndConvert()–Receivefilteredmessagessynchronously14TheSpringJmsTemplateSynchronous6、:61616"/>7、n"/>15TheSpringJmsTemplateSynchronous//UsethedefaultdestinationjmsTemplate.convertAndSend("HelloWorld!");//UseadifferentdestinationjmsTemplate.convert8、AndSend(“TEST.BAR”,“HelloWorld!”);//UseadifferentdestinationStringtextMessage1=(String)jmsTemplate.receiveAndConvert(
6、:61616"/>7、n"/>15TheSpringJmsTemplateSynchronous//UsethedefaultdestinationjmsTemplate.convertAndSend("HelloWorld!");//UseadifferentdestinationjmsTemplate.convert8、AndSend(“TEST.BAR”,“HelloWorld!”);//UseadifferentdestinationStringtextMessage1=(String)jmsTemplate.receiveAndConvert(
7、n"/>15TheSpringJmsTemplateSynchronous//UsethedefaultdestinationjmsTemplate.convertAndSend("HelloWorld!");//UseadifferentdestinationjmsTemplate.convert
8、AndSend(“TEST.BAR”,“HelloWorld!”);//UseadifferentdestinationStringtextMessage1=(String)jmsTemplate.receiveAndConvert(
此文档下载收益归作者所有