diff --git a/101-integrationpatterns-messagerouter-servicebus/README.md b/101-integrationpatterns-messagerouter-servicebus/README.md new file mode 100644 index 000000000000..9df2570d5192 --- /dev/null +++ b/101-integrationpatterns-messagerouter-servicebus/README.md @@ -0,0 +1,31 @@ +# Integration Patterns - Message Router - Service Bus + + + + + + + + +## Solution overview and deployed resources + +This template deploys a solution which shows how we can set up the Message Router pattern using a Service Bus Topic. The topic expects a message with a property called *Priority*. The message is then routed to the *Log* subscription as well as the subscription belonging with the given priority. + +The following resources are deployed as part of the solution. + ++ **Service Bus Namespace** ++ **Service Bus Topic** ++ **Service Bus Topic Subscriptions** ++ **Service Bus Topic Subscriptions Rules** + +To test, grab the connection string of the Service Bus namespace, and use a tool like Service Bus Explorer to send a message to the topic. The message to be sent in should be in the following format, and with a property called *Priority*, with value *High*, *Normal* or *Low*. + +```json +{ + "Address":"Wilhelminakade 175", + "City":"Rotterdam", + "Name":"Eldert Grootenboer" +} +``` + +`Tags: Service Bus, Integration Patterns, Service Bus Topics, Message Router, ServiceBus, IntegrationPatterns` \ No newline at end of file diff --git a/101-integrationpatterns-messagerouter-servicebus/azuredeploy.json b/101-integrationpatterns-messagerouter-servicebus/azuredeploy.json new file mode 100644 index 000000000000..7d6c8c433426 --- /dev/null +++ b/101-integrationpatterns-messagerouter-servicebus/azuredeploy.json @@ -0,0 +1,197 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "IncomingDeliveryRequestsTopicname": { + "type": "string", + "defaultValue": "incomingdeliveryrequests", + "metadata": { + "description": "The name for the Service Bus Topic." + } + }, + "MessageRouterServiceBusnamespacePrefix": { + "type": "string", + "defaultValue": "MessageRouterServiceBus", + "metadata": { + "description": "The prefix of the name for the Service Bus namespace, will be appended with a unique string." + } + } + }, + "variables": { + "serviceBusnamespacename": "[concat(parameters('MessageRouterServiceBusnamespacePrefix'), '-', uniquestring(resourceGroup().id))]" + }, + "resources": [ + { + "type": "Microsoft.ServiceBus/namespaces", + "apiVersion": "2015-08-01", + "name": "[variables('serviceBusnamespacename')]", + "location": "[resourceGroup().location]", + "dependsOn": [], + "kind": "Messaging", + "sku": { + "name": "Standard", + "capacity": 1, + "tier": "Standard" + } + }, + { + "type": "Microsoft.ServiceBus/namespaces/topics", + "apiVersion": "2015-08-01", + "name": "[concat(variables('serviceBusnamespacename'), '/', parameters('IncomingDeliveryRequestsTopicname'))]", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[resourceId('Microsoft.ServiceBus/namespaces', variables('serviceBusnamespacename'))]" + ], + "properties": { + "defaultMessageTimeToLive": "14.00:00:00", + "enableBatchedOperations": false, + "enableExpress": false, + "enablePartitioning": true, + "enableSubscriptionPartitioning": false, + "filteringMessagesBeforePublishing": false, + "isAnonymousAccessible": false, + "isExpress": false, + "maxSizeInMegabytes": 1024, + "requiresDuplicateDetection": false, + "sizeInBytes": 0, + "supportOrdering": false + } + }, + { + "type": "Microsoft.ServiceBus/namespaces/topics/subscriptions", + "apiVersion": "2015-08-01", + "name": "[concat(variables('serviceBusnamespacename'), '/', parameters('IncomingDeliveryRequestsTopicname'), '/HighPriority')]", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[resourceId('Microsoft.ServiceBus/namespaces', variables('serviceBusnamespacename'))]", + "[resourceId('Microsoft.ServiceBus/namespaces/topics', variables('serviceBusnamespacename'), parameters('IncomingDeliveryRequestsTopicname'))]" + ], + "properties": { + "deadLetteringOnFilterEvaluationExceptions": false, + "deadLetteringOnMessageExpiration": true, + "defaultMessageTimeToLive": "14.00:00:00", + "enableBatchedOperations": false, + "lockDuration": "00:00:30", + "maxDeliveryCount": 10, + "requiresSession": false + }, + "resources": [ + { + "type": "Rules", + "apiVersion": "2015-08-01", + "name": "HighPriority", + "dependsOn": [ + "[resourceId('Microsoft.ServiceBus/namespaces/topics/subscriptions', variables('serviceBusnamespacename'), parameters('IncomingDeliveryRequestsTopicname'), 'HighPriority')]" + ], + "properties": { + "filter": { + "sqlExpression": "Priority='High'" + } + } + } + ] + }, + { + "type": "Microsoft.ServiceBus/namespaces/topics/subscriptions", + "apiVersion": "2015-08-01", + "name": "[concat(variables('serviceBusnamespacename'), '/', parameters('IncomingDeliveryRequestsTopicname'), '/Log')]", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[resourceId('Microsoft.ServiceBus/namespaces', variables('serviceBusnamespacename'))]", + "[resourceId('Microsoft.ServiceBus/namespaces/topics', variables('serviceBusnamespacename'), parameters('IncomingDeliveryRequestsTopicname'))]" + ], + "properties": { + "deadLetteringOnFilterEvaluationExceptions": false, + "deadLetteringOnMessageExpiration": true, + "defaultMessageTimeToLive": "14.00:00:00", + "enableBatchedOperations": false, + "lockDuration": "00:00:30", + "maxDeliveryCount": 10, + "requiresSession": false + }, + "resources": [ + { + "type": "Rules", + "apiVersion": "2015-08-01", + "name": "LogAll", + "dependsOn": [ + "[resourceId('Microsoft.ServiceBus/namespaces/topics/subscriptions', variables('serviceBusnamespacename'), parameters('IncomingDeliveryRequestsTopicname'), 'Log')]" + ], + "properties": { + "filter": { + "sqlExpression": "1=1" + } + } + } + ] + }, + { + "type": "Microsoft.ServiceBus/namespaces/topics/subscriptions", + "apiVersion": "2015-08-01", + "name": "[concat(variables('serviceBusnamespacename'), '/', parameters('IncomingDeliveryRequestsTopicname'), '/LowPriority')]", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[resourceId('Microsoft.ServiceBus/namespaces', variables('serviceBusnamespacename'))]", + "[resourceId('Microsoft.ServiceBus/namespaces/topics', variables('serviceBusnamespacename'), parameters('IncomingDeliveryRequestsTopicname'))]" + ], + "properties": { + "deadLetteringOnFilterEvaluationExceptions": false, + "deadLetteringOnMessageExpiration": true, + "defaultMessageTimeToLive": "14.00:00:00", + "enableBatchedOperations": false, + "lockDuration": "00:00:30", + "maxDeliveryCount": 10, + "requiresSession": false + }, + "resources": [ + { + "type": "Rules", + "apiVersion": "2015-08-01", + "name": "LowPriority", + "dependsOn": [ + "[resourceId('Microsoft.ServiceBus/namespaces/topics/subscriptions', variables('serviceBusnamespacename'), parameters('IncomingDeliveryRequestsTopicname'), 'LowPriority')]" + ], + "properties": { + "filter": { + "sqlExpression": "Priority='Low'" + } + } + } + ] + }, + { + "type": "Microsoft.ServiceBus/namespaces/topics/subscriptions", + "apiVersion": "2015-08-01", + "name": "[concat(variables('serviceBusnamespacename'), '/', parameters('IncomingDeliveryRequestsTopicname'), '/NormalPriority')]", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[resourceId('Microsoft.ServiceBus/namespaces', variables('serviceBusnamespacename'))]", + "[resourceId('Microsoft.ServiceBus/namespaces/topics', variables('serviceBusnamespacename'), parameters('IncomingDeliveryRequestsTopicname'))]" + ], + "properties": { + "deadLetteringOnFilterEvaluationExceptions": false, + "deadLetteringOnMessageExpiration": true, + "defaultMessageTimeToLive": "14.00:00:00", + "enableBatchedOperations": false, + "lockDuration": "00:00:30", + "maxDeliveryCount": 10, + "requiresSession": false + }, + "resources": [ + { + "type": "Rules", + "apiVersion": "2015-08-01", + "name": "NormalPriority", + "dependsOn": [ + "[resourceId('Microsoft.ServiceBus/namespaces/topics/subscriptions', variables('serviceBusnamespacename'), parameters('IncomingDeliveryRequestsTopicname'), 'NormalPriority')]" + ], + "properties": { + "filter": { + "sqlExpression": "Priority='Normal'" + } + } + } + ] + } + ] +} \ No newline at end of file diff --git a/101-integrationpatterns-messagerouter-servicebus/azuredeploy.parameters.json b/101-integrationpatterns-messagerouter-servicebus/azuredeploy.parameters.json new file mode 100644 index 000000000000..26d3308ce12e --- /dev/null +++ b/101-integrationpatterns-messagerouter-servicebus/azuredeploy.parameters.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": {} +} \ No newline at end of file diff --git a/101-integrationpatterns-messagerouter-servicebus/metadata.json b/101-integrationpatterns-messagerouter-servicebus/metadata.json new file mode 100644 index 000000000000..536403906659 --- /dev/null +++ b/101-integrationpatterns-messagerouter-servicebus/metadata.json @@ -0,0 +1,7 @@ +{ + "itemDisplayName": "Integration Patterns - Message Router - Service Bus", + "description": "Solution which shows how we can set up the Message Router pattern using a Service Bus Topic", + "summary": "Solution which shows how we can set up the Message Router pattern using a Service Bus Topic", + "githubUsername": "Eldert Grootenboer", + "dateUpdated": "2017-09-06" +} \ No newline at end of file