jeudi 14 octobre 2021

Spring cloud sleuth - Using sleuth's context for passing common business-params into API - is anti-pattern?

We're now using microservices with the transfer of common parameters (like userId, applicationId, userIP, etc) through custom headers. These parameters aren't technical: they're actively used in business logic in microservices.

At the same time, these headers are filled in with a custom starter, which sets parameters in the sleuth's context for each request.

This solution (implicit filling of headers via sleuth) raises very big doubts for me. It looks like this is an anti-pattern and an inappropriate use of the tracing tool. Of course, sleuth allows you to transfer a custom context between services, but IMHO - tying business logic to it isn't reliable.

I want to know community opinion about it. Thanks!

Aucun commentaire:

Enregistrer un commentaire