简体   繁体   English

2 微服务如何维护会话和异常?

[英]How 2 micro services maintain session and exceptions?

How exception thrown from one micro service handled by another micro service?另一个微服务如何处理一个微服务抛出的异常? Do we need to copy same exception object on both instances?我们是否需要在两个实例上复制相同的异常对象?

Also how session is maintained within micro services?微服务中如何维护会话?

When one service(Service A) requests another service(Service B), the Requested Service usually gives requested data if everything goes fine.当一个服务(服务 A)请求另一个服务(服务 B)时,如果一切正常,请求的服务通常会提供请求的数据。 Otherwise, it gives an error code.否则,它会给出错误代码。 For more information on the error code, you can see the following document: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status .有关错误代码的更多信息,您可以查看以下文档: https : //developer.mozilla.org/en-US/docs/Web/HTTP/Status

You can Use JWT token for tracking requester.您可以使用 JWT 令牌来跟踪请求者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM