WCF SQL SERVER ADAPTER Implementing Polling and Event-Driven Consumers { by Juan I. Arriaga } 1 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Agenda Overview of the WCF SQL Adapter BizTalk examples A case study of using the WCF SQL Adapter outside of BizTalk Questions & answers 2 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
OVERVIEW WCF SQL SERVER ADAPTER 3 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Classic SQL Adapter vs. WCF SQL Adapter The classic SQL adapter does not support SQL Query Notification; the WCF SQL Adapter does. For other differences, refer to: Thiago Almeida’s blog post at the-old-sql-adapter/ the-old-sql-adapter/ Richard Seroter’s SOA Patterns with BizTalk Server 2009 (Chapter 9). 4 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Polling Consumer 5 Source: by Gregor Hohpe and Bobby Wolf. Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Event-Driven Consumer 6 Source by Gregor Hohpe and Bobby Wolf. Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Query Notification vs. Polling 7 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
BIZTALK EXAMPLES Polling Consumer WCF SQL SERVER ADAPTER 8 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
WCF SQL Adapter Installation Download & install: WCF LOB Adapter SDK SP2 Microsoft BizTalk Adapter for SQL Server (WCF SQL Adapter) NOTE: (1) The WCF SQL adapter is also available as part of the BizTalk Adapter Pack. (2) A BizTalk license is required. 9 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Consume Adapter Service Configure Adapter 10 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Consume Adapter Service Configure Binding 11 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Consume Adapter Service Typed Polling Contract 12 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Consume Adapter Service Generated Items 13 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
BizTalk Admin Console WcfReceiveLocation for polling 14 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
BizTalk Admin Console Simple send port to trace polling data 15 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Sample of Typed Polling Data 16 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com Time to build the example from scratch!
BIZTALK EXAMPLES Event-Driven Consumer WCF SQL SERVER ADAPTER 17 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
SQL Service Broker Verification To verify whether Service Broker is enabled or not: SELECT is_broker_enabled FROM sys.databases WHERE name = ‘MyDB’; To enable Service Broker functionality (if needed): ALTER DATABASE [MyDB] SET ENABLE_BROKER; or ALTER DATABASE [MyDB] SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE; 18 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Consume Adapter Service Configure Adapter 19 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Consume Adapter Service Configure Binding 20 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Consume Adapter Service Notification Service Contract 21 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Consume Adapter Service Generated Items 22 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
BizTalk Admin Console WcfReceiveLocation for notifications 23 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
BizTalk Admin Console Simple send port to trace notifications 24 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Sample of Notifications 25 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com Time to build the example from scratch!
CUSTOMER CASE STUDY WCF SQL SERVER ADAPTER OUTSIDE OF BIZTALK 26 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
WCF SQL Adapter Outside BizTalk 27 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
Console Service Sample Add Adapter Service Reference – Generated Items | eWorldTree.com Twin Cities Connected Systems User Group (Nov.17th, 2011) 28
Console Service Demo Snippet from NotificationAction class | eWorldTree.com Twin Cities Connected Systems User Group (Nov.17th, 2011) 29
Console Service Demo Snippet from Main Routine | eWorldTree.com Twin Cities Connected Systems User Group (Nov.17th, 2011) 30
Console Service Demo Changes to SqlAdapterBindingService | eWorldTree.com Twin Cities Connected Systems User Group (Nov.17th, 2011) 31
Console Service Demo Listener Started Notification | eWorldTree.com Twin Cities Connected Systems User Group (Nov.17th, 2011) 32
Console Service Demo Insert Notification | eWorldTree.com Twin Cities Connected Systems User Group (Nov.17th, 2011) 33 And after the service is stopped…
Caveats & Gotchas The adapter only receives one notification if the SQL statement (e.g. INSERT) affects more than one row. Consider the use of the NotifyOnListenerStart event to retrieve pending records after a network communication breakdown. Double check the requirements and restrictions for SELECT statements in a query notification.requirements and restrictions 34 Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com
eWorldTree, LLC Branch out your information network ™. Link to eWorldTree™. 35 Q&A Thank You! Twin Cities Connected Systems User Group (Nov.17th, 2011) | eWorldTree.com