exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 6 question 8 discussion

Actual exam question from Microsoft's AZ-204
Question #: 8
Topic #: 6
[All AZ-204 Questions]

DRAG DROP -
You develop software solutions for a mobile delivery service. You are developing a mobile app that users can use to order from a restaurant in their area. The app uses the following workflow:
1. A driver selects the restaurants for which they will deliver orders.
2. Orders are sent to all available drivers in an area.
3. Only orders for the selected restaurants will appear for the driver.
4. The first driver to accept an order removes it from the list of available orders.
You need to implement an Azure Service Bus solution.
Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: Create a single Service Bus Namespace
To begin using Service Bus messaging entities in Azure, you must first create a namespace with a name that is unique across Azure. A namespace provides a scoping container for addressing Service Bus resources within your application.
Box 2: Create a Service Bus Topic for each restaurant for which a driver can receive messages.
Create topics.
Box 3: Create a Service Bus subscription for each restaurant for which a driver can receive orders.
Topics can have multiple, independent subscriptions.
Reference:
https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
NH
Highly Voted 4 years, 1 month ago
Create a single Service Bus Namespace. Create a single Service Bus Topic. Create a Service Bus subscription for each restaurant for which a driver can receive orders.
upvoted 175 times
lugospod
3 years, 4 months ago
One thing to note in this scenario if we have 20 drivers... and 19 of them are busy (talking to their spouse, ...) it will take 19 timeouts for that one order to finally get picked up by the 20th driver. So yes, this is less evil then the resto of the options, but still I would rather use queues so that each driver SEES all of the orders... by using subscriptions the driver doesnt have a list..s/he only sees the current message that was delegated by the round robin algorithm.
upvoted 1 times
...
BrettusMaximus
4 years ago
If you create a single topic, why bother creating a topic at all as it has all the data
upvoted 5 times
SnakePlissken
3 years, 12 months ago
Sorry BrettusMaximus, but I think you have to read the documentation about Service Bus first... There's a good reason that NH is highly voted! https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview
upvoted 1 times
kimalto452
3 years, 12 months ago
SnakePlissken you need read better documentation) There no reason for have only one topic...
upvoted 3 times
...
coffecold
2 years, 6 months ago
Please come with the phrase in the article that one topic is the way to go instead of multiple topics. Still I would go for one topic per restaurant.
upvoted 2 times
...
...
ferut
3 years, 11 months ago
I agree with BrettusMaximus. Although one topic is workable but multiple topics are more efficient. Consider the 1 topic scenario. On the driver's application, it will remember the restaurants it subscribes. Because there's only one topic, the app will receive all messages from all restaurants, and the app should filter out messages not in interest. When using multiple topics, the driver's queue will be much cleaner, receiving only messages of interest. All drivers subscribe to the same restaurant will receive the same message. Basically each driver will have their own queue and the message will be deleted from the queue once it's processed. I think the 'removing' part should be a separate message sent to all subscribers (finally only the restaurant can remove it from the list upon accepting a driver's request).
upvoted 5 times
lugospod
3 years, 4 months ago
in this case you get a concurrency problem.. because now you introduced an additional layer of deciding which DRIVER clicked first, and additional component that has to notify the rest of the drivers that the message they received is no longer valid or introduce a new API to check if the order is still valid.. all in all, smells...
upvoted 1 times
...
...
...
MiraA
3 years, 7 months ago
Note there is a limit of "Number of subscriptions per topic" set to "2,000 per-topic for the Standard tier and Premium tier.". https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#service-bus-limits Does this mean 2.000 restaurants at most? :-)))
upvoted 2 times
mattvasc
3 years, 2 months ago
Did you mean 2.000 drivers at most?
upvoted 4 times
...
...
sashasasha
3 years, 11 months ago
If you create a single Service Bus Topic, two different drivers who subscribed to the same restaurant will each receive a copy of the order that could process independently and it's in conflict with the condition: "4. The first driver to accept an order removes it from the list of available orders."
upvoted 5 times
jay158
3 years, 11 months ago
In fact all the drivers, who have subscribed to restaurant will get notification. The first driver, who accepts it, will click the order, and it shall be dequeued.
upvoted 12 times
hstml
3 years, 8 months ago
That is completely correct. This question is also in Whizlabs where the explanation is the same as jay158s.
upvoted 2 times
...
lugospod
3 years, 4 months ago
No it won't get dequeued because this is not a queue. There is no option for SUBSCRIPTION PER DRIVER, only PER RESTAURANT or a SINGLE subscription. So only SINGLE listener will receive the notification and until s/he accepts it, rejects it or it times out no one else will see the message. If this were a QUEUE than it would be as you described. This question sucks on so many levels - too many open questions arise to be able to give a valid response, plus, the final one, I would rather use queues for this problem then subscriptions...
upvoted 4 times
...
...
coffecold
2 years, 6 months ago
Why ? One order is placed solely with the restaurant topic applicable. No copy. Then one subscriber locks the message, and then deletes it. Once locked it cannot be accessed by other subscribers.
upvoted 2 times
...
...
...
Opimer
Highly Voted 4 years, 1 month ago
Correct. If you create only one topic there won't be any filtering of messages depending on the restaurant. So every driver will have access to all the the orders. With a topic by restaurant, message from one restaurant will go to only one topic, from which the driver can choose to subscribe.
upvoted 18 times
Phenr
4 years, 1 month ago
I don't think that's correct. You can filter the messages on subscription, so the subscription can get a message from a specific restaurant even with just one topic created.
upvoted 9 times
rdemontis
4 years, 1 month ago
Exactly and creating one topic for each restaurant doesn't cover two of the four requirements: - "Orders are sent to all available drivers in an area" - "The first driver to accept an order removes it from the list of available orders" This means that one restaurant can be server by more drivers. So how can you think to manage order acceptance from one driver if you duplicate the same in more topics? It's a big deal that cause a lot of overwork not necessary. It's all simpler by managing all orders with a topic and using the filters for each subscription to allow drivers to view only the orders that compete with them. I also inform you that on a paid test platform such as https://www.testpreptraining.com/ there is the same question and the correct answer requires only one topic.
upvoted 7 times
kwaazaar
4 years, 1 month ago
so how would the driver remove the order if he has his own subscription? The order would still be visible in other subscriptions.
upvoted 1 times
anvimi
4 years ago
multiple drivers can share a single restaurant subscription thus only one driver will handle an order
upvoted 3 times
...
...
mandynotmandy
3 years, 2 months ago
exactly, you cant have each driver on their own sub because that duplicates the orders into each sub queues, meaning one guy accepts the order, another guy still sees it in their own sub queue. the subs has to be on restaurant level, and you can do that by filters on the sub
upvoted 1 times
...
...
...
coffecold
2 years, 6 months ago
I agree. A driver (subscriber) can subscribe to a topic once he is near the restaurant and un-subscribe if he is at a distance. I don't get the high vote of NH.
upvoted 2 times
...
...
Vichu_1607
Most Recent 7 months, 2 weeks ago
The correct sequence of actions to implement an Azure Service Bus solution for this scenario would be: 1. Create a single service bus Namespace: A namespace is a container for all messaging components. It provides a unique scoping container, in which you can create queues, topics, and subscriptions. 2. Create a single service bus topic: A topic is a communication channel in Azure Service Bus that sends messages to multiple subscriptions. In this case, orders are sent to the topic. 3. Create a service bus subscription for each restaurant for which a driver can receive orders: A subscription is a named, independently configurable entity within a topic. Each driver can have a subscription for each restaurant they deliver for, allowing them to receive only the orders for those restaurants.
upvoted 1 times
...
FeriAZ
1 year, 3 months ago
Create a single Service Bus Namespace. Create a single Service Bus Topic. Create a Service Bus subscription for each restaurant for which a driver can receive orders. Topics are used for one-to-many communication with multiple subscribing systems. By creating a topic for each restaurant, you can efficiently route messages (orders) to drivers who have selected that they will deliver orders for those restaurants. This setup allows for orders to be sent to a specific set of drivers (those interested in deliveries for a particular restaurant).
upvoted 1 times
...
arunkuml
1 year, 5 months ago
Got it in the exam 14/12/23. Went with provided answer. Scored 912/1000. All questions are from ExamTopics. Case study - VanArsdel, Ltd (11 questions)
upvoted 1 times
...
Weam
1 year, 5 months ago
Create a single Service Bus Namespace. Create a single Service Bus Topic. Create a Service Bus subscription for each restaurant for which a driver can receive orders. Explanation: we create different topics if we are having different categories of messages such as Consider an e-commerce platform that handles order notifications, inventory updates, and customer support messages. Using separate topics, such as "order-notifications," "inventory-updates," and "customer-support-messages," allows for clear separation of message categories and efficient routing to respective consumers. However in this case, we don't have different topics, we only have one topic which is order processing and we can enable partioning on this topic so messages can be under the same partion with the restaurant id
upvoted 3 times
...
AndySmith
1 year, 6 months ago
On exam 3-Nov-2023. Went with most-voted answer - 932/1000. 1) single namespace 2) single topic 3) subscription for each restaurant.
upvoted 2 times
...
jaf19f
1 year, 9 months ago
I got this question (12-Aug-2023) and I chose the given answers - 932 passed
upvoted 4 times
...
juanckar
1 year, 10 months ago
This was on the exam (July 2023). Went with single/single/subscription for each restaurant. Scored 917
upvoted 4 times
...
warchoon
2 years, 2 months ago
Correct 1: Namespace is about the solution 2: Topics are about restaurant messages 3: Subscriptions are about driver's orders
upvoted 3 times
...
apparaog99
2 years, 4 months ago
Got in exam 12/31
upvoted 2 times
...
elequiel
2 years, 6 months ago
Got it in exam 20/10/2022
upvoted 5 times
...
bipinboops
2 years, 8 months ago
The provided answer is the most correct. There is a 2000 subscription limit for topics, so you would only allow 2000 drivers TOTAL for the entire app if you chose this as a solution. You need one topic per restaurant or the application cannot scale. You can absolutely have 1 topic, that will still work as intended, it's just not the best solution. Source: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#service-bus-limits
upvoted 3 times
...
zhongzi
2 years, 11 months ago
It's the same question in ESI. The given answer is the same as highly voted.
upvoted 1 times
...
AZ204Cert
3 years, 1 month ago
Got this on 04/05/22
upvoted 1 times
...
iamstudying
3 years, 1 month ago
BUDDIES, listen listen.. 1. Single Service Bus Namespace 2. Topic per restaurant (10k limit of restaurants). (A single topic would work, but requires subscription filters or another component to decide which drivers receive which restaurant orders. But this isn't specified so imo not an option) 3. Single subscription per topic. Each drivers who wants to deliver for a restaurant will periodically peek the subscription for messages (no lock, message not removed). Once they decide they want to deliver the order, they dequeue the message and away they go, other drivers who attempt to do so will not be able to. (At first, I also thought multiple subscriptions - but this introduces another complexity of syncing the orders across all the subscriptions if someone accepts the order delivery first... how can we notify other subscriptions? we can't.) All in all, agree the solution sucks a$$ but this is the best bet.
upvoted 6 times
coffecold
2 years, 6 months ago
Multi subscriptions (drivers) per topic. How can we notify other subscriptions?> the message is locked. https://learn.microsoft.com/en-us/rest/api/servicebus/peek-lock-message-non-destructive-read
upvoted 1 times
...
...
petitbilly
3 years, 2 months ago
Got it in exam 03/22
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago