550 likes | 727 Views
New Features of Message Queuing in Windows .NET Server 2003. Shai Kariv Program Manager MSMQ Microsoft Corporation. Before We Start…. Win06: Tips & Tricks, later today! MSMQ background: MSMQ 1.0 in Windows NT 4.0 MSMQ 2.0 in Windows 2000 Platform integration: AD, Clustering, MMC
E N D
New Features of Message Queuing in Windows .NET Server 2003 Shai Kariv Program Manager MSMQ Microsoft Corporation
Before We Start… • Win06: Tips & Tricks, later today! • MSMQ background: • MSMQ 1.0 in Windows NT 4.0 • MSMQ 2.0 in Windows 2000 • Platform integration: AD, Clustering, MMC • Add-on services like Triggers • MSMQ 3.0 in XP and .NET Server 2003 • Internet messaging • 1-to-many messaging • Integrating Triggers, extending Admin API • System.Messaging
Agenda • Reliable 1-N Messaging • Distribution Lists • Reliable Multicast • Reliable Internet Messaging • Messaging Over SOAP/HTTP • Firewalls and Load Balancing • Admin API • Deployment and Storage • Triggers
Distribution ListsOverview • Software “fan-out” • Pub/Sub primitives • End-to-end semantics for • Delivery guarantees • Security • Transactions • Implementation: 1-1 “internally”
Distribution ListsPublic DLs • Registered in Active Directory • Leverage AD Group object • Programmable via ADSI calls • Manageable via AD MMC snap-ins • New format name: DL=<GUID> • Elements can be other DLs Dim dest as New MSMQDestination dest.FormatName = “DL=<GUID>” Message.Send dest
Distribution ListsPrivate DLs • Client-managed “DL”: • List of format names • Including new format names: DL, HTTP • Non-discoverable Dim dest as New MSMQDestination dest.FormatName = “DIRECT=OS:host1\q”,”PRIVATE=…” Message.Send dest
Distribution ListsTransactions • Identical to queue transactions • Multiple transactions to same DL: In-Order delivery • If sent from the same computer • No in-order guarantee for messages sent to different DLs • Even if DLs contain the same queues
Agenda • Reliable 1-N Messaging • Distribution Lists • Reliable Multicast • Reliable Internet Messaging • Messaging Over SOAP/HTTP • Firewalls and Load Balancing • Admin API • Deployment and Storage • Triggers
Reliable MulticastOverview • Hardware “fan-out”: Efficient send to multiple recipients • Expose and leverage IP multicast • MSMQ provides offline, persistency • Provide building blocks for Pub/Sub • Scenario: real-time market data push (financial sector) • Protocol: Pragmatic General Multicast
Reliable MulticastPGM: Pragmatic General Multicast • Joint Microsoft/Cisco effort • Public specification • Cisco routers provide optimization • Reliable multicast transport • Receiver either gets all transmission and repair data • Or able to detect unrecoverable data loss • Members may join/leave at any time
PGM Data FlowPGM host sends a multicast packet R Sender R S Receiver R R R = Multicast ODATA
PGM Data FlowA recipient sends (unicast) NAK R Sender R S Receiver R Unicast NAK R R
PGM Data FlowRouter multicasts NCF in LAN R Sender R S Receiver R R R = Multicast ODATA
PGM Data FlowRouter unicasts NAK back to sender R Sender R S Receiver R R R
PGM Data FlowSender multicasts repair data R Sender R S Receiver R R R = Multicast ODATA
Reliable MulticastConfiguration and Security • Receiver configuration: • New queue property: MulticastAddress • A queue can join one multicast group • Sender configuration: • Max send rate • Max time the repair data is available • Security: • Existing authN/authZ (per queue) • Encryption only at application level
Reliable MulticastProgramming model • Receiver side: • New queue property: MulticastAddress can be set programmatically… • When creating the queue or later on • Sender side: • New format name: MULTICAST=<IP> • No additional end-to-end semantics Dim dest as New MSMQDestination dest.FormatName = “MULTICAST=<address:port>” Message.Send dest
Agenda • Reliable 1-N Messaging • Distribution Lists • Reliable Multicast • Reliable Internet Messaging • Messaging Over SOAP/HTTP • Firewalls and Load Balancing • Admin API • Deployment and Storage • Triggers
Reliable Web MessagingGoals • Same programming model • Use HTTP as transport • SOAP-based protocol • Secure messaging across firewalls • Support Network Load Balancing
Reliable Web MessagingProgramming model • Open queue, send message • Queue can be HTTP-addressed • New format name: DIRECT=HTTPS://host/MSMQ/q • Open queue, receive message • New message properties leverage SOAP support • SoapHeader, SoapBody • SoapEnvelope, CompoundMessage
Reliable Web MessagingSOAP Reliable Messaging Protocol • SRMP: Specification for general-purpose reliable messaging • Published specification • Extension of WS-Routing • Implemented by MSMQ 3.0 • SOAP header is used to provide end-to-end information needed for reliable messaging
SRMP Message Elements WS-Routing: path Properties Stream Services Security • Receipts: • Delivery • Commitment • Stream SOAP Header SOAP Body SOAP Body
SRMP Path, Propeties <SOAP-ENV:Header xmlns=http://schema.xmlsoap.org/srmp xmlns:rp="http://schemas.xmlsoap.org/rp/“> <rp:path SOAPENV:mustUnderstand=“1”> <rp:action> MSMQ:Message </rp:action> <rp:to> http://server/something </rp:to> <rp:id> uuid:2288926@ac3fd49c-e7d5-4354-ba8d-3e13fc6f677c </rp:id> <rp:relatesTo> uuid:2288926@ac3fd49d-e7d5-4354-ba8d-3e13fc6f677c </rp:relatesTo> </rp:path> <properties SOAP-ENV:mustUnderstand="1“> <expiresAt>20380119T031407</expiresAt> <sentAt>20010509T130502</sentAt> </properties> </SOAP-ENV:Header>
SRMP Services <services SOAP-ENV:mustUnderstand="1"> <durable/> <deliveryReceiptRequest> <sendTo> http://www.we-love-books.org/receipts </sendTo> </deliveryReceiptRequest> <commitmentReceiptRequest> <sendTo> http://www.we-love-books.org/deliverydone </sendTo> <negativeOnly/> </commitmentReceiptRequest> </services>
SRMP Streams <stream SOAP-ENV:mustUnderstand="1"> <streamId> uuid:84b9f5d0-33fb-4a81-b02b-5b760641c1d6 </streamId> <current>1</current> <start> <sendReceiptsTo> http://sender/streamAcks/ </sendReceiptsTo> </start> </stream> <stream SOAP-ENV:mustUnderstand="1"> <streamId> uuid:84b9f5d0-33fb-4a81-b02b-5b760641c1d6 </streamId> <current>7</current> <previous>5</previous> </stream>
SRMP ExtensibilityMSMQ support for extensibility • MSMQ creates the SRMP elements • When destination format name is URL • Receive-side applications can access the message as XML document • SoapEnvelope, CompoundMessage • Send-side applications can extend the SOAP message • SoapHeader, SoapBody
Reliable Web MessagingRedirecting SRMP messages • HTTP requests can be redirected • SRMP must support redirection • Redirecting SRMP messages requires store and forward • MSMQ 3.0 supports store, redirect and forward • Using XML files for “mapping” • Message content does not change
Reliable Web MessagingMapping file • <from> • External (known) name of the destination • <to> • Local resolution for the destination <redirections> <redirection> <from>https://z.com/msmq/orders</from> <to>https://server1/msmq/q1</to> </redirection> </redirections>
Reliable Web MessagingRouting SRMP messages • Enterprise: MSMQ uses Active Directory for dynamic routing • MSMQ does not use Active Directory to resolve DIRECT format name • Redirect mapping allows connectionless SRMP messaging • Useful for workgroup mode as well MSMQ host Mapping table Receiver Sender
Agenda • Reliable 1-N Messaging • Distribution Lists • Reliable Multicast • Reliable Internet Messaging • Messaging Over SOAP/HTTP • Firewalls and Load Balancing • Admin API • Deployment and Storage • Triggers
Secure Web MessagingRequirements • Do not allow direct TCP sessions from Internet to Intranet • Do not expose names of internal resources: computers, queues • Do not store sensitive data on computers in the DMZ • Do not forward unauthenticated messages from DMZ to Intranet
Secure Web MessagingTopology Intranet Internet DMZ <sendReceiptsTo> http://my_company.com/receipts </sendReceiptsTo> HTTP Proxy https://your_company.com/acks MSMQ Server MSMQ Client https://my_company.com/orders Authenticate Map Store Forward https://ic/msmq/InQueue Firewall Firewall
Reliable Web MessagingNLB Overview • Network load balancing solutions: • Hardware (e.g. Cisco LocalDirector) • DNS round-robin • Windows Network Load Balancing • NLB assumes state-less services • Seamless for low QoS messaging apps • Special solution required for high QoS messaging apps
Reliable Web MessagingNLB: Low QoS messaging Node1 My_MSMQ_App Node2 My_MSMQ_App NLB DIRECT=HTTP://NLB_URL/MSMQ/q1 or DIRECT=TCP:<NLB_IP>\q1 (works also on Windows 2000) Node3 My_MSMQ_App NLB Cluster
Reliable Web MessagingNLB: High QoS messaging Node1 Q1->client1\q1 Q2->client2\q9 MSMQ Client1 App_inqueue Node2 Q1->client1\q1 Q2->client2\q9 NLB MSMQ Client2 App_orders Node3 Q1->client1\q1 Q2->client2\q9 NLB Cluster
Agenda • Reliable 1-N Messaging • Distribution Lists • Reliable Multicast • Reliable Internet Messaging • Messaging Over SOAP/HTTP • Firewalls and Load Balancing • Admin API • Deployment and Storage • Triggers
Admin APIOverview • Programmable control of MSMQ objects: • MSMQ service • Application queues • Internal transmission queues • Local and remote • COM object model • Add-on available for MSMQ 2.0
Admin APIExtension to existing objects • MSMQApplication extensions includes: • ActiveQueues • PrivateQueues • DirectoryServiceServer • IsConnected • UsedQuota • Connect • Disconnect • Machine (can manage remote hosts) • MSMQQueue extension: • Purge
Admin APINew objects • MSMQManagement: base class for outgoing and target queues • Machine • FormatName • MessageCount • QueueType (private, public, …) • MSMQOutgoingQueueManagement • NextHops (routing info) • EodGetSendInfo (transaction info) • EodResend (transactional protocol) • Pause • Resume • MSMQQueueManagement • UsedQuota • EodGetReceiveInfo (transaction info)
Admin APICode example • Pause an outgoing queue on “RemoteMachine”, inspect its content and resume it. Dim qmgmt as New MSMQManagement qmgmt.Init Machine:=“RemoteMachine”, PathName:=“TargetMachine\q” Dim outqmgmt as MSMQOutgoingQueueManagement Set outqmgmt = qmgmt outqmgmt.Pause MsgBox “messages in q:” & outqmgmt.MessageCount outqmgmt.Resume
Agenda • Reliable 1-N Messaging • Distribution Lists • Reliable Multicast • Reliable Internet Messaging • Messaging Over SOAP/HTTP • Firewalls and Load Balancing • Admin API • Deployment and Storage • Triggers
Storage & DeploymentEnterprise deployment • Simplify MSMQ requirements in Active Directory environment: • No MSMQ servers on domain controllers • MSMQ clients access Active Directory directly via LDAP • Old requirements still apply for NT 4.0 and Windows 2000 clients
Existence & Authentication MSMQ Open queue on recipient for send Sender Recipient Storage & DeploymentNo deployment on DC Any Domain Controller
Storage & DeploymentUnlimited storage • Problem: MSMQ 1.0/2.0 message store: 2 GB limitation • Win64 doesn’t solve • Goal: lift the 2 GB limit • Implementation: Extend the current MSMQ proprietary message store • Non-goal: Solve the 4 MB message size limit
Agenda • Reliable 1-N Messaging • Distribution Lists • Reliable Multicast • Reliable Internet Messaging • Messaging Over SOAP/HTTP • Firewalls and Load Balancing • Admin API • Deployment and Storage • Triggers