Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Session %%&%'
Agenda
Why are we here? Messaging in WAS
What is JMS?
Wh are we here(
Some reasons for #eing here$$$
We currently have applications using WebSphere MQ, and now we have applications running in WebSphere Application Server that need to access the same data
Were writing applications for WebSphere Application Server, were trying to choose a messaging provider and are thin ing that WebSphere MQ might fit the bill %
Agenda
Why are we here? Messaging in WAS
What is JMS?
What is )MS(
A standardi-ed Ja"a A). to allow a!!lications to !erform messaging
A!!lications can #e unaware of im!lementation Not a wire !rotocol
+otes
J&& a!!lication ser"ers must !ro"ide su!!ort for JMS J&& 2$3 and later also must su!!ort the Ja"a Connector Architecture+ which WMQ now uses within WAS 74 JMS is a standardised !rogramming interface Allows Ja"a a!!lication interactions to #e loosely cou!led JMS a!!lications can #e coded to #e ignorant of the underlying JMS !ro"ider Can easily change the !ro"ider without altering the a!!lication
Queue Manager
Administrati"e Store
A!!lication Ser"er
+otes
)ro"ider s!ecific configuration+ such as how to connect to a messaging !ro"ider+ is contained within !MS resources held in )+-I+ defined at a!!lication de!loyment time JMS is not a trans!ort !rotocol No standardised a#ility to cou!le different JMS !ro"iders JMS Su!!orts two messaging models .oint/to/point ; using <ueues .ublish0subscribe ; using to!ics
Message/driven beans
5efine &J7 = :esource references that will #e initialised at runtime More code re<uired to get a message
public void recei(eMessage() { com!ared to an M57+ and less efficient try { $onnection conn = c&.create$onnection(); conn.start(); Session sess = conn.createSession(true)Session.*+T,-*$./,01E23E); Message$onsumer consumer = sess.create$onsumer( ); Message msg = consumer.recei(e(45555); if (msg instanceof TextMessage) { System.out.println(6Message recei(e !6 + ((TextMessage) msg).getText()); } conn.close(); } catch (Exception ex) { System.out.println("Exception ! " + ex); } }
Default Messaging
WebSphere MQ in a slide
We#S!here MQ 'WMQ(
WMQ is .7M>s flagshi! asynchronous messaging !roduct Queues are managed #y Queue Managers A!!lications connect to Queue Managers to access Queues
Many A).s+ such as JMS+ are a"aila#le
Queue Managers can #e connected together to form a networ?+ or cluster WMQ su!!orts the !oint0to0!oint and !u#lish1su#scri#e messaging models
S.7us forms the asynchronous messaging !latform for a!!lication ser"er #ased !roducts +otes )hysicallyA A!!lication ser"ers can #e made a mem#er of a #us "estinations are assigned to bus members 7us mem#ers run messaging engines that manage messages Messages are routed from any messaging engine in the #us to the a!!lication A WAS cell contains a!!lication ser"ers+ or clusters of a!!lication ser"ers #hese can optionally be made a member of a bus 5estinations are assigned to #us mem#ers 7us mem#ers run messaging engines within the a!!lication ser"er JVMs Messaging engines manage the runtime and !ersistent state of messages in the #us Messaging a!!lications form a connection to a messaging engine Messages are routed from any messaging engine in the #us to the a!!lication EogicallyA A #us is a logical entity that contains destinations 'e$g$ <ueues1to!ic s!aces( Messaging a!!lications connect to the #us to access the destinations A #us is location trans!arent+ all destinations and their messages are a"aila#le from anywhere in the #us
Agenda
Why are we here? Messaging in WAS
What is JMS?
4ption %
We#S!here MQ as the JMS !ro"ider in WAS
WAS
Application Server
Application
Application Server
Application
CICS application
WMQ QMgr
WMQ QMgr
WMQ QMgr
WMQ QMgr
WMQ bac#bone
*he most direct route to WMQ <ueues 7est !erforming way to get messages on and off a WMQ <ueue Eeast mo"ing !arts 'east things to configure 'east places where things can go wrong A single messaging system to maintain rather than two
Cons
WAS a!!lications de!endent on two systems #eing simultaneously a"aila#le Can #e com!le@ to e@!loit WAS and WMQ high a"aila#ility and scala#ility features
4ption 7
S.7us for WAS a!!lication messaging$
S.7us interacts with WMQ to access the messaging #ac?#one
WAS
Application Server Application Application Server Application Application Server Application
Messaging Engine
Messaging Engine
SIBus
MQ 8in#
Messages flow #etween S.7us and WMQ where interactions with the WMQ #ac?#one are necessary
WMQ bac#bone
WMQ QMgr WMQ QMgr WMQ QMgr
CICS application
Can connect using either the 8We#S!here MQ Ein?9+ or using a WMQ client connection
MQ Ein? is a ser"er0ser"er connection+ WMQ a!!ears as a S.7us 8foreign #us9 WMQ client connection ma?es the <ueue manager a!!ear as a mem#er of the S.7us
ste!
Messaging runtime is em#edded into the same runtime as the a!!lications A#ility to asynchronously <ueue messages in the WAS system while connecti"ity with the WMQ #ac?#one is una"aila#le JMS resource configuration relates to WAS0defined S.7us configuration o#/ects WMQ0aware configuration in WAS is minimised A!!lications can #e unaware of actual <ueue locations Cons *wo messaging systems to configure and maintain Additional com!le@ity in configuring interactions #etween S.7us and WMQ )erformance o"erhead when !assing from one messaging system to another
+otes
*ranslating messages #etween WMQ and WAS formats introduces an o"erhead As #oth WMQ and S.7us allow for asynchronous messaging+ if one end of the lin? is down+ messages will #e <ueued u! until the other is a"aila#le$
)otentially allows a!!lications to continue o!erating if one of the systems goes down$
4ption '
S.7us for WAS0WAS a!!lication messaging+ WMQ for WAS0Mother messaging
WAS
Application Server Application Application Server Application Application Server Application Application
Messaging Engine
Messaging Engine
SIBus
WMQ bac#bone
WMQ QMgr WMQ QMgr WMQ QMgr
CICS application
Access to WMQ "ia *C) or shared memory '8#indings9( Su!!orts connections to "ariety of WMQ <ueue manager "ersions .nterfaces with WAS using the well0defined JCA interface
We#S!here MQ !ro"ided as a single unit 8:esource Ada!ter9
+otes
WMQ su!!ort is #uilt directly into WAS
WMQ already de!loyed to WAS+ no need to de!loy WMQ When creating a JMS resource+ you are as?ed to choose #etween 8default9 messaging and WMQ messaging$ Maintenance of the WMQ :esource Ada!ter ':A( is through WAS ser"ice channels+ such as WAS interim fi@es1fi@ !ac?s
WMQ JMS code can connect to any "ersion of WMQ <ueue manager
No tight cou!ling #etween WMQ JMS client "ersion and QM "ersion$ WMQ JMS "ersion in use detailed hereA htt!A11www0C2$i#m$com1su!!ort1doc"iew$wss? rsH272IuidHswgJ2J3KCKL
JCA .nterface+ well defined interface for a!!lication ser"ers to access &nter!rise .nformation Systems$
Same WMQ interface used in other J&& a!!lication ser"ers Same connector interface as used #y S.7 and other !ro"iders in WAS
*he We#S!here MQ messaging !ro"ider in WAS 9: adds su!!ort for Acti"ation S!ecs Eistener )ort functionality is sta#ili-ed$ Acti"ation S!ecs com#ine the configuration of connecti"ity+ the JMS destination to #e !rocessed and the runtime characteristics of the M57 itself Can #e tested during creation to "erify they wor?$ Acti"ation s!ecs can #e defined at all WAS configuration sco!es+ as can #e done for Connection6actories and 5estinations$
Activation Specs
.n WAS V7+ the introduction of the We#S!here MQ V7 JCA 2$G ada!ter ena#les M57>s to use acti"ation s!ecs to connect to <ueue managers rather than using listener !orts$ Acti"ation s!ecs are the strategic direction for deli"ering JMS messages to M57s Acti"ation s!ecs are easier to administer as they are defina#le at any sco!e where as listener !orts are defined on a !er ser"er #asis A new wi-ard has #een created which assists in the migration of e@isting listener !orts to acti"ation s!ecs+ note that this only creates a new acti"ation s!ec with the same configuration as the listener !ort+ it does not modify a!!lication de!loyments to use the newly created acti"ation s!ec
Con,iguring ,or WMQ 6 Connection ?actories N S!ecify how an a!!lication connects to a WMQ <ueue manager N *y!ically re<uiresA
; Queue manager name ; Hostname and !ort ; Channel name ; Fther !arameters such asA
N *rans!ort ty!e 'client or #indings( N se of SSE
;esources < )MS < Connection ,actories < =+ew>
5efines references to the resources in WMQ that a JMS a!!lication will use
; *he WMQ resources must #e created using WMQ administration
Queues
; .dentifies the actual <ueue in WMQ
N Can #e used to set !ro!erties such as !ersistence+ !riority+ etc$
Topics
; 5efines the WMQ !u#lish1su#scri#e destination
Create JMS connection factories and JMS destinations+ and then use as normal Can read and write messages directly from WMQ Queues+ with confidence that messages arri"e at their destination$ .n the Ser"ice .ntegration O 7uses O %us(ame ) 6oreign 7us connections "iew+ clic? New+ and create a 5irect connection to a We#S!here MQ <ueue manager
5efine uni<ue 6oreign 7us name and MQEin? name S!ecify sender1recei"er channels on WMQ to use 'and ensure they e@ist on WMQ,( *he WMQ !ort used #y WAS is defined #y the !ort "alue S.7DMQD&N5)F.N*DA55:&SS 'e$g$GGGK(
Create JMS destinations that reference the foreign #us destination 'Connection 6actories still connect to the local #us( ses WMQ Sender1recei"er channels+ and so messages are sent to e@isting <ueues$ :eturn !ath uses remote <ueue definitions1transmission <ueues$ ndeli"ered messages sent to dead0letter <ueues$
QM as a #us mem#er is strongest for incoming messages+ QM as a foreign #us is strongest for outgoing 'it can <ueue u! messages when the QM is una"aila#le($
Can use a com#ination of methods$
Agenda
Why are we here? Messaging in WAS
What is JMS?
WMQ V7 <ueue manager understands JMS message !ro!erties Queue manager e"aluates JMS selector
Fnly transmits matching messages to the client &fficient deli"ery of messages
JMS Application
As nchronous Consu!e
JMS has had conce!t of asynchronous consumer since ince!tion
MessageEistener 1 onMessage code
WMQ V7 introduced a#ility of <ueue manager to dri"e consumer when suita#le message a"aila#le
A"oids need for P!olling threadP More efficient message deli"ery+ es!ecially with selectors$
MQQ&*
9A Queue Manager
M57
AppServer
9: Queue Manager
With !ro!er su!!ort in WMQ ; JMS im!lementation sim!lified Eess client C) thread o"erhead of this #usy
M57
M57
M57
M57
Browse / Mar#
)rior to WMQ "7 ; only -1FS WMQ had a feature of M7rowse0Mar?>
Now all MQ "7 Queue Managers ha"e #rowse mar?
Eet a #rowser mar? messages when it had #rowsed them Fther #rowsers can re<uest to not see mar?ed messages
Messages mar?ed for a !eriod of time defined on the <ueue manager 7rowsers that do not o!t to hide mar?ed messages can see all messages
VB style JMS clients can still remo"e messages and cause message contention
*his lets asynchronous message deli"ery #e more efficient Eess chance of contention when scaled u! to multi!le JVMs
Contention can still occur if a!!lication ser"ers ta?e a long time 'R message #rowse mar? inter"al( time to !rocess message$ JMSCCC2CK error re!orts this condition in WAS SystemFut$log
.ndication that ser"er needs to #e tuned+ e$g$ increase M57 sessions+ num#er of M57 !rocessing threads+ or decrease M57 !rocessing time$
:eduction in failed MQQ&*s and rolled #ac? transactional wor? in WAS gi"es significant !erformance #enefit
Agenda
Why are we here? Messaging in WAS
What is JMS?
*he WMQ JMS client can #e used to connect to Version G$2 <ueue managers and a#o"e$
*his uses a slightly modified "ersion of the WMQ Version B JMS Client+ which is em#edded in the Version 7 code$ No tight cou!ling #etween WMQ JMS client and <ueue manager "ersions
8)re0warning9 the WMQ JMS code it is connecting to a Version B or earlier <ueue manager s!eeds u! connection time$
&ntries in the list are tried until a wor?ing connection is found+ or the end of the list is reached$ AppServer sed with multi0instance <ueue managers M57 automatically reconnect to stand#y Must #e same QM data if using SA Standard !ro!erty in WAS VK
WAS V7 custom !ro!erty
Queue Manager Queue Manager Queue Manager
.f a!!lications are transacted+ the entries in the list must refer to the same QM data 'such as the acti"e and stand#y <ueue manager instances(
WAS transaction manager will #e unaware that connection is to a different hostname1!ort+ and will e@!ect the same transactions to #e "isi#le when connecting to the Connection6actory$ .f different QMs are referenced+ SA transaction reco"ery will not wor?+ and transactions will re<uire manual resolution$ Same restriction a!!lies to CC5*s
Can ha"e slight !erformance im!act$ Multi!le JMS a!!lications will #e sending data to a <ueue manager and waiting for a res!onse o"er the same channel$ Set ser"er connection channel SHA:&CNV to 2 for ma@imum !erformance
No
&"ery JMS a!!lication that uses this 6actory will create a new connection to the <ueue manager$
JMS a!!lications tend to use more QM connections+ as there is one !er JMS connection and JMS session$ Historically+ this has led to the QM Ma@ Channels limit #eing reached more easily+ and re<uiring the limit to #e increased$ Shared Con"ersations mitigate this$
MQM5 :6HJ
MQM5
5ata 5ata
JMS Messages
Non0JMS Messages
JMS A!!lication
)MS Client
Queue Manager
Ser"erSessions
QM
.f the Acti"ation S!ecification sto!s+ this is only re!orted in A!!lication Ser"er SystemFut$log logs$
As for other WMQ clients+ security e@its are re<uired to "alidate !asswords+ WMQ only chec?s user id ser ids more im!ortant with WMQ 7$2 channel authentication
Agenda
Why are we here? Messaging in WAS
What is JMS?
High Availabilit
*reat WAS and WMQ as se!arate resources WMQ V7$C$2 features ma?e it easier for WAS to reconnect during failo"er
Quic?er detection of #ro?en connections Connection Name Eists
Needs data to #e stored in e@ternal storage with loc?ing+ such as N6S V3 Fne acti"e <ueue manager+ with other stand#y instance Stand#y instance can detect failure and ta?e o"er
Can also trigger failo"er
Ser"er J
QM 5ata
Queue Manager
Ser"er J
QM A 5ata
Queue Manager A
Queue Manager B
QM 7 5ata
Queue Manager B
.ncludes sam!les that you can try out and ada!t htt!A11!u#li#$#oulder$i#m$com1infocenter1!rodconn1"2rCmC1ind e@$/s!
?urther In,or!ation
WAS !roduct information htt!A11www0=CB$i#m$com1software1we#ser"ers1a!!ser"1was1 WAS .nfo Center htt!A11!u#li#$#oulder$i#m$com1infocenter1wasinfo1"BrC1inde@$/s! htt!A11!u#li#$#oulder$i#m$com1infocenter1wasinfo1"Br21inde@$/s! htt!A11!u#li#$#oulder$i#m$com1infocenter1wasinfo1"7rC1inde@$/s! )roduct Connecti"ity .nformation Center htt!A11!u#li#$#oulder$i#m$com1infocenter1!rodconn1"2rCmC1inde@$/s! sing We#S!here MQ Ja"a .nterfaces in JJ&&1J&& &n"ironments htt!A11www0C2$i#m$com1su!!ort1doc"iew$wss?rsH272Iconte@tHSS6TSJIdcH57GJCIuidHswgJ2JBBG=GIlocHenD SIcsH *60 KIlangHenIrssHct272we#s!here .7M de"elo!erWor?s htt!A11www$i#m$com1de"elo!erwor?s 'Searching on 8Ser"ice .ntegration 7us9 returns a num#er of interesting articles( htt!A11www$i#m$com1de"elo!erwor?s1we#s!here1tech/ournal1CLC2Dleming1CLC2Dleming$html 0 WASV7 htt!A11www$i#m$com1de"elo!erwor?s1we#s!here1tech/ournal1CBC2Dratnasinghe1CBC2Dratnasinghe$html 0 Security htt!A11www$i#m$com1de"elo!erwor?s1we#s!here1tech/ournal1CBC2Dsmithson1CBC2Dsmithson$html 0 Security .7M :ed7oo?s htt!A11www$red#oo?s$i#m$com We#S!here A!!lication Ser"er V7A Messaging Administration Quide SQJ30777C0CC We#S!here A!!lication Ser"er V7A Conce!ts+ )lanning and 5esign+ SQJ3077CK0CC We#S!here A!!lication Ser"er V7A *echnical F"er"iew+ :&5)033KJ0CC We#S!here A!!lication Ser"er VB$2A JMS )ro#lem 5etermination+ :&5)03==C0CC We#S!here A!!lication Ser"er VB$2A System Management I Configuration+ SQJ307=C30CC We#S!here A!!lication Ser"er VB Scala#ility and )erformance Hand#oo?+ SQJ30B=LJ0CC We#S!here A!!lication Ser"er VB$2 Security Hand#oo?+ SQJ30B=2B0C2 We#S!here A!!lication Ser"er VB$2A *echnical F"er"iew+ :&5)032L20CC We#S!here A!!lication Ser"er VB$2A )lanning and 5esign+ SQJ307=CG0CC We#S!here A!!lication Ser"er VB$2A .nstallation )ro#lem 5etermination+ :&5)03=CG0CC
Agenda
Why are we here? Messaging in WAS
What is JMS?
22ACC
2JA2G
Highly A"aila#le Messaging 0 :oc? solid MQ We#S!here MQ 2C2A .ntroduction to the worldPs leading messaging !ro"ider 6irst ste!s with We#S!here Message 7ro?erA A!!lication integration for the messy *he MQ A). for 5ummies 0 the 7asics
)utting the we# into We#S!here MQA A loo? at We# J$C technologies What>s new in the We#S!here MQ )roduct 6amily WhatPs new in Message 7ro?er VK$C
C2A=C
C=ACC
C3A=C CBACC
Shared Q using Shared Message 5ata Sets MQ Q07o@ 0 F!en Micro!hone to as? the e@!erts <uestions
Cop right and Trade!ar#s Y .7M Cor!oration JC2J$ All :ights :eser"ed$
.7M+ the .7M logo+ and i#m$com are trademar?s or registered trademar?s of .nternational 7usiness Machines Cor!$+ registered in many /urisdictions worldwide$ Fther !roduct and ser"ice names might #e trademar?s of .7M or other com!anies$ A current list of .7M trademar?s is a"aila#le on the We# at 8Co!yright and trademar? information9 at www$i#m$com1legal1co!ytrade$shtml$