gravitee-io / issues

Gravitee.io - API Platform - Issues
64 stars 26 forks source link

Websocket Entrypoint can't produce and consume on 2 different Kafka topics list #9508

Open exalate-issue-sync[bot] opened 4 months ago

exalate-issue-sync[bot] commented 4 months ago

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.

stale[bot] commented 1 month ago

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.