status-code: 401, status-description: InvalidSignature: The token has an invalid signature. If the connection string is not valid because of invalid SharedAccessKeyName or SharedAccessKey, you will get an exception of type System.UnauthorizedAccessException with the following message: Put token failed. Put token failed: the token has an invalid signature The reason is pretty straightforward: the resource you are trying to use does not exist: by resource I mean Queue, Topic, and Subscription.Īgain, that exception is thrown only when interacting directly with Azure Service Bus. status-code: 404, status-description: The messaging entity 'X' could not be found. Put token failed: The messaging entity X could not be foundĪnother message you may receive is Put token failed. You can perform all the operations you want without receiving any error until you really access the resources on the Bus. I was expecting it to be thrown when initializing the ServiceBusClient instance, but it is actually thrown only when a message is being sent using SendMessageAsync. So we can easily understand why this error happens: that host name does not exist (or, more probably, there's a typo).Ī curious fact about this exception: it is thrown later than I expected. Let's recall that a connection string has a form like this:Įndpoint=sb:/// SharedAccessKeyName=myPolicy SharedAccessKey=myKey To introduce the exceptions, we'd better keep at hand the code we used in the previous examples. Then, a different application that is listening for notifications on the Topic, reads the message and performs some dummy operations. Just to recap the context, our system receives orders for some pizzas via HTTP APIs, processes them by putting some messages on a Topic on Azure Service Bus. In the previous parts, we've seenįor this article, we're going to introduce some errors in the code we used in the previous examples. This is the last part of the series about Azure Service Bus. We will look at simpler errors, the ones you get if configurations on your code are wrong, or you've not declared the modules properly then we will have a quick look at Dead Letters and what they represent. Public Task Handle(MapPlanDetailsFromPlanDocument message, IMessageHandlerContext context)Ĭonsole.WriteLine("Handling message.In this article, we are gonna see which kind of errors you may get on Azure Service Bus and how to fix them. Public class MapPlanDetailsFromPlanDocumentConsumer : IHandleMessages Var conventions = endpointConfiguration.Conventions() Ĭonventions.DefiningCommandsAs(type => type.Namespace = "") Ĭonventions.DefiningEventsAs(type => type.Namespace = "") implement an nServiceBus interface (eg. database tables, queues, directories, etc.) are created and nServiceBus needs to know the type of message (command, event, etc.). EnableInstallers() // Installers ensure that endpoint-specific artifacts (e.g. Var endpointConfiguration = new EndpointConfiguration(endPointName) Here’s my endpoint config: var endPointName = "mapplandetailsfromplandocument" I would like to start by shutting down one of those consumers and plugging in a NServiceBus Handler to handle the message instead. Our current architecture is built on a MassTransit saga that sends commands to various consumers based on incoming events. I am currently working on a POC to integrate NServiceBus into our existing architecture. Now that the organization has bought into a distributed architecture, I would like to evaluate other technologies (including paid options) to see what they have to offer. We opted to take the path of least resistance (free options) and built it on MassTransit and RabbitMq. Our team introduced the first distributed architecture in our organization.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |