Comments (7)
Got it, so both
InvokeServiceWithContent
andInvokeService
defaulting toPOST
does not allow you to set other verbs on the request. OK, I changed the title of this issue to "Parameterize request method verb on service invocation" and will classify it as a bug.Message: &v1.InvokeRequest{ Method: method, HttpExtension: &v1.HTTPExtension{ Verb: v1.HTTPExtension_POST, // parameterize }, }
I tested it and it is available after adding parameters
from go-sdk.
k8s cluster app has the same issue:
deploy 2 app in k8s.
-
app1: /test
-
app2:
/test2
and use sdk invoke app1 /testres, err := client.InvokeService(ctx, "myapp.myns", "test")
forward app2 port on local:
kubectl port-forward svc/myapp2 50001:50001 3500:3500 8080:8080 -n myns
call app2/test2 use curl:
ystyle@Archlinux ~ curl -v 127.0.0.1:8080/test2
* Trying 127.0.0.1:8080...
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /test2 HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.73.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< Set-Cookie: go_session_id=MGU1OTEzYTEtNmEzOC00NzUwLWE0YmUtMTJmZjE4ODU1ZTU2.a8b2c31a9c5286837d560cb3ac3bd85fdc6371b4; Path=/; Expires=Wed, 16 Dec 2020 03:48:01 GMT; Max-Age=604800; HttpOnly
< Date: Wed, 09 Dec 2020 03:48:01 GMT
< Content-Length: 87
<
* Connection #0 to host 127.0.0.1 left intact
{"code":-1,"msg":"error invoking service: rpc error: code = NotFound desc = Not Found"}% ystyle@Archlinux ~
from go-sdk.
go-sdk can't set HttpExtension which causes the above problems, this is available on java sdk:
**
* Invoke a service method, using serialization.
*
* @param appId The Application ID where the service is.
* @param method The actual Method to be call in the application.
* @param request The request to be sent to invoke the service, use byte[] to skip serialization.
* @param httpExtension Additional fields that are needed if the receiving app is listening on
* HTTP, {@link io.dapr.client.domain.HttpExtension#NONE} otherwise.
* @param metadata Metadata (in GRPC) or headers (in HTTP) to be sent in request.
* @param type The Type needed as return for the call.
* @param <T> The Type of the return, use byte[] to skip serialization.
* @return A Mono Plan of type T.
*/
<T> Mono<T> invokeService(String appId, String method, Object request, HttpExtension httpExtension,
Map<String, String> metadata, TypeRef<T> type);
from go-sdk.
@ystyle can you elaborate more on the actual issue here? Mainly, are these 3 separate issues or all three are part of this one issue?
from go-sdk.
@ystyle can you elaborate more on the actual issue here? Mainly, are these 3 separate issues or all three are part of this one issue?
The problem is caused by the absence of httpExtension, and the existing restful interface cannot be rewritten
gosdk default http method is POST, and can not set to other
from go-sdk.
Got it, so both InvokeServiceWithContent
and InvokeService
defaulting to POST
does not allow you to set other verbs on the request. OK, I changed the title of this issue to "Parameterize request method verb on service invocation" and will classify it as a bug.
Message: &v1.InvokeRequest{
Method: method,
HttpExtension: &v1.HTTPExtension{
Verb: v1.HTTPExtension_POST, // parameterize
},
}
from go-sdk.
@ystyle PR under review, once lands you will have to import from HEAD to use it until we make a new release.
from go-sdk.
Related Issues (20)
- Remove deprecated RenameActorReminder methods
- Dapr 1.9.1 Checksum mismatch HOT 5
- Implementation of DaprClient methods into the mock client HOT 2
- Example project: Saga Execution Orchestrator HOT 3
- Support workflow ID reuse policy
- How to properly test HOT 5
- Cascade Terminate/Purge support for Workflow
- Workflows - Implement workflow id reuse policy HOT 1
- Workflows - Enable custom logger
- Flaky examples (socket & service & pubsub) HOT 2
- Module github.com/golang/protobuf is deprecated and needs to be replaced with google.golang.org/protobuf. HOT 1
- Workflows - Fan-out/fan-in pattern support
- Bulkpublisher should return an error HOT 2
- DaprClient has no field or method RenameActorReminder HOT 4
- Dependabot should be run on the dapr-bot HOT 5
- go-sdk 1.10.0 still depends on dapr 1.13.0-rc.7 HOT 1
- Crypto example not running / error when run HOT 2
- Workflow - Implement custom retry policies
- Update the holopin.yaml to use the sdk badge HOT 4
- Add support for Actor TTL
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 go-sdk.