Merge branch 'v1.1' into aacrawfi/sql-actors

This commit is contained in:
Aaron Crawfis 2021-04-20 09:43:00 -07:00 committed by GitHub
commit fc55d4a972
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 15 deletions

View File

@ -86,7 +86,7 @@ data := []byte("ping")
// create the client
client, err := dapr.NewClient()
if err != nil {
logger.Panic(err)
log.Panic(err)
}
defer client.Close()
```
@ -95,11 +95,11 @@ defer client.Close()
```go
// save state with the key key1
err = client.SaveStateData(ctx, "statestore", "key1", "1", data)
err = client.SaveState(ctx, "statestore", "key1", data)
if err != nil {
logger.Panic(err)
log.Panic(err)
}
logger.Println("data saved")
log.Println("data saved")
```
Hooray!
@ -135,6 +135,7 @@ import (
```go
// server is our user app
type server struct {
pb.UnimplementedAppCallbackServer
}
// EchoMethod is a simple demo method to invoke
@ -183,9 +184,9 @@ func (s *server) OnBindingEvent(ctx context.Context, in *pb.BindingEventRequest)
}
// This method is fired whenever a message has been published to a topic that has been subscribed. Dapr sends published messages in a CloudEvents 0.3 envelope.
func (s *server) OnTopicEvent(ctx context.Context, in *pb.TopicEventRequest) (*empty.Empty, error) {
func (s *server) OnTopicEvent(ctx context.Context, in *pb.TopicEventRequest) (*pb.TopicEventResponse, error) {
fmt.Println("Topic message arrived")
return &empty.Empty{}, nil
return &pb.TopicEventResponse{}, nil
}
```

View File

@ -9,9 +9,16 @@ description: "Common issues and problems faced when running Dapr applications"
## I don't see the Dapr sidecar injected to my pod
There could be several reasons to why a sidecar will not be injected into a pod.
First, check your Deployment or Pod YAML file, and check that you have the following annotations in the right place:
First, check your deployment or pod YAML file, and check that you have the following annotations in the right place:
Sample deployment:
```yaml
annotations:
dapr.io/enabled: "true"
dapr.io/app-id: "nodeapp"
dapr.io/app-port: "3000"
```
### Sample deployment:
```yaml
apiVersion: apps/v1
@ -31,9 +38,9 @@ spec:
labels:
app: node
annotations:
<b>dapr.io/enabled: "true"</b>
<b>dapr.io/app-id: "nodeapp"</b>
<b>dapr.io/app-port: "3000"</b>
dapr.io/enabled: "true"
dapr.io/app-id: "nodeapp"
dapr.io/app-port: "3000"
spec:
containers:
- name: node
@ -84,7 +91,7 @@ The most common cause of this failure is that a component (such as a state store
To diagnose the root cause:
- Significantly increase the liveness probe delay - [link]({{< ref "kubernetes-overview.md" >}})
- Significantly increase the liveness probe delay - [link]({{< ref "kubernetes-annotations.md" >}})
- Set the log level of the sidecar to debug - [link]({{< ref "logs-troubleshooting.md#setting-the-sidecar-log-level" >}})
- Watch the logs for meaningful information - [link]({{< ref "logs-troubleshooting.md#viewing-logs-on-kubernetes" >}})
@ -162,9 +169,9 @@ In Kubernetes, make sure the `dapr.io/app-port` annotation is specified:
```yaml
annotations:
dapr.io/enabled: "true"
dapr.io/app-id: "nodeapp"
dapr.io/app-port: "3000"
dapr.io/enabled: "true"
dapr.io/app-id: "nodeapp"
dapr.io/app-port: "3000"
```
If using Dapr Standalone and the Dapr CLI, make sure you pass the `--app-port` flag to the `dapr run` command.