-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure Service Bus emulator incompatibility #814
Comments
Good idea. The problem is as always that there has to be someone to implement it. Since the emulator only supports AMQP, you have to add |
The emulator is explicitly designed and provided for unit testing scenarios. Which, exercises code to work with messages and doesn't provide administrative functions that are leveraged by this tool as means of exploring namespace entities and messages. Why to force a square peg into a round hole? What would be the purpose of using SBE with a unit testing emulator? |
Personally I mainly use SBE to 'browse' queues / subscriptions to look at messages. For example if my application is not receiving a message, I use SBE to check if the message is actually in the queue / subscription. |
what do mean by SBE ? |
Exactly. SBE (Service Bus Explorer) is not a unit testing tool. It's a management tool intended for browsing entities and messages.
If there are volunteers to implement integration with the ASB emulator, that's a different story. |
I see two reasons for that. The first one is when developing and troubleshooting unit tests, to make you see what's actually happening. The other reason is to add more unit tests to SBE since a lot of more scenarios are now possible to test. Preferably the build pipeline should install and configure the emulator then. But it all goes back to someone implementing this. |
This one made me smile. Quantity, not quality. Testing is a PITA with SBE and has nothing to do with the emulator but because the SBE code base is not testable at its current state. Anyhow, just because something can be done, doesn't mean it should be done. The emulator has just gone out. Give it some time to settle, gain most of the features, and then re-evaluate what that connectivity would look like. Unless you've got time on your hands you're willing to donate. Then it's a different topic. |
I am thankful that this community project exists and for all your efforts. |
What the MSFT marketing team is putting out there is one thing. What the reality looks like is a different thing. You can beat me up with the quote from their documentation on how it's for development and testing, but this emulator is not ready for real development. No support for management operations - use an external static config JSON file. There is no support for SQL filters, and it can't even be worked around. There is no support for entity statistics - we need to augment that to be able to see something meaningful. So yeah, I stand behind my words. At this time, this is a testing emulator different from the emulator everyone expected. Now, regarding the topic of SBE, should SBE support a half-baked emulator? My answer is 'not yet'. But I don't get to decide because I'm not the project's owner, and it's ultimately up to the individuals to determine what they want to do with their time.
And that's what we do. But a discussion should have some objectives. I don't see a clear one on this thread. It's mostly "Hey, we could really use this functionality," ignoring the maturity state of the emulator. The SBE codebase has its skeletons in the closet. We shouldn't be adding piling up more.
I greatly appreciate every single contribution, including ideas. But ideas need to be based on reality. The emulator is a bleeding-edge ATM. Let it mature, stabilize, and gain features that would not require unnecessary throwaway investments into SBE. Maybe it will be almost effortless to get them to work together. I'll also mention this: If people care to use the emulator as a proper development emulator, they should raise and upvote issues for Microsoft to get the emulator on par with the real service. Such as SQL fileters, Admin functionality, etc. Work smart, not hard. |
These issues are not something that actually bothers me for local development. Entity Statistics are not relevant while developing, and you shouldn't be using SQL Filters if you have higher message volumes since they are slow. No management operations are annoying but I can understand since the emulator doesn't persist its state between restarts. And because in my company we manage the Service Bus infrastructure entirely via Terraform there is no need to alter things on-the-fly, so none of our applications actually have manage permissions anyway.
The current emulator is 'good enough' for developing applications that only send and receive messages - which I believe are most applications And having a way to send / browse / explore the messages in the queues and subscriptions in a visual way is very handy during development. |
If you could cover every scenario with correlation filters only, I'd agree. But that's not the case. Point in case, all NServiceBus users require SQL filters. And on the topic of slow/fast, at what point SQL filter is slower than correlation filter? Careful, because I could say it's 'good enough' for most applications. What I see off about this issue is the focus on the wrong thing. Rather than giving the emulator a little time to implement what it will need to implement anyway, people are rushing to do it themselves. And what it will directly result in is additional unnecessary complexity and maintenance burden. Which is already a significant pain point of this project. Not to forget the use of the old ASB client, single platform, AAD/EntraID support, manual verifications, etc. The focus should be on the emulator fixing the lack of management APIs. If that's done, every tool, including SBE, will work with minimal changes required. Plain and simple. Until then, if you feel that you want to invest your time into augmenting emulator 's missing functionality that will be coming done or later, you or anyone else is welcome to do so. The good news is that this approach is not unique to this SBE issue. The Programmers’ Credo is far more common than it should be. |
You could just use RabbitMQ locally in Docker. It has it's own management UI in the image |
That is a limited use-case, since rabbitmq does not offer the full scope for many service bus applications. E.g. Azure Function Triggers. |
I have tried to connect to Azure Service Bus emulator from Service Bus Explorer, using a connection string like:
Endpoint=sb://127.0.0.1;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true
Regular access from host machine worked, but Service Bus Explorer would fail to connect and present the artifacts from the emulator instance.
Running SB Explorer from source code, I could see that the error occurs when calling
NamespaceManager.GetQueuesAsync
(among other admin commands)I believe the emulator doesn't have support for these commands, and it's not clear if it's to be supported in the near future.
An idea to make it work could be to check for the existing flag
UseDevelopmentEmulator=true
in the connection string (we might also have a checkbox for this in UI), and if true, do not make API calls like GetQueuesAsync, but instead allow us to specify the config.json path for the emulator and populate the tree of artifacts from there - see https://learn.microsoft.com/en-us/azure/service-bus-messaging/test-locally-with-service-bus-emulator?tabs=docker-linux-container for details.In theory this should be enough to make it work, but all administrative commands should be disabled from UI when connected to an emulator instance.
The text was updated successfully, but these errors were encountered: