a websocket entrypoint allowing to consume and produce
a kafka endpoint configured with two different topics list for Producer and Consumer
When we connect to this API, it will only produce/consume messages in the Producer topic list. The entrypoint won’t receive any message from the Consumer topic list.
Once the topic list is fetched, it stores it in an attribute gravitee.attribute.kafka.topics
The initialization of the producer happens before the one of the consumer. It means that the producer initialization will set the attribute, and once the Consumer initializes, it will use that value instead of the one from the configuration.
This impacts only the WebSocket Entrypoint because it is currently the only one handling both the publish and subscribe phases in the same request.
Possible Fix:
Removing the two lines setting the attribute in the endpoint.
Possible side-effect: if someone used to read this attribute in the policy chain without setting it himself, it will have null.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The attached API defines:
When we connect to this API, it will only produce/consume messages in the Producer topic list. The entrypoint won’t receive any message from the Consumer topic list.
Raw investigation:
The root cause is located at
Once the topic list is fetched, it stores it in an attribute
gravitee.attribute.kafka.topics
The initialization of the producer happens before the one of the consumer. It means that the producer initialization will set the attribute, and once the Consumer initializes, it will use that value instead of the one from the configuration.
This impacts only the WebSocket Entrypoint because it is currently the only one handling both the publish and subscribe phases in the same request.
Possible Fix:
Removing the two lines setting the attribute in the endpoint.
Possible side-effect: if someone used to read this attribute in the policy chain without setting it himself, it will have null.