Giter Site home page Giter Site logo

Comments (12)

eltone avatar eltone commented on August 26, 2024

Would this allow for a Topic per message type approach? I was considering forking and implementing this myself.
The reason I ask is purely for throughput reasons. For each subscription to a topic, throughput is reduced. See MSDN:

Benchmarks suggest that a single topic with 5 subscriptions can achieve a message throughput of up to 600msg/s >(message size: 1KB) if all messages are routed to all subscriptions. To obtain higher throughput, use multiple >topics.

Benchmarks suggest that a single topic with 250 subscriptions can achieve a message throughput of up to 5msg/s >(message size: 1KB) if all messages are routed to all subscriptions. To obtain higher throughput, use multiple >topics.

In a system with a wide variety of messages and a reasonable number of instances I could see a single Topic approach causing problems.

from projectextensions.azure.servicebus.

joefeser avatar joefeser commented on August 26, 2024

The way the current design works, I would need to use a non static version of the "bus" class.

My thoughts would be to create a config and pass it to a method to return a sender.

We could overload the send methods and perform a lookup but there would be a slight overhead with that.

How did you plan on implementing it?

from projectextensions.azure.servicebus.

eltone avatar eltone commented on August 26, 2024

I would have some sort of sender factory and have a mapper list (like you do for subscriptions) to route messages to their respective sender. Each sender would have it's own TopicClient instance.
I think the receiver side of things could be accomplished pretty much in config. I'm not that familiar with your code base so I might be way off.

from projectextensions.azure.servicebus.

joefeser avatar joefeser commented on August 26, 2024

For multiple topics, both the sender and receivers would need to support it. My thought on the receiver side is to have a comma separated string so that I can go and register them to multiple topics.

Do you have psydo code that would show how you see this sender factory?

from projectextensions.azure.servicebus.

eltone avatar eltone commented on August 26, 2024

Would it not be simpler to have a separate receiver per message type (with its own mappings)? Maybe make it a generic?

My (vague) plan for the sender factory was to use generics and either reflect the class name of the argument or use a hash as you do with subscriptions and attach a TopicClient (or MessageSender) to each sender.
This has the problem in that the end user would have to request a different sender instance for each message type. It is probably more sensible to maintain a collection of TopicClients inside a non-generic Sender and just reflect on the message type to get the route.

from projectextensions.azure.servicebus.

eltone avatar eltone commented on August 26, 2024

Hey Joe please take a look at the latest commit on my fork for my initial implementation:https://github.com/eltone/ProjectExtensions.Azure.ServiceBus

I realize that this forces the multi-topic decision on the user but I felt it was the simplest way to get a working example. I also still need to ensure these changes are in line with your topic/ subscription recovery work.

If you are happy with this direction I can submit a PR and we can go into more detailed discussion over the diffs.

from projectextensions.azure.servicebus.

joefeser avatar joefeser commented on August 26, 2024

I will try to look at it tonight. It may be a day or so. Thanks for the fork.

from projectextensions.azure.servicebus.

joefeser avatar joefeser commented on August 26, 2024

I only looked online. Did you make it so that each message is it's own topic? That would mean that the receivers would also need a client per message type.

from projectextensions.azure.servicebus.

eltone avatar eltone commented on August 26, 2024

Yes the CreateSubscription method handles this by fetching a TopicDescription instance from the dictionary using the type name to pass into the AzureReceiverHelper constructor. Currently the sender and receiver use separate sets of TopicClient instances.

from projectextensions.azure.servicebus.

joefeser avatar joefeser commented on August 26, 2024

I think I misunderstood how you wanted to scale out. What if you want to send 5000 msg / s of one message type. The only want to do that is to spin it across multiple topics. The current code you have would not support that.

from projectextensions.azure.servicebus.

joefeser avatar joefeser commented on August 26, 2024

I now re-read your original comment so your approach makes sense with the code that you have. What's your thought on the last comment?

from projectextensions.azure.servicebus.

eltone avatar eltone commented on August 26, 2024

I don't think it would be much work to allow for multiple topics per type:

  • This could be either configured globally across all types or by using attributes on the messages themselves.
  • Receiving is simple as it just involves creating more AzureReceiverHelper instances.
  • Sending of messages could be implemented by using a round robin or RNG based load balancer.

from projectextensions.azure.servicebus.

Related Issues (20)

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.