New features in Azure Service Bus SDK 2




New features in Azure Service Bus SDK 2. 0 April 2013 Shared Access Secrets (SAS) Auto-delete idle entities Event-driven model Task-based async APIs Browsing messages SDK 2. 1 July 2013 SDK 2. 2 Oct 2013 Visual Studio 2013 support AMQP 1. 0 support Partitioned queues and topics Paired namespaces Symmetric server and service AMQP client support for SAS auth SB 1. 1 Preview— 6/13 Interoperability with AMQP 1. 0 Shared Access Signature (SAS) auth model Including all SDK 2. 0 SB 1. 1 RTM— 10/18 Part of Windows Azure Pack Admin and tenant management portal SDK 2. 3 April 2014 On. Message. Session Connectivity. Mode Auto. Detect CORS support HTTP message batching Client side perf counters Forward. To for deadletter queues


Code (Windows—Orleans)/(Linux—Storm ) Service Bus Topics Dashboards State tracking (Az Table) Analytics Batch analytics (HDInsight) Telemetry fan-in to Service Bus Topics Load balanced across datacenters True filter for all but 1 subscriptions Real-time and batch analytics BI (Data warehouse)



HTTP 1 Entity per Socket 1 Pending Operation per Socket 60 s operation timeout (NAT/Prx) SBMP/AMQP Unlimited Multiplexed Entities and Unlimited Pending Ops per Socket No fixed operation timeout Session Support (coming in AMQP)

“SBMP” high perf. . NET only HTTP high reach lower perf. AMQP 1. 0 high perf high reach

AMQP § §


Windows Other platforms SBMP (net. tcp, proprietary) AMQP 1. 0 https: //github. com/windows. Azure/ /azure-sdk-for-java/ /azure-sdk-for-node/ /azure-sdk-for-php/ HTTP(S) Service Bus Queues & Topics AMQP 1. 0 Samples / Prototypes /azure-sdk-for-ruby/ HTTP(S) /azure-sdk-for-python/





Namespace. Manager nm = Namespace. Manager. Create. From. Connection. STring(my. C onn. String); // Create partitioned topic Topic. Description td = new Topic. Description(my. Topic. Name); td. Enable. Partitioning = true; nm. Create. Topic(td); // Create partitioned queue Queue. Description qd = new Queue. Description(my. Queue. Name); qd. Enable. Partitioning = true; nm. Create. Queue(qd);



§ § Queue

namespace. Manager. Create. Queue( new Queue. Description(queue. Name) { Requires. Session = true }); namespace. Manager. Create. Subscription( new Subscription. Description(topic. Name, sub. Name) { Requires. Session = true });

var msg = new Brokered. Message { Session. Id = session. Id, Properties = { { "Job. Id", job. Id }, { "Result", result } };

var qc = messaging. Factory. Create. Queue. Client(queue. Name); var session = reply. Queue. Client. Accept. Message. Session(session. Id); var msg = session. Receive(); or var session = reply. Queue. Client. Accept. Message. Session(); var msg = session. Receive(); or reply. Queue. Client. On. Message. Session(…)

Queue






Service Bus Topics VS Online Backend Team Foundation Services Topic per VS user Subscription per VS instance Always connected using AMQP Low latency notifications to IDEs Platforms with no native notification


§ § S Topic Sub Sub

§ § S Topic Sub Sub

§ § § Topi c Sub Sub

Topic. Description main. Topic = namespace. Manager. Create. Topic(“topic. Name"); namespace. Manager. Create. Subscription(“topic. Name", “Audit. Subscription"); namespace. Manager. Create. Subscription(“topic. Name", “Category 1 Subscription", new Sql. Filter(“Category = 1")); namespace. Manager. Create. Subscription(“topic. Name", “Category. Not 1 Subscription", new Sql. Filter(“Category <> 1")); Brokered. Message my. Message = new Brokered. Message(); my. Message. Properties. Add(“Category”, 1); or my. Message. Properties. Add(“Category”, 2); or my. Message. Properties. Add(“Category”, 3);

§ § S Topic Sub Sub

Topic. Description main. Topic = namespace. Manager. Create. Topic(“topic. Name"); namespace. Manager. Create. Subscription(“topic. Name", “Audit. Subscription"); namespace. Manager. Create. Subscription(T“topic. Name", "First. Subscription", new Sql. Filter("Address LIKE '%First%'")); namespace. Manager. Create. Subscription(T“topic. Name", “Second. Subscription", new Sql. Filter("Address LIKE '%Second%'")); Brokered. Message my. Message = new Brokered. Message(); my. Message. Properties. Add(“Address”, “First”); or my. Message. Properties. Add(“Address”, “Second”); or my. Message. Properties. Add(“Address”, “First, Second”);



Queue. Description destination. Q = new Queue. Description("my. Q 2"); Queue. Description source. Q = new Queue. Description("my. Q 1"); source. Q. Forward. To = “my. Q 2"; Namespace. Manager nm = Namespace. Manager. Create(); nm. Create. Queue(destination. Q); nm. Create. Queue(source. Q); //New in Azure SDK 2. 3 Queue. Description DLQTarget = new Queue. Description("DLQ"); nm. Create. Queue(DLQTarget); source. Q. Forward. Dead. Lettered. Messages. To = "DLQ"; nm. Create. Queue(source. Q);

Devices PC IIS (Node. js) Server § Browsers IIS (Node. js) Server Basic Devices IIS (Node. js) Server Service Bus Topic § IIS (Node. js) Server


Topic. Description topic. Description = new Topic. Description("my. Topic"); topic. Description. Auto. Delete. On. Idle = Time. Span. From. Minutes(30); namespace. Manager. Create. Topic(topic. Description);



Messaging. Factory mf = Messaging. Factory. Create(); mf. Retry. Policy = Retry. Exponential. Default; // retry on transient errors until the Operation. Timeout is reached mf. Retry. Policy = Retry. Policy. No. Retry; // disables retry for transient errors

Web / Frontend Roles Service Bus Namespace Worker / Backend Roles

Web / Frontend Roles Service Bus Namespace Service Bus Paired Namespace Worker / Backend Roles

Web / Frontend Roles Service Bus Namespace Worker / Backend Roles Syphon enabled Service Bus Paired Namespace

Web / Frontend Roles Service Bus Namespace Service Bus Paired Namespace Worker / Backend Roles

factory = Messaging. Factory. Create(SB_Primary_NS_Address); factory. Pair. Namespace. Async(new Send. Availability. Paired. Namesp ace. Options( secondary. Namespace. Manager: paired_NS_manager, messaging. Factory: paired_NS_factory, backlog. Queue. Count: 10, failover. Interval: Time. Span. From. Minutes(2), enable. Syphon: true )); factory. Open();



What’s new in Azure SDK 2. 3 Performance best practices Service Bus Authentication and Authorization Partitioned Queues & Topics Overview Documentation Tutorials Availability considerations Disaster recovery Service Bus for Windows Server Overview Developer Guide. NET Tutorial Java Tutorial


- Slides: 57