cap-js-community / event-queue

An event queue that enables secure multi-tenant enabled transactional processing of asynchronous events, featuring instant event processing with Redis Pub/Sub and load distribution across all application instances.
https://cap-js-community.github.io/event-queue/
Apache License 2.0
11 stars 1 forks source link

Conflict with @cap-js/telemetry #165

Closed corporateuser closed 3 months ago

corporateuser commented 3 months ago

Hello, in https://github.com/cap-js-community/event-queue/blob/main/src/runner/runner.js#L142 you're creating a context which looks like an http context, but actually is not. This causes @cap-js/telemetry to throw as it expects that context having "http" property to be a correct http request, but it is not. Maybe event-queue should not pretend its requests are http requests?

I've created an issue in telemetry repo as well, as I'm not sure who actually should fix this. Maybe you could have internal conversation on this?

sjvans commented 3 months ago

hi @soccermax

where is getSubdomain() needed in/ for logging?

best, sebastian

soccermax commented 3 months ago

@sjvans, we use this method for extracting the subdomain, as it was the most commonly used method with CDS and xssec. Is there a better approach where we can store this information? We would like to have the subdomain available even when we are not running in the context of an HTTP request (event-queue). For tenant we have context.tenant but would we do this for subdomain?

Best, Max

sjvans commented 3 months ago

hi @soccermax

for @sap/xssec-based authentication, we offer req.user.tokenInfo (since one of the last couple of releases). let me know if that isn't sufficient for you.

best, sebastian

soccermax commented 3 months ago

@sjvans thanks I'll look into it. @corporateuser I'll release a new version with a fix. Thanks for reporting

soccermax commented 3 months ago

release is in the build process: https://github.com/cap-js-community/event-queue/releases/tag/v1.4.1