350 likes | 476 Views
Message Queuing with BizTalk 2006 R2: MSMQ, IBM WebSphere MQ and Ordered Delivery. Thomas Abraham Enterprise Consultant TS: BizTalk 2004 & 2006 blogs.digineer.com/blogs/ tabraham. Randall McClure BizTalk Consultant TS: BizTalk 2006 blogs.digineer.com/blogs/ randallm.
E N D
Message Queuing with BizTalk 2006 R2:MSMQ, IBM WebSphere MQand Ordered Delivery Thomas Abraham Enterprise Consultant TS: BizTalk 2004 & 2006 blogs.digineer.com/blogs/tabraham Randall McClure BizTalk Consultant TS: BizTalk 2006 blogs.digineer.com/blogs/randallm
Why Message Queuing? Using MSMQ Using WebSphere MQ A Solution for Ordered Delivery based on MSMQ Agenda
Why Message Queuing? • Guaranteed and/or ordered delivery • Cross-platform communication • Transactions • Asynchronous data transmission(a.k.a. fire and forget) • Buffering/batching • Loose coupling • Load balancing
Queuing Considerations • Dead letter queue management • Poison message management • Consistency of message format per queue • Latency • Licensing and support costs
Microsoft Message Queuing • Included with almost every OS edition • No extra licensing fees • Supports Network Load Balancing and Cluster Services • Can be bridged to WebSphere MQ with Host Integration Server 2006 • Publish queue locations in Active Directory and use Windows authentication
MSMQ Considerations • Limited management tools • 4 MB message size limit • Shipping V4.0 with Windows Vista and Windows Server 2008 • Transactional remote receive • Subqueues • Poison message handling
Demo DEMO Using MSMQ with the BTS 2006 R2 WCF Adapter
WebSphere MQ • Formerly MQSeries • Available for dozens of platforms • Highly configurable, widely adopted • Includes extensible management tools hosted in Eclipse (Java-based) • Two BizTalk adapters: • Server-Based Adapter (w/ BizTalk) • Client-Based (w/ Adapters for Host Systems)
WebSphere MQ Security • Interacts with Active Directory for authorization of queue access rights • Domain policy may disallow non-domain users from reading domain account group memberships • Path of least resistance and hassle: always set up a domain account for the MQ service
Installing MQAgent • Requires COM+ and DTC running on WebSphere MQ for Windows server • Enable Network DTC and Network COM+ • Allow In- & Outbound for Transaction Mgr • Enable Mutual Authentication • Enable XA Transactions • Enable DCOM with Packet Privacy
Demo DEMO Using WebSphere MQ for Windows 6.0
Agenda Patterns, Reloaded Business Problem Initial Solution Implementation Details Demo Better Solution More Details Demo Take-aways
Uniform Sequential Convoy Multiple identical messages, over time First receive initializes a correlation set Second receive is in a Listen, inside a Loop, using the same logical receive port and operation Later messages that match and follow the correlation set are received in the loop Ordered Delivery = uniform seq. convoy ++ Enforce order in orchestration receive shape and physical ports (limited types, 2006 only) Patterns, Reloaded
Uniform Sequential Convoy Activate, init correlation set First and followers in same receive shape Loop until Delay path fires before receiving following message Process first message Listen shape with Receive and process branch, and Delay branch Following correlation set
Ordered Delivery Ordered Delivery = true Ordered delivery on physical ports as appropriate
Business Problem Consume business events Filter and transform messages Deliver to three unique consumers, one of which affects people’s lives adversely if not … In-order! Low volume – 300/day 6am-6pm operation window
Initial Solution Generate WSE 2.0 web service from acknowledgement orchestration Ordered delivery orchestration pattern Called orchestration chain to preserve order Web service facades and data access layer to call SQL Server stored procedures Oracle adapter to call stored procedures
Initial Solution – MNCIS XML <CaseNotification schemaVersion="3:1" …> <NotificationAdminHeader caseNumberKey="62J007553366" caseKey="1568853"> <CourtFileNumber> <ID>62-J0-07-553366-madeup</ID> </CourtFileNumber> … </NotificationAdminHeader> <HearingTrialSettingNotification>…(0:n) <\CaseNotification>
Initial Solution DEMO
Oops! What if… Need to one or all consumer applications? A message is suspended, breaking ordered delivery? Find a bug that requires messages to be replayed, in-order? Not quite there… Had incoming message file wire-tap, but not in order, and no means to replay them Tedious manual process to re-order and replay
Better Solution Solution Might have implemented a resequencer pattern at http://www.microsoft.com/downloads/details.aspx?FamilyID=02c5fd53-fee9-44fc-a780-5d1d34ee8754&DisplayLang=en Decided to insert MSMQ queues in main path and in each consumer path Decided to have the web service write directly to the main path queue, to have replay capability separately from BizTalk Decided to decouple the web service from BizTalk
Queuing Solution – planned RCCC For replay
Queuing Solution DEMO
Take-aways Ordered delivery easy to implement, tougher to support MSMQ very helpful for isolation, replay and fault tolerance Watch out for subscription loops Third-party components help but they may not be robust enough
Take-aways Third-party tools are very helpful Consider fault tolerance and replay EARLY File SEND (but not receive) can do ordered delivery; use %datetime% in filename
Resources DebugView http://www.microsoft.com/technet/sysinternals/utilities/debugview.mspx Wfetch (in IIS 6.0 resource kit) http://www.microsoft.com/downloads/details.aspx?familyid=B134A806-D50E-4664-8348-DA5C17129210&displaylang=en ContextAdder – Jon Flanders http://www.masteringbiztalk.com/blogs/jon/CommentView,guid,25768f43-c0b6-4f9d-bb7e-636d52dcd7eb.aspx#commentstart Modified here by 12/15 http://blogs.digineer.com/blogs/randallm/default.aspx
Resources Cogin QueueExplorer http://www.cogin.com/ CreateMSMQQueues.Tools (by 12/15) http://blogs.digineer.com/blogs/randallm/default.aspx SSO tools by BizTalk Samples, Scott Colestock and others…
Message Queuing with BizTalk 2006 R2:MSMQ, IBM WebSphere MQand Ordered Delivery Thank you for attending! Please visit us at www.digineer.com