Microsoft Azure AZ 305 (15 Blogs) Become a Certified Professional

What is Azure Service Bus?-What Why How?

Last updated on Aug 30,2024 1.1K Views

Tanishqa Chaudhary
An intellectual brain with a strong urge to explore different upcoming technologies,... An intellectual brain with a strong urge to explore different upcoming technologies, learn about them, and share knowledge.

It’s possible that an application will need to send configuration data or files to other apps or services. The correct management of data transfer can be a severe concern when there are several applications and services that are dependent on each other. This data transit between Apps, services, and users is critical and must be properly managed. This data transport is aided by Azure Service Bus, which is a messenger.

Azure is a scalable and adaptable cloud computing service that was first proposed in 2008, then introduced in 2010 as Windows Azure before being renamed Microsoft Azure in 2014. Unlike traditional IT infrastructure, which needs you to operate on-premises servers, Azure is cloud-based, allowing you to design, run, and manage your apps using a Microsoft-managed global cloud storage site. Azure has more compliance certifications than other cloud providers and hosts over 200 products and cloud services, including Azure Service Bus, a messaging service.

 

What is an Azure Service Bus?

Microsoft Azure Service Bus is an enterprise message broker with queues and publish-subscribe topics that is completely managed (in a namespace). In a nutshell, it is a message broker that simplifies the transit of messages. It has queues, topics and subscribers, namespaces, and other features that aid in message delivery. It is fully managed, which means users do not have to log in and configure it. Topics and Message Queues provide for the versatile processing of message transmission between applications and services, allowing the apps to function effectively and address data transfer difficulties. The Service Bus also enables applications and services to function independently, resulting in lower resource consumption and fewer points of failure.

Find out our Azure Architect Training in Top Cities/Countries

IndiaOther Cities/Countries
BangaloreToronto
HyderabadSingapore
ChennaiDubai
PunePhilippines

Why Azure Service Bus?

Software communicating to other software is the essence of application integration. However, how should this communication take place? A direct connection via API Management is sometimes the best option. This synchronous mode of communication, on the other hand, will not function in all situations. What if, for example, both applications aren’t available at the same time? An asynchronous method is essential in instances like these. Service Bus is designed to facilitate this type of communication. Service Bus facilitates non-blocking interactions between different pieces of software since it allows programs to exchange messages through queues.

Azure Service Bus Properties

properties to meet the business needs.

Message sessions
To realize a first-in, first-out (FIFO) guarantee in Service Bus, use sessions. Message sessions enable joint and ordered handling of unbounded sequences of related messages.

Auto-forwarding
The auto-forwarding feature enables you to chain a queue or subscription to another queue or topic that is part of the same namespace. When auto-forwarding is enabled, Service Bus automatically removes messages that are placed in the first queue or subscription (source) and puts them in the second queue or topic (destination).

Dead-lettering
Azure Service Bus supports a dead-letter queue (DLQ) to hold messages that cannot be delivered to any receiver, or messages that cannot be processed. You can then remove messages from the DLQ and inspect them.

Scheduled delivery
You can submit messages to a queue or topic for delayed processing; for example, to schedule a job to become available for processing by a system at a certain time.

Message deferral
When a queue or subscription client receives a message that it is willing to process, but for which processing is not currently possible due to special circumstances within the application, the entity has the option to defer retrieval of the message to a later point. The message remains in the queue or subscription, but it is set aside.

Batching
Client-side batching enables a queue or topic client to delay sending a message for a certain period. If the client sends additional messages during this time period, it transmits the messages in a single batch.

Transactions
A transaction groups two or more operations together into an execution scope. Azure Service Bus supports grouping operations against a single messaging entity (queue, topic, subscription) within the scope of a transaction.

Filtering and actions
Subscribers can define which messages they want to receive from a topic. These messages are specified in the form of one or more named subscription rules. For each matching rule condition, the subscription produces a copy of the message, which may be differently annotated for each matching rule.

Auto-delete on idle
Auto-delete on idle enables you to specify an idle interval after which the queue is automatically deleted. The minimum duration is 5 minutes.

Partitioned
Service Bus partitions enable queues and topics, or messaging entities, to be partitioned across multiple message brokers and messaging stores. Partitioning means that the overall throughput of a partitioned entity is no longer limited by the performance of a single message broker or messaging store. In addition, a temporary outage of a messaging store does not render a partitioned queue or topic unavailable. Partitioned queues and topics can contain all advanced Service Bus features, such as support for transactions and sessions.

Duplicate detection
If an error occurs that causes the client to have any doubt about the outcome of a send operation, duplicate detection takes the doubt out of these situations by enabling the sender to re-send the same message, and the queue or topic discards any duplicate copies.

Architecture

