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

Add Batch Messaging Configuration for Google Pub/Sub Publisher at Application Startup #3646

Open
egerbsotec opened this issue Jun 17, 2024 · 1 comment
Assignees

Comments

@egerbsotec
Copy link

We propose an enhancement to Hono's experimental Google Pub/Sub based messaging infrastructure to allow the Google Pub/Sub Publisher to send messages in batches, configurable at application startup. This improvement aims to optimize message throughput and reduce the number of API calls to Google Pub/Sub, which can lead to cost savings and improved performance.

Justification:

Currently, the Google Pub/Sub Publisher sends messages individually. While this approach is straightforward, it can be inefficient for applications with high message throughput. Sending messages in batches can significantly reduce the number of network requests and increase overall efficiency. By making this feature configurable at application startup, we provide flexibility for different use cases and workloads.

Proposed Changes:

  • Implement configuration options.
  • Modify the existing Pub/Sub Publisher to support batching of messages based on the configuration.
  • Update the documentation to include details on the feature and the new configuration properties.
@mattkaem mattkaem self-assigned this Jun 19, 2024
@sophokles73
Copy link
Contributor

You should also take the message's QoS into consideration. For telemetry with QoS 0 I do not see an issue to batch the messages. However, if you also have QoS 1 messages (like events) in between then you need to be careful not to break the contract between the device and the adapter, i.e. the adapter guarantees that a QoS 1 message has been handed over to the messaging infrastructure when it returns a positive ack to the device ...

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

3 participants