dapr | Dapr is a portable , event-driven , runtime for building | Microservice library
kandi X-RAY | dapr Summary
kandi X-RAY | dapr Summary
Writing high performance, scalable and reliable distributed application is hard. Dapr brings proven patterns and practices to you. It unifies event-driven and actors semantics into a simple, consistent programming model. It supports all programming languages without framework lock-in. You are not exposed to low-level primitives such as threading, concurrency control, partitioning and scaling. Instead, you can write your code by implementing a simple web server using familiar web frameworks of your choice. Dapr is flexible in threading and state consistency models. You can leverage multi-threading if you choose to, and you can choose among different consistency models. This flexibility enables to implement advanced scenarios without artificial constraints. Dapr is unique because you can transition seamlessly between platforms and underlying implementations without rewriting your code.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of dapr
dapr Key Features
dapr Examples and Code Snippets
Community Discussions
Trending Discussions on dapr
QUESTION
Currently I am learning Dapr, and I find it powerful for micro services development, but after reading more, I found some limitations, the most important of them is "state management".
How can we use tools like EF Core or Dapper for interaction with databases in Dapr? Is DaprClient class the only way of interaction with databases?
...ANSWER
Answered 2022-Mar-31 at 13:20You should continue to use those ORMs alongside Dapr as its not a replacement for them. ORMs already act like a translation layer (Repository layer) for relational stored data. State management is simple KVP storage with some minimal query ability. Think of your state as a Dictionary, where that object can be anything simple or complex. this is well suited for technologies like Redis, DynamoDB, MongoDB, Cassandra etc. Again, what you would put in cache, is what you would put in state storage. So, you can still (and should) have an ORM in your service for relational data and pass in runtime configuration for provider, connection string etc, while being able to utilize all the other features of Dapr via DaprClient, via HTTPClient or via GRPC clients.
Bonus, with many providers in EFCore/EF you can add tracing headers (https://github.com/opentracing-contrib/csharp-netcore) that will seamlessly plug into the tracing provided for free with Dapr. That way you will see a full e2e trace all the way through your state and relational data
QUESTION
All quickstart examples using .Net SDK show 'dotnet run' as the way to run ASP.Net Core applications. See https://docs.dapr.io/getting-started/quickstarts/pubsub-quickstart/#tabs-1-net
dapr run --app-id order-processor --components-path ../../../components --app-port 7001 -- dotnet run
I figured dotnet publish and then replace "dotnet run" with calling the exe or "dotnet order-processor.dll" would work as well, but it does not. The application starts and can be accessed directly but not through dapr. What would be to way to run the subscriber quickstart in a prod environment (not using dotnet run)?
...ANSWER
Answered 2022-Mar-31 at 07:21mmm, my mistake. dotnet /order-processor.dll works but you have to adapt the port to the default. After changing 7001 to 5000 it works as expected. This does the trick:
QUESTION
I have a Dapr application running locally, self-hosted with the Dapr cli. I've configured a Dapr Component
and Subscription
for subscribing to an Azure Event Hub, detailed below:
ANSWER
Answered 2022-Feb-22 at 23:00I was able to fix this by exposing my app over http instead of https. Unfortunately there was no logging to indicate https was the issue, even with debug level switched on.
QUESTION
I have set up DAPR to run a sidecar on my application that's absolutely fine. i am now trying to get OPA injected as middleware in the DAPR call. this should be simple... Set up the application annotation to config, the pipeline configuration, and the component:
Application annotation:
...ANSWER
Answered 2021-Dec-18 at 14:49There was an error in parsing value of the defaultStatus: https://github.com/dapr/dapr/issues/3216. It was fixed in v1.5.
QUESTION
I had a command (actually a DAPR command :-) ) that run in PowerShell and continuously return results. I know how to connect to the PowerShell terminal and get a result, but my problem is that my command continuously returns the result and I need to capture this result to a Form.
...ANSWER
Answered 2021-Dec-18 at 13:35You don't need to wait for a pipeline to return - you can start consuming output while it's still running!
You just need to make a few changes:
- Add the
-Stream
switch parameter toOut-String
(or dropOut-String
completely) - Create a
PSDataCollection
instance through which we can collect output - Invoke the pipeline asynchronously, with
PowerShell.BeginInvoke()
QUESTION
What does "in use" mean and how can I get that info from the CLI?
Reference: docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.State}}\t{{.Image}}"
Reference: docker image ls
ANSWER
Answered 2021-Nov-26 at 17:35It indicates if the image is used by a container (running or already stopped).
You cannot get this via the CLI using docker images
, but listing the containers docker ps -a
you can see the associated image.
QUESTION
My project is using Spring Cloud Sleuth to participate in recording distributed spans. Communication with other systems is done over Dapr, which is not supported by Spring Cloud Sleuth. Applications communicatie with each other through a sidecar (offered by Dapr); communication between the app and the sidecar is HTTP or gRPC.
Dapr expects distributed traces to be propaged according to the W3C standard. Using the W3C standard is possible in Sleuth by setting the following in application.yml:
...ANSWER
Answered 2021-Nov-22 at 18:38Spring Cloud Sleuth does two things form a very high perspective:
- Gives you an API over tracing libraries (abstracts away the tracing libs)
- Instruments Spring projects or libraries that are supported by Spring
Because of this, if you have a library that is not supported by Spring, you can check if the underlying tracing library supports it or not. By default the tracing lib is Brave but it does not seem it supports Dapr.
In the case of neither your tracing library nor Sleuth does not instrument the project of your choice, you need to write your own instrumentation (you can also open an issue for Brave to support it).
You can use Sleuth and/or Brave to write instrumentation, these parts of the docs can help:
- Span Lifecycle (how to create/continue a Span)
- Context Propagation Mechanism
- RPC Integration (gRPC and Dubbo are instrumented)
On top of these you need to figure out how to transfer tracing data over the wire. In most cases this happens using headers (HTTP, Kafka, AMQP/RabbitMQ, etc.) on the client side, you need to add the tracing data to your message so that it is transferred over the wire and on the server side you need to fetch this data and reuse it if any (if there is none, you need to create a Span from scratch).
You can take a look how other ~similar transports are instrumented (in Sleuth or Brave) and do something similar, e.g.: HTTP, Kafka, AMQP/RabbitMQ, gRPC, Dubbo, etc.
QUESTION
I'm trying to run a basic Dapr setup with dotnet. I followed documentation and sample projects but with no luck for now.
I created a simple dotnet web API application with net5.0. API has one controller with three pairs of get/post endpoints. Each pair is for a specific pub-sub provider (nats, rabbit, Redis).
...ANSWER
Answered 2021-Nov-06 at 00:08Add the [FromBody]
attribute to the action method parameter.
For example:
QUESTION
I'm trying to connect dapr with nats with jetstream functionality enabled.
I want to start everything with docker-compose. Nats service is started and when I run nats-cli with command nats -s "nats://localhost:4222" server check jetstream
, I get OK JetStream | memory=0B memory_pct=0%;75;90 storage=0B storage_pct=0%;75;90 streams=0 streams_pct=0% consumers=0 consumers_pct=0%
indicating nats with jetstream is working ok.
Unfortunately, dapr returns first warning then error
warning: error creating pub sub %!s(*string=0xc0000ca020) (pubsub.jetstream/v1): couldn't find message bus pubsub.jetstream/v1" app_id=conversation-api1 instance=50b51af8e9a8 scope=dapr.runtime type=log ver=1.3.0
error: process component conversation-pubsub error: couldn't find message bus pubsub.jetstream/v1" app_id=conversation-api1 instance=50b51af8e9a8 scope=dapr.runtime type=log ver=1.3.0
I followed instructions on official site.
docker-compose.yaml
...ANSWER
Answered 2021-Oct-12 at 08:29The problem was in old Dapr version. I used version 1.3.0
, Jetstream support is introduced in 1.4.0+
. Pulling latest version of daprio/daprd
fixed my problem. Also no need for nats://host.docker.internal:4222
, nats://nats:4222
works as expected.
QUESTION
I'm having some trouble getting the Nginx ingress controller working in my Minikube cluster. It's likely to be some faults in Ingress configuration but I cannot pick it out.
First, I deployed a service and it worked well without ingress.
...ANSWER
Answered 2021-Aug-30 at 08:09Moving this out of comments so it will be visible.
Ingress
Main issue was with path
in ingress rule since application serves traffic on online/userOnline
. If requests go to online
then ingress returns 404
.
Rewrite annotation is not needed in this case as well.
ingress.yaml
should look like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install dapr
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page