Skip to content
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

Multiple SubscribeOperation for same channel fails #178

Open
drdamour opened this issue Nov 1, 2023 · 0 comments
Open

Multiple SubscribeOperation for same channel fails #178

drdamour opened this issue Nov 1, 2023 · 0 comments

Comments

@drdamour
Copy link

drdamour commented Nov 1, 2023

In our app we publish different message types on the same channel from different functions. This all works fine if all the functions are on the same class...

[AsyncApi("Primary")]
[Channel(HubNames.CUSTOMERS)]
[SubscribeOperation()]
public class FuncCustomersUpdates
{

  [Message(typeof(CustomerUpdateEventResource), MessageId = Profiles.CUSTOMER_EVENTS_UPDATE, Title = "Customer Update")]
  [FunctionName(nameof(PublishCustomerUpdateEvents))]
  public async Task<PublishCustomerUpdateEventsResult> PublishCustomerUpdateEvents(
  ...
  
  [Message(typeof(CustomerAddressUpdateEventResource), MessageId = Profiles.CUSTOMER_ADDRESS_EVENTS_UPDATE, Title = "Customer Address Update")]
  [FunctionName(nameof(PublishCustomerAddressUpdateEvents))]
  public async Task<PublishCustomerAddressUpdateEventsResult> PublishCustomerAddressUpdateEvents(
  ...
  
}

but we do this in azure functions where it's nicer to have these as distinct function classes for different message types we publish. So very similar to #133 i would like it if we could support multiple channel/subscribe pairs across classes. eg

[AsyncApi("Primary")]
[Channel(HubNames.CUSTOMERS)]
[SubscribeOperation()]
public class FuncCustomerUpdates
{

  [Message(typeof(CustomerUpdateEventResource), MessageId = Profiles.CUSTOMER_EVENTS_UPDATE, Title = "Customer Update")]
  [FunctionName(nameof(PublishCustomerUpdateEvents))]
  public async Task<PublishCustomerUpdateEventsResult> PublishCustomerUpdateEvents(
  ...
}

[AsyncApi("Primary")]
[Channel(HubNames.CUSTOMERS)]
[SubscribeOperation()]
public class FuncCustomerAddressUpdates
{
  [Message(typeof(CustomerAddressUpdateEventResource), MessageId = Profiles.CUSTOMER_ADDRESS_EVENTS_UPDATE, Title = "Customer Address Update")]
  [FunctionName(nameof(PublishCustomerAddressUpdateEvents))]
  public async Task<PublishCustomerAddressUpdateEventsResult> PublishCustomerAddressUpdateEvents(
  ...
  
}

workaroudn is to make them the same partial class...which is ok but not the long term solutoin we are after

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

No branches or pull requests

1 participant