Queues, topics, and relays are the three types of communication mechanisms available in Azure Service Bus. Queues and Topics make one-way communication easier. Messages will be kept indefinitely until they are eaten. A single receiver receives each message in Queue. Various subscriptions for multiple receivers are possible for a topic. Subscriptions can select the messages they want to receive depending on criteria. Service bus-defined messaging APIs or REST APIs can be used to obtain messages from Queues and Topics. Other languages’ SDKs are also available. Relays, unlike Queues and Topics, allow bi-directional communication without storing messages.

Users must create a namespace under their Azure subscription in order to access these messaging services. A namespace may be thought of as a logical storage area for messaging components. Within a single Service Bus component (queues, topics, and relays), many Service Bus components (queues, topics, and relays) can be found within a single namespace.

Architecture

Azure Service Bus Concept

This section discusses basic concepts of Service Bus.

  • Namespaces

All communications components are contained in a namespace (queues and topics). A single namespace can include several queues and topics, therefore namespaces are frequently used as application containers.

In the vocabulary of other brokers, a namespace can be likened to a server, although the ideas are not exactly identical. A Service Bus namespace is a capacity slice of a huge cluster that consists of dozens of all-active virtual machines. It may span up to three Azure availability zones if desired. As a result, you receive all of the benefits of running the message broker at massive scale in terms of availability and resilience. You also don’t have to be concerned with underlying complexity. Serverless messaging is what Service Bus is all about.

  • Queues 

Queues are used to send and receive messages. Messages are stored in queues until the receiving program is ready to accept and process them.
On arrival, messages in queues are organized and timestamped. If the namespace is zone-enabled, the message is always kept durably in triple-redundant storage once it has been accepted by the broker. After messages have been accepted by the client, Service Bus never keeps them in memory or volatile storage.

Messages are sent in a pull manner, which means they are only sent when they are requested. Unlike some other cloud queues’ busy-polling architecture, the pull operation might be long-running and only finish after a message is accessible.

  • Topics

Topics can be used to transmit and receive messages. Topics are helpful in publish/subscribe contexts, where a queue is commonly utilized for point-to-point communication. Multiple, independent subscriptions can be attached to a subject and behave in the same way as queues from the receiver’s perspective. Each message sent to a subject can be received by a subscriber to that topic. Subscriptions are referred to as named entities. Subscriptions are persistent by default, however they can be set to expire and then be erased automatically. Service Bus Premium additionally lets you build volatile subscriptions that last for the duration of the connection using the Java Message Service (JMS) API.

Comparison btw Queues vs Topics

QueuesTopics
Multiple receivers can be added to the queue, but each message will only be sent to one of them.The messages can be received by numerous recipients (subscribers), and each message copy can be delivered to any number of subscribers linked with the Topic.
Because the messages are only received by one person, queues do not require any filters.A collection of attributes can be attached to each message broadcast across a Topic. When a custom subscription filter is applied, properties are utilized.
You’re still limited to having only one customer listening if you need to scale a queue.Because more than one consumer can listen for messages, topics can be more scalable than queues. The Topic does not need to be recreated. When a new subscription is formed, all new messages submitted to that Topic are also received by the new subscriber.
Messages can be automatically routed to a Queue or Topic. However, a Topic Subscription cannot be the destination.Messages can be sent automatically from a Topic to a Queue or another Topic. Additionally, messages from a Topic Subscription can be sent to a Queue or Topic.
The first receiver who finishes reading the message also removes it from the Queue, preventing further readers from processing it.The message is removed only after every receiver has processed the message. When the message is read from all the Subscribers, the message is removed from the Topic too.
If you need to pass a message in a one-to-one system, go with Service Bus Queues.If you need to deliver a message to numerous systems, choose Service Bus Topics.

Conclusion

Therefore Microsoft Service Bus (Microsoft Service Bus) Because the messaging service offers so many features, we won’t be able to cover them all in a single post. Paired Namespaces, AMQP support, Partitioned Queues, and many other features are available. In brief, Azure Service Bus enables us to create loosely linked software components with minimal deployment effort and great communication scalability and availability. It allows the architect/developer to design various communication situations by offering three distinct sorts of services.  Learn more about Azure Cloud Engineer Course which will help you get certified, and thus help you chase your dream work profile.

If you want to learn more about Azure then I recommend you to watch this video:

I hope you found this Azure Service Bus useful. The subjects covered in this blog are the most wanted skill sets required by professionals. If you are interested in mastering Azure, please visit our Edureka website and enroll Azure Solution Architect Course.

Upcoming Batches For Azure Certification Training
Course NameDateDetails
Azure Certification Training

Class Starts on 25th January,2025

25th January

SAT&SUN (Weekend Batch)
View Details
Azure Certification Training

Class Starts on 29th March,2025

29th March

SAT&SUN (Weekend Batch)
View Details
Comments
0 Comments

Join the discussion

Browse Categories

webinar REGISTER FOR FREE WEBINAR
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP

Subscribe to our Newsletter, and get personalized recommendations.

image not found!
image not found!

What is Azure Service Bus?-What Why How?

edureka.co