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

[WIP] Streaming POC #6291

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open

[WIP] Streaming POC #6291

wants to merge 37 commits into from

Commits on May 18, 2024

  1. Streaming POC

    Based on #6288
    buger committed May 18, 2024
    Configuration menu
    Copy the full SHA
    d2ca309 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2024

  1. Configuration menu
    Copy the full SHA
    104bd10 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2024

  1. Add TYk integration

    buger committed May 20, 2024
    Configuration menu
    Copy the full SHA
    b832731 View commit details
    Browse the repository at this point in the history
  2. Add fan-out mechanism

    buger committed May 20, 2024
    Configuration menu
    Copy the full SHA
    eb9679c View commit details
    Browse the repository at this point in the history

Commits on May 21, 2024

  1. Add support for redis streams

    buger committed May 21, 2024
    Configuration menu
    Copy the full SHA
    5814899 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2024

  1. Configuration menu
    Copy the full SHA
    a5f6499 View commit details
    Browse the repository at this point in the history
  2. fixd panic where if messages were still in redis stream when client d…

    …isconnected would cause a send on closed channel
    lonelycode committed May 23, 2024
    Configuration menu
    Copy the full SHA
    5dda8b1 View commit details
    Browse the repository at this point in the history
  3. Fix bugs

    buger committed May 23, 2024
    Configuration menu
    Copy the full SHA
    d27a42f View commit details
    Browse the repository at this point in the history
  4. Add portal support

    buger committed May 23, 2024
    Configuration menu
    Copy the full SHA
    9154430 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2024

  1. Fix router issue

    buger committed Jun 27, 2024
    Configuration menu
    Copy the full SHA
    9504b25 View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2024

  1. Configuration menu
    Copy the full SHA
    2f5ec76 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5b55a4f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3fa969f View commit details
    Browse the repository at this point in the history
  4. Update go.mod

    buger committed Jun 29, 2024
    Configuration menu
    Copy the full SHA
    0ac2d6b View commit details
    Browse the repository at this point in the history
  5. Add new Labs configuration option, and ensure that streaming runs onl…

    …y when
    
    config variable set
    buger committed Jun 29, 2024
    Configuration menu
    Copy the full SHA
    0516055 View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2024

  1. Fix linter

    buger committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    8e066fe View commit details
    Browse the repository at this point in the history
  2. Do not load unsafe components

    buger committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    2e6fcb9 View commit details
    Browse the repository at this point in the history
  3. Fix gomod

    buger committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    7d2e5be View commit details
    Browse the repository at this point in the history
  4. Add mutex to unload function

    buger committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    e02e8e2 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2024

  1. refactor: Implement direct user-to-stream connections in streaming mi…

    …ddleware
    
    This commit introduces a major change in the streaming architecture:
    
    - Replace shared Redis streams with direct user-to-stream connections
    - Each user now has their own dedicated stream, improving isolation and performance
    
    Additional improvements include:
    
    - Refactor StreamingMiddleware to use consumer group managers
    - Update StreamManager to use sync.Map for thread-safe operations
    - Remove Redis dependency and related functionality
    - Implement garbage collection for unused consumer groups
    - Update tests to reflect new structure and functionality
    - Add support for Kafka in streaming tests
    - Improve error handling and logging throughout
    - Update go.mod and go.sum with new dependencies
    
    These changes significantly enhance the scalability and efficiency of the streaming system by establishing direct connections between users and their respective streams, eliminating the need for a shared Redis-based message queue.
    buger committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    a7290a2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cb7471a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    325d9b8 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2024

  1. Rename a few methods

    buger committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    89cbe30 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ac9763b View commit details
    Browse the repository at this point in the history
  3. refactor: update Stream struct and methods in manager.go

    This commit refactors the `internal/streaming/manager.go` file to update the `Stream` struct and its methods. The main changes include:
    
    1. Remove unused imports: `crypto/sha256` and `sync`.
    2. Update `addMetadata`, `GetHTTPPaths`, `removeUnsafe`, and `removeConsumerGroup` methods to work with the `Stream` struct instead of `StreamManager`.
    3. Remove references to `StreamManager` and update method receivers to use `Stream`.
    4. Update `GetHTTPPaths` to use the `streamConfig` field of the `Stream` struct instead of loading from a map.
    
    These changes align the `Stream` struct with the new design, allowing it to manage a single stream configuration and its associated operations.
    buger committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    a6bcc5e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9226f2d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    36b6cd8 View commit details
    Browse the repository at this point in the history
  6. refactor: improve stream stopping mechanism

    This commit enhances the Stream.Stop() method to make it more robust and prevent nil pointer dereferences. The changes include:
    
    1. Adding a nil check for the stream before attempting to stop it.
    2. Implementing a timeout mechanism using context to prevent indefinite hanging.
    3. Using a goroutine and channel for asynchronous stream stopping.
    4. Improving logging to provide more detailed information about the stopping process.
    
    These modifications aim to resolve issues related to stopping non-existent streams and make the overall process more reliable.
    buger committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    bc8ec7a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    ed6d83c View commit details
    Browse the repository at this point in the history
  8. feat: enhance AsyncAPI test robustness and logging

    This commit improves the `testAsyncAPIHttp` function in the `gateway/mw_streaming_test.go` file to increase test reliability and provide more detailed logging. The changes include:
    
    1. Increase initial WebSocket connection delay from 1 to 2 seconds
    2. Extend overall timeout from 10 to 30 seconds
    3. Increase inactivity timeout from 2 to 5 seconds
    4. Add final log message showing total received messages
    
    These modifications aim to give the test more time to receive messages and offer more comprehensive logging information, facilitating better diagnosis of potential issues in message reception.
    buger committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    6ea2dac View commit details
    Browse the repository at this point in the history
  9. feat: enhance AsyncAPI test with increased timeouts and logging

    This commit improves the `testAsyncAPIHttp` function in the `mw_streaming_test.go` file to provide better debugging information and increase the chances of successful message reception. The changes include:
    
    1. Increase initial WebSocket connection stabilization delay to 5 seconds
    2. Add logging for WebSocket connection stabilization
    3. Extend overall timeout to 60 seconds
    4. Increase inactivity timeout to 10 seconds
    5. Add a 5-second delay before closing WebSocket connections
    6. Improve logging throughout the test execution
    
    These modifications aim to address potential timing issues and provide more detailed information about the test's progress, facilitating easier debugging of any remaining issues.
    buger committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    c3f3b98 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    e8803d3 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    2d71c47 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    87507bc View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    299f31f View commit details
    Browse the repository at this point in the history
  14. Small refactor

    buger committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    e5ee2d4 View commit details
    Browse the repository at this point in the history
  15. More unused constants

    buger committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    05633af View commit details
    Browse the repository at this point in the history