Академический Документы
Профессиональный Документы
Культура Документы
Service Broker
LOGO
www.themegallery.com
Contents
SQL Service
Demo
Broker
Service Broker Summary
Q&A
What is SQL Service Broker?
New feature in SQL Server 2005
Target Queue
Contract Contract
<Message/>
<Message/>
Contract Contract
Service Queue
Service Broker Service
Message Type
Message Type Message Type
VALIDATION =
WELL_FORMED_XML;
Service Queue
Specifies the name of the message and the validation that SQL
Server performs on messages when they are received in the
queue
Validation may be NONE, EMPTY, WELL_FORMED_XML,
VALID_XML WITH SCHEMA COLLECTION
Message types are created in each database participating in the
conversation
Service Broker Service
Contract Message Type Message Type
CREATE CONTRACT
HelloWorldContract
Contract Contract
( HelloWorldMessage SENT BY
INITIATOR,
HelloWorldResponse SENT BY
Service Queue
TARGET );
A contract must have at least one message type that allows the
INITIATOR to send a message
Identical contracts are created in each database participating in
the conversation
Service Broker Service
Queue Message Type Message Type
( HelloWorldContract,
HelloUniverseContract);
Service Queue
<Message/>
<Message/>
Service
Program
Receive Message
Service
Program
Receive Message
Service Broker Conversation
Dialog Message Type Message Type
SEND ON CONVERSATION
@conversationHandle Contract Contract
MESSAGE TYPE HelloWorldMessage
(N'<message>Hello,World!</message>');
Service Queue
IF @message_type_name = N'HelloWorldMessage‘
l BEGIN
l SEND ON CONVERSATION @conversationHandle
l MESSAGE TYPE HelloWorldResponse
l (N'<message>Right Back At You!</message>')
l END CONVERSATION @conversationHandle
COMMIT TRANSACTION;
Service Broker Components
Networking and security components
Networking & Security Components
Route
CREATE ROUTE route_name
WITH
SERVICE_NAME = service_name,
BROKER_INSTANCE = broker_instance_identifier,
ADDRESS = 'TCP://172.22.26.216:4022'
Endpoint
Dialog Security:
Provides remote authorization for conversations
End-to-end encryption (encryption message)
Transport Security:
Prevents unauthorized network connections.
Features
SQL Service Broker activation.
Locking related messages.
Parallel store procedure
Demo
Service Broker Summary
Impact on database design/architecture
Asynchronous: parallel stored procedures
Queuing: handle peak workloads
Distributed: scalability
Decoupled: availability
Features
Automatic activation
application code
Events in Profiler
Any program that can issue TSQL, like a C# middle tier Windows
http://dotnet.sys-con.com/node/299073?page=0,0
SQL Server Service Broker Activation http://e-
articles.info/e/a/title/SQL-Server-Service-Broker-Activation
SQL Service Broker VS. MSMQ
http://www.devx.com/dbzone/Article/34110
etc…
Thank You!
LOGO
www.themegallery.com