-
Notifications
You must be signed in to change notification settings - Fork 50
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
HTTP multi-headers are randomized in camel-knative-http #69
Comments
@nicolaferraro can you check that this is solved with the latest code based on undertow ? |
I'll write some integration tests |
Still present on latest version. Scenario: integration 1
integration 2:
integration 3:
Technically only 3 messages should be printed by integration 3:
But sometimes I get:
Looking at the headers, I see they are randomized: Case 1:
Case 2:
Note that the component seems to take the first value of that header, which is the wrong way to deal with it, since channels are always appended as they are encountered. |
I've updated the code to always look for the latest value and wrote this test: https://github.com/lburgazzoli/apache-camel-k-runtime/blob/github-69/camel-knative/camel-knative-http/src/test/java/org/apache/camel/component/knative/http/KnativeHttpTest.java#L1144-L1182 |
Here's a dump of the raw http requests. They arrive randomized.... Knative bug..
|
The issue about taking the first value of an header has been fixed: #168 |
@nicolaferraro I think the best would be to have the latest channel/endpoint being set to a dedicated header as single value |
@nicolaferraro should we close this one as it is not a camel-k-runtime issue ? |
Not a runtime issue and no longer needed. |
This line
camel-k-runtime/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpComponent.java
Line 222 in 72c9d2a
In case of the header
ce-knativehistory
, values may be like:channel1.ns.channels.cluster.local; channel2.ns.channels.cluster.local
. They are interpreted by netty as being present multiple times (which is correct) and only one of them is returned by that call (which is correct), but a random one (which is wrong).We should find a way to get always the last value of the header, which is the last channel that received the message.
I've tried also to get the full list of values using
getAll
but the order of elements in the list is still randomized.I've found there's a
CombinedHttpHeader
class in netty that may solve the issue by appending values to the same header instead of adding multiple entries, but I'm not able to plug it in Camel Netty.Any idea @lburgazzoli ?
The text was updated successfully, but these errors were encountered: