Skip to content

Instantly share code, notes, and snippets.

View clemensv's full-sized avatar
🏠
Working from home

Clemens Vasters clemensv

🏠
Working from home
View GitHub Profile
@clemensv
clemensv / sbfifo.md
Last active November 20, 2017 07:16

FIFO in Service Bus

The explantion below is taken out of the context of an internal email exchange, and while we already have product documentation about this topic, this also seemed worth sharing. The email context stated that the customer asked for string First-In-First-Out (FIFO) assurances, but without any specifics about their scenario. Scenarios for hard FIFO requirements are not very common, I might add:

"It’s usually helpful to ask the customer back on exactly why they want they want true in-order delivery, i.e. FIFO, and then look at the use-case.

Service Bus has a specific feature for helping with order assurances, namely Sessions.

Order preservation requires a grouping criterion for the sequence you need ordered, and it needs a mechanism that ensures that messages are delivered to a receiver in that order. That includes not only that the sequence sorting is observed, but that also that no messages go missing b

@clemensv
clemensv / DynamicSemaphoreSlim.cs
Created October 21, 2017 08:32
DynamicSemaphoreSlim
//---------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation.
//
// MIT license.
//---------------------------------------------------------------------------------
namespace ServiceBusPerfSample
{
using System;
using System.Threading;
@clemensv
clemensv / afdlist.csv
Last active September 2, 2017 12:14
Liste erstellt aus Resultat der Twittersuche ""#traudichdeutschland OR #afdwaehlen OR #grueneversenken OR #fdpversenken OR #cduversenken OR #spdversenken -#noafd"
We can't make this file beautiful and searchable because it's too large.
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name,Verified,Protected,Bio,Status,Location,URL
866335089273315328,2017-05-21 16:49:15 +0000,2017-09-01 16:30:39 +0000,447,3121,1,85,17,007michiko,Tired Joe,false,false,,"RT @Beatrix_vStorch: Warum fragt #wahlomat nicht nach Islam,4. Griechenlandpaket,Familiennachzug,GEZ,Bargeldabschaffung,aber nach Bafög, Nutztieren u Impfpficht?",,
619170508,2012-06-26 15:20:12 +0000,2017-09-01 19:16:18 +0000,5337,2965,8,394,384,01_charly01,charly 01,false,false,"Der Gipfel des Wahnsinns ist es,auf Veränderungen zu hoffen,ohne etwas zu verändern","RT @Junge_Freiheit: AfD-Spitzenkandidatin Weidel fordert, Bundeskanzlerin Merkel wegen Rechtsverstößen vor Gericht zu stellen. https://t.co/0yFXB6UAwx",,
259638173,2011-03-02 08:39:54 +0000,2017-09-02 10:22:41 +0000,4104,3699,3,21,35,0930uhr,Paul Müller,false,false,,RT @timm_ti: @Ralf_Stegner https://t.co/oBseoibV0w,,
2817931146,2014-09-18 21:24:53 +0000,2017-09-02 01:33:39 +0000,18690,30572,11,37
.svc file
--------------
<%@ ServiceHost Language="C#" Debug="true" Service="MyService.Service1" %>
using System.ServiceModel;
namespace MyService
{
[ServiceContract]
public class Service1
// Copyright (c) Microsoft.
// Licensed under the MIT license.
namespace ConsoleApplication6
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: Tahoma, Geneva, sans-serif;
}
div {
display: inline;

Azure Relay Hybrid Connections Protocol

Azure Relay is one of the key capability pillars of the Azure Service Bus platform. The Relay’s new "Hybrid Connections" capability is a secure, open-protocol evolution based on HTTP and WebSockets. It supersedes the former, equally named "BizTalk Services" feature that was built on a proprietary protocol foundation. The integration of Hybrid Connections into Azure App Services will continue to function as-is.

"Hybrid Connections" allows establishing bi-directional, binary stream

{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"servicebusNamespaceName": {
"type": "string",
"metadata": {
"description": "Name of the Event Hub namespace"
}
},
namespace Samples
{
using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
delegate T InstanceFactoryCallback<out T>();
@clemensv
clemensv / gist:639f832e5151482054f8
Last active August 29, 2015 14:06
"alias" classes in C# ?!
Thought experiment:
Listened to eight .NET Rocks episodes yesterday while driving. One episode was about C# 6.0 with Bill Wagner
(http://www.dotnetrocks.com/default.aspx?showNum=1029), another about DDD with Steve Smith and Julie Lerman
(http://www.dotnetrocks.com/default.aspx?showNum=1023) where they specifically also discussed DDD's notion of
an anti-corruption layer, which aims to provide a neutral zone between different domains. The combination of
the two episodes gave me the following idea which I'll jot down here quickly.
Don't go "you dont do that in DDD, because .." since that's not the point. The point is efficiency and avoiding
data copies. Also, I'm not planning on doing anything further with it, so if anyone wants to take this somewhere,