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

Issue while streaming data from backend #924

Open
Arvi89 opened this issue Sep 11, 2024 · 1 comment
Open

Issue while streaming data from backend #924

Arvi89 opened this issue Sep 11, 2024 · 1 comment

Comments

@Arvi89
Copy link

Arvi89 commented Sep 11, 2024

Environment info:

  • KrakenD version: 2.7.1
  • System info: podman version 5.2.1
  • Hardware specs: 16GB Ram, 8 core CPU
  • Backend technology: Go
  • Additional environment information:

Describe the bug
So I have a service that returns streamed data through a SSE. While passing it through krakend, we use the no-op, however we have an issue: instead of sending chunks of data as they arrive, the gateway wait then sends by bulk (which is not what we want)

Your configuration file:
This is a simplified file

{
  "$schema": "https://www.krakend.io/schema/krakend.json",
  "version": 3,
  "client_tls": {
    "@comment": "Skip SSL verification when connecting to backends",
    "allow_insecure_connections": true
  },
  "name": "KrakenD - API Gateway",
  "extra_config": {
    "security/http": {
      "allowed_hosts": [],
      "ssl_proxy_headers": {}
    }
  },
  "timeout": "100s",
  "disable-compression": true,
  "cache_ttl": "300s",
  "output_encoding": "no-op",
  "endpoints": [
    {
      "endpoint": "/threads",
      "method": "POST",
      "output_encoding": "no-op",
      "backend": [
        {
          "url_pattern": "/threads",
          "encoding": "no-op",
          "sd": "static",
          "method": "POST",
          "host": [
            "https://service.consul"
          ],
          "disable_host_sanitize": false
        }
      ],
      "input_headers": [
        "*"
      ]
    }
  ]
}

Expected behavior
I want the data to be returned as soon as it arrives, and not wait to send a bulk.

Basically it's a problem similar as this one:
https://support.konghq.com/support/s/article/How-can-I-enable-streaming-of-responses-with-text-event-stream-content-types-instead-of-having-the-responses-buffered-and-sent-in-one-large-payload

@alombarte
Copy link
Member

Related #208 , #822

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

2 participants