350 likes | 829 Views
WCF SQL SERVER ADAPTER. Implementing Polling and Event-Driven Consumers { by Juan I. Arriaga }. Agenda. Overview of the WCF SQL Adapter BizTalk examples A case study of using the WCF SQL Adapter outside of BizTalk Questions & answers. WCF SQL SERVER ADAPTER. OVERVIEW.
E N D
WCF SQL SERVER ADAPTER Twin Cities Connected Systems User Group (Nov.17th, 2011) Implementing Polling and Event-Driven Consumers { by Juan I. Arriaga }
Agenda • Overview of the WCF SQL Adapter • BizTalk examples • A case study of using the WCF SQL Adapter outside of BizTalk • Questions & answers Twin Cities Connected Systems User Group (Nov.17th, 2011)
WCF SQL SERVER ADAPTER Twin Cities Connected Systems User Group (Nov.17th, 2011) OVERVIEW
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 http://connectedthoughts.wordpress.com/2011/01/18/wcf-sql-versus-the-old-sql-adapter/ Richard Seroter’s SOA Patterns with BizTalk Server 2009 (Chapter 9) . Twin Cities Connected Systems User Group (Nov.17th, 2011)
Polling Consumer Twin Cities Connected Systems User Group (Nov.17th, 2011) Source: http://www.eaipatterns.com/PollingConsumer.html by Gregor Hohpe and Bobby Wolf.
Event-Driven Consumer Twin Cities Connected Systems User Group (Nov.17th, 2011) Source http://www.eaipatterns.com/EventDrivenConsumer.html by Gregor Hohpe and Bobby Wolf.
Query Notification vs. Polling Twin Cities Connected Systems User Group (Nov.17th, 2011)
WCF SQL SERVER ADAPTER Twin Cities Connected Systems User Group (Nov.17th, 2011) BizTALK EXAMPLESPolling Consumer
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. Twin Cities Connected Systems User Group (Nov.17th, 2011)
Consume Adapter Service Configure Adapter Twin Cities Connected Systems User Group (Nov.17th, 2011)
Consume Adapter Service Configure Binding Twin Cities Connected Systems User Group (Nov.17th, 2011)
Consume Adapter Service Typed Polling Contract Twin Cities Connected Systems User Group (Nov.17th, 2011)
Consume Adapter Service Generated Items Twin Cities Connected Systems User Group (Nov.17th, 2011)
BizTalk Admin ConsoleWcfReceiveLocation for polling Twin Cities Connected Systems User Group (Nov.17th, 2011)
BizTalk Admin ConsoleSimple send port to trace polling data Twin Cities Connected Systems User Group (Nov.17th, 2011)
Sample of Typed Polling Data Twin Cities Connected Systems User Group (Nov.17th, 2011) Time to build the example from scratch!
WCF SQL SERVER ADAPTER Twin Cities Connected Systems User Group (Nov.17th, 2011) BizTALK EXAMPLESEvent-Driven Consumer
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; Twin Cities Connected Systems User Group (Nov.17th, 2011)
Consume Adapter Service Configure Adapter Twin Cities Connected Systems User Group (Nov.17th, 2011)
Consume Adapter Service Configure Binding Twin Cities Connected Systems User Group (Nov.17th, 2011)
Consume Adapter Service Notification Service Contract Twin Cities Connected Systems User Group (Nov.17th, 2011)
Consume Adapter Service Generated Items Twin Cities Connected Systems User Group (Nov.17th, 2011)
BizTalk Admin ConsoleWcfReceiveLocation for notifications Twin Cities Connected Systems User Group (Nov.17th, 2011)
BizTalk Admin ConsoleSimple send port to trace notifications Twin Cities Connected Systems User Group (Nov.17th, 2011)
Sample of Notifications Twin Cities Connected Systems User Group (Nov.17th, 2011) Time to build the example from scratch!
WCF SQL SERVER ADAPTER OUTSIDE OF BIZTALK Twin Cities Connected Systems User Group (Nov.17th, 2011) CUSTOMER CASE STUDY
WCF SQL Adapter Outside BizTalk Twin Cities Connected Systems User Group (Nov.17th, 2011)
Console Service SampleAdd Adapter Service Reference – Generated Items Twin Cities Connected Systems User Group (Nov.17th, 2011)
Console Service DemoSnippet from NotificationAction class Twin Cities Connected Systems User Group (Nov.17th, 2011)
Console Service DemoSnippet from Main Routine Twin Cities Connected Systems User Group (Nov.17th, 2011)
Console Service DemoChanges to SqlAdapterBindingService Twin Cities Connected Systems User Group (Nov.17th, 2011)
Console Service DemoListener Started Notification Twin Cities Connected Systems User Group (Nov.17th, 2011)
Console Service DemoInsert Notification Twin Cities Connected Systems User Group (Nov.17th, 2011) 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. Twin Cities Connected Systems User Group (Nov.17th, 2011)
Q&A Thank You! Twin Cities Connected Systems User Group (Nov.17th, 2011) eWorldTree, LLC Branch out your information network ™. Link to eWorldTree™.