Giter Club home page Giter Club logo

queues-topics's Introduction

Queues and Topics

Usage of queues and topics on cloud providers Azure and AWS and local RabbitMQ instance in Asp.Net Core API

Iac Folder

Files to create infrastructure on cloud providers Azure and AWS through deployment of ARM Templates and Cloud Formation respectively. This folder have two subfolders:

aws-cloudformation: template and parameters file to create on AWS: one queue (SQS) and one topic (SNS) with two queues, on AWS topics relates to many types of subscriptions as we want integrate two systems the choice was queues.

azure-arm: template and parameters file to create on Azure Service Bus: one queue and one topic with two subscriptions, each subscription have one filter so the messages that arrive will not send to all consumers, removing these filters all subscriptions receive a copy from every message.

src Folder

QueuesTopics.Service: Project to send messages to message brokers

QueuesTopics.Service.Test: Project to test the integration between services and message brokers.

Parameters Files and AppSettings

For resources on cloud providers both parameters file have fields to put queue and topic names, these names must to be the same present on appsettings.json file, section ResourceName, keys Queue and Topic. On RabbitMQ, the queue and topic have to be the same name as well, but it doesn't have a parameter file, their resources should be created by RabbitMQ Management or CLI.

  • aws_sqs_sns.parameters.json file
[
	{
		"ParameterKey": "QueueName",
		"ParameterValue": "pessoa-queue"
	},
	{
		"ParameterKey": "TopicName",
		"ParameterValue": "pessoa-topic"
	}
]
  • servicebusdeploy.parameters.json file
...
  "queue_name": {
      "value": "pessoa-queue"
  },
  "topic_name": {
      "value": "pessoa-topic"
  }
...
  • appsettings.json file
"ResourceName": {
	"Queue": "pessoa-queue",
	"Topic": "pessoa-topic"
}

After deploy the files to ARM template on Azure and CloudFormation on AWS, some output parameters should be get to fill values on appsettings file. However, for RabbitMQ must be filled the hostname and credentials.

ARM Template - Azure

Executing via PowerShell get the NamespaceConnectionString output value and put on the blank value for ServiceBusConnectionString key

...
"ConnectionStrings": {
	"ServiceBusConnectionString": ""
}
...

CloudFormation - AWS

AWS CloudFormation has two ouputs one for Queues and another for Topics. Go to CloudFormation console, access the stack created and Outputs tab.
Get the value from key QueueURL and set value for ServiceURL key on section AWSSQSService.

"AWSSQSService": {
	"Profile": "sqs_profile",
	"ServiceURL": ""
}

For topics, pick up PessoaTopicArn value and set value for TopicArn key on section AWSSNS.

"AWSSNS": {
	"TopicArn": ""
}

RabbitMQ

For RabbitMQ the RabbitMQ section has to filled with the hostname and access credentials, once the queue and topic were created earlier and they respect the ResourceName section subkey values

"RabbitMQ": {
	"HostName": "",
	"UserName": "",
	"Password": ""
}

queues-topics's People

Contributors

jean-passos avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.