request help: how to use batch-requests plugin
Issue description
I want to try batch-requests, but when I testing it according to the method in the document, always returned an error, it is different from the result in the document. Is there a mistake in my operation? @ShiningRush
Environment
- apisix version (cmd:
apisix version): master - OS: macos
curl --location --request POST 'http://127.0.0.1:9080/apisix/batch-requests' \
--header 'Content-Type: application/json' \
--data '{
"headers": {
"Content-Type": "application/json",
"admin-jwt":"xxxx"
},
"timeout": 500,
"pipeline": [
{
"method": "POST",
"path": "/community.GiftSrv/GetGifts",
"body": "test"
},
{
"method": "POST",
"path": "/community.GiftSrv/GetGifts",
"body": "test2"
}
]
}'
return
[
{
"body":"{"error_msg":"404 Route Not Found"}
",
"reason":"Not Found",
"status":404,
"headers":{
"Connection":"keep-alive",
"Content-Type":"text/plain; charset=utf-8",
"Date":"Fri, 13 Nov 2020 03:38:34 GMT",
"Server":"APISIX/2.0",
"Transfer-Encoding":"chunked"
}
},
{
"body":"{"error_msg":"404 Route Not Found"}
",
"reason":"Not Found",
"status":404,
"headers":{
"Connection":"keep-alive",
"Content-Type":"text/plain; charset=utf-8",
"Date":"Fri, 13 Nov 2020 03:38:34 GMT",
"Server":"APISIX/2.0",
"Transfer-Encoding":"chunked"
}
}
]
ping @idbeta
"path": "/community.GiftSrv/GetGifts",
Hmmm, this route is not default,it would be better to change it to a default route.
"path": "/community.GiftSrv/GetGifts",
Hmmm, this route is not default,it would be better to change it to a default route.
ok, I will give it a try.
I know how to use this plugin, thanks. I think you should add some description in the doc, like "a route should be created first, then use the batch-requests plugin to access this route for requests". @ShiningRush
i am already have same problem and cannot use this plugins functionality. note that i added new route but not working and always give me 404 error
i am already have same problem and cannot use this plugins functionality. note that i added new route but not working and always give me 404 error
i found root of my problem . the batch-requests plugin isn't enabled by default ! why?!!!
and now i have new problems: when i enable plugins in config.yaml another plugins will be disabled! when i enable all plugins i give 504 error continuously. the batch-requests plugin only response on first pipeline path and other pipeline paths give me status 504, "reason": "upstream timeout" . but i increased timeout