Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Is it possible to specify a custom partition scheme? #85

Open
olivergrimes opened this issue Nov 21, 2019 · 5 comments
Open

Is it possible to specify a custom partition scheme? #85

olivergrimes opened this issue Nov 21, 2019 · 5 comments
Labels

Comments

@olivergrimes
Copy link

olivergrimes commented Nov 21, 2019

I could only find this method in BrokerServiceLocator that creates partition keys for connecting to the broker service:

private async Task<ServicePartitionKey> GetPartitionForMessageAsync(string messageTypeName)

Is it possible to specify a custom partition key, rather than partitioning based on the message Type? This way we could scale based on the message subject/topic as opposed to the message type.

@danadesrosiers
Copy link
Collaborator

It doesn't currently support specifying a custom partition scheme, but that does sound like a useful feature. PR's are welcome if you want to implement it.

@olivergrimes
Copy link
Author

olivergrimes commented Nov 21, 2019

@danadesrosiers Thanks again, if we decide to use this in our current project I'll definitely submit a PR for this feature.

@Calidus
Copy link
Contributor

Calidus commented Jan 20, 2021

This feature is very attractive to me. I am trying to ball park the scope of work needed to implement it.

  • A new DataMember "PartitionKey" would need to be added to MessageWrapper to partition on
  • Update Broker Service to toggle between using PartitionKey and MessageType
  • Update Subscribe Attributes to support PartitionKey and MessageType
  • Other things I didn't think of?

@danadesrosiers
Copy link
Collaborator

Can you explain what you hope to get out of this feature? The most basic enhancement I can think of would be to update BrokerServiceLocator to change private async Task<ServicePartitionKey> GetPartitionForMessageAsync(string messageTypeName) to protected virtual. That would allow the user to override it to specify which types to assign to which partition. Probably registering some kind of PartitionStrategy with BrokerServiceLocator would be a better pattern.

But that would not give you the ability to partition a single message type across multiple partitions. If you need that, I think it would be significantly more complex.

@Calidus
Copy link
Contributor

Calidus commented Jan 23, 2021

After talking with some coworkers I realize I was interested in the idea of "Named Queues" rather than changing the partition scheme. Sorry for the confusion please disregard the previous comment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants