Skip to content

Conversation

@adenhertog
Copy link
Contributor

This commit introduces batch sending capabilities to the bus implementation and its transports.

New methods sendBatch (for commands) and publishBatch (for events) have been added to the Transport interface and implemented in the BusInstance.

  • SqsTransport: Implements batching using SNS PublishBatchCommand. Messages are grouped by topic and sent in chunks of up to 10 to respect SNS limits.
  • RabbitMqTransport: Throws a "not supported" error for batch operations, as the underlying transport does not natively support them.
  • InMemoryQueue: Implements batching by iterating and calling the single send/publish methods, suitable for testing.

Unit tests have been added for the new methods in BusInstance. Integration tests have been added to the transportTests suite to cover batch operations for all relevant transports, verifying both successful execution and correct error handling for unsupported transports.

This commit introduces batch sending capabilities to the bus implementation and its transports.

New methods `sendBatch` (for commands) and `publishBatch` (for events) have been added to the `Transport` interface and implemented in the `BusInstance`.

- SqsTransport: Implements batching using SNS `PublishBatchCommand`. Messages are grouped by topic and sent in chunks of up to 10 to respect SNS limits.
- RabbitMqTransport: Throws a "not supported" error for batch operations, as the underlying transport does not natively support them.
- InMemoryQueue: Implements batching by iterating and calling the single send/publish methods, suitable for testing.

Unit tests have been added for the new methods in `BusInstance`.
Integration tests have been added to the `transportTests` suite to cover batch operations for all relevant transports, verifying both successful execution and correct error handling for unsupported transports.
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

Successfully merging this pull request may close these issues.

2 participants