Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Potential issue using the IEnumerable overload of EnqueueAsync #22

Open
@jdtaylor91

Description

The EnqueueAsync method has overloads that support sending an IEnumerable<T> as well as sending a single object of type T.

If the calling code sends a List<T> instead of an IEnumerable<T>, the wrong overload will be picked and the queuing abstraction will send a single message with the serialized list within it, whereas the intent is for a batch of many messages to be sent.

We should see how we can improve the API to avoid this issue occurring.

The Azure Service Bus MessageSender implementation includes an overload that uses IList<T> instead of IEnumerable<T>, it may be that this is a nicer overload. Alternatively, we may need to introduce a new method, EnqueueBatchAsync, instead of adding overloads of EnqueueAsync.

Test should be added to ensure the correct method is called when types of IEnumerable<T> and ICollection<T> are passed into the EnqueueAsync or EnqueueBatchAsync methods.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions