Comments (7)
The 'your handle' in the figure refers to your business logic method defined through protobuf, not the HTTP handle
from kratos.
Bot detected the issue body's language is not English, translate it automatically. π―ππ»π§βπ€βπ§π«π§πΏβπ€βπ§π»π©πΎβπ€βπ¨πΏπ¬πΏ
I saw this is introduced in the document, and the picture is in line with my understanding.
But in actual operation, I got different log output:
Is my usage posture wrong? I am learning this: https://github.com/go-kratos/examples/blob/main/http/middlewares/main.go
from kratos.
The printed results are consistent with the diagram, and the onion ring model itself is like this
from kratos.
The printed results are consistent with the diagram, and the onion ring model itself is like this
Shouldn't the expected result be like this?
service middleware in
service middleware 2 in
INFO msg=sayHelloHandler
service middleware 2 out
service middleware out
And I saw that if you only set this setting, the middleware will not take effect.
var opts = []http.ServerOption{
http.Address(":8000"),
http.Middleware(
serviceMiddleware,
serviceMiddleware2,
),
}
httpSrv := http.NewServer(opts...)
Please guide me, I donβt know where the problem is with the settings. π«°
from kratos.
HTTP middleware only works on routes defined through protobuf, and the use cases in the example are all tested. Please check your own code
from kratos.
In addition, the schematic in the figure is only for middleware and does not include HTTP filter
from kratos.
HTTP middleware only works on routes defined through protobuf, and the use cases in the example are all tested. Please check your own code
Ok, I see~ My understanding of this component is biased, thank you for correcting me
from kratos.
Related Issues (20)
- The trace_id between requests is getting mixed up HOT 4
- [Question] How should I create a kratos project HOT 1
- net: lookupIPAddr dns resolving panic by data race. HOT 4
- [Question] The pprof profile is not valid HOT 4
- [Feature] Replace `PGV` by `protovalidate` HOT 7
- [Question] Pubsub Implementation HOT 3
- [Question]How to print trace.id in log log HOT 8
- Request context canceled during graceful shutdown HOT 3
- [Question]How to do unit testing? HOT 5
- [Question] How to make kratos grpc transfer data larger than 4MB in size ? HOT 4
- The service startup error could not be printed correctly HOT 1
- [Question] The rules before and after loading the configuration file are inconsistent. Can they be improved? HOT 8
- How to print out all request routes, including intercepted or intercepted requests without content type HOT 3
- [Feature] Whether to consider supporting Filebeat access HOT 3
- errors had been ignore or covered when too much err happend HOT 1
- proto. When the field of the query string passed by the front end is an empty string, the field parsed by the back end is nil. HOT 3
- Add a scheduled task server, dependency injection error HOT 3
- [Question] In the parameter verification section of the middleware in the official kratos documentation, the makefile instruction "Add the validate command in the Makefile" will report an error when copied. HOT 2
- logging.Server prints a wrong caller path HOT 1
- EncodeURL will ignore some fields if request message contains repeated custom message HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kratos.