<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Service invocation on Dapr Docs</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/</link><description>Recent content in Service invocation on Dapr Docs</description><generator>Hugo</generator><language>en</language><atom:link href="https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/index.xml" rel="self" type="application/rss+xml"/><item><title>Service invocation overview</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/service-invocation-overview/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/service-invocation-overview/</guid><description>&lt;p>Using service invocation, your application can reliably and securely communicate with other applications using the standard &lt;a href="https://grpc.io">gRPC&lt;/a> or &lt;a href="https://www.w3.org/Protocols/">HTTP&lt;/a> protocols.&lt;/p>
&lt;p>In many microservice-based applications, multiple services need the ability to communicate with one another. This inter-service communication requires that application developers handle problems like:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Service discovery.&lt;/strong> How do I discover my different services?&lt;/li>
&lt;li>&lt;strong>Standardizing API calls between services.&lt;/strong> How do I invoke methods between services?&lt;/li>
&lt;li>&lt;strong>Secure inter-service communication.&lt;/strong> How do I call other services securely with encryption and apply access control on the methods?&lt;/li>
&lt;li>&lt;strong>Mitigating request timeouts or failures.&lt;/strong> How do I handle retries and transient errors?&lt;/li>
&lt;li>&lt;strong>Implementing observability and tracing.&lt;/strong> How do I use tracing to see a call graph with metrics to diagnose issues in production?&lt;/li>
&lt;/ul>
&lt;h2 id="service-invocation-api">Service invocation API&lt;/h2>
&lt;p>Dapr addresses these challenges by providing a service invocation API that acts similar to a reverse proxy with built-in service discovery, while leveraging built-in distributed tracing, metrics, error handling, encryption and more.&lt;/p></description></item><item><title>How-To: Invoke services using HTTP</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services/</guid><description>&lt;p>This article demonstrates how to deploy services each with an unique application ID for other services to discover and call endpoints on them using service invocation over HTTP.&lt;/p>
&lt;img src="https://v1-18.docs.dapr.io/images/building-block-service-invocation-example.png" width=1000 height=500 alt="Diagram showing service invocation of example service">


&lt;div class="alert alert-primary" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>

 If you haven&amp;rsquo;t already, &lt;a href="https://v1-18.docs.dapr.io/getting-started/quickstarts/serviceinvocation-quickstart/">try out the service invocation quickstart&lt;/a> for a quick walk-through on how to use the service invocation API.

&lt;/div>

&lt;h2 id="choose-an-id-for-your-service">Choose an ID for your service&lt;/h2>
&lt;p>Dapr allows you to assign a global, unique ID for your app. This ID encapsulates the state for your application, regardless of the number of instances it may have.&lt;/p></description></item><item><title>How-To: Invoke services using gRPC</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/howto-invoke-services-grpc/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/howto-invoke-services-grpc/</guid><description>&lt;p>This article describe how to use Dapr to connect services using gRPC.&lt;/p>
&lt;p>By using Dapr&amp;rsquo;s gRPC proxying capability, you can use your existing proto-based gRPC services and have the traffic go through the Dapr sidecar. Doing so yields the following &lt;a href="https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/service-invocation-overview/">Dapr service invocation&lt;/a> benefits to developers:&lt;/p>
&lt;ol>
&lt;li>Mutual authentication&lt;/li>
&lt;li>Tracing&lt;/li>
&lt;li>Metrics&lt;/li>
&lt;li>Access lists&lt;/li>
&lt;li>Network level resiliency&lt;/li>
&lt;li>API token based authentication&lt;/li>
&lt;/ol>
&lt;p>Dapr allows proxying all kinds of gRPC invocations, including unary and &lt;a href="https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/howto-invoke-services-grpc/#proxying-of-streaming-rpcs">stream-based&lt;/a> ones.&lt;/p></description></item><item><title>How-To: Invoke Non-Dapr Endpoints using HTTP</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/howto-invoke-non-dapr-endpoints/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/howto-invoke-non-dapr-endpoints/</guid><description>&lt;p>This article demonstrates how to call a non-Dapr endpoint using Dapr over HTTP.&lt;/p>
&lt;p>Using Dapr&amp;rsquo;s service invocation API, you can communicate with endpoints that either use or do not use Dapr. Using Dapr to call endpoints that do not use Dapr not only provides a consistent API, but also the following &lt;a href="https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/service-invocation-overview/">Dapr service invocation&lt;/a> benefits:&lt;/p>
&lt;ul>
&lt;li>Ability to apply resiliency policies&lt;/li>
&lt;li>Call observability with tracing &amp;amp; metrics&lt;/li>
&lt;li>Security access control through scoping&lt;/li>
&lt;li>Ability to utilize middleware pipeline components&lt;/li>
&lt;li>Service discovery&lt;/li>
&lt;li>Authentication through the use of headers&lt;/li>
&lt;/ul>
&lt;h2 id="http-service-invocation-to-external-services-or-non-dapr-endpoints">HTTP service invocation to external services or non-Dapr endpoints&lt;/h2>
&lt;p>Sometimes you need to call a non-Dapr HTTP endpoint. For example:&lt;/p></description></item><item><title>How to: Service invocation across namespaces</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/service-invocation-namespaces/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/service-invocation/service-invocation-namespaces/</guid><description>&lt;p>In this article, you&amp;rsquo;ll learn how you can call between services deployed to different namespaces. By default, service invocation supports invoking services within the &lt;em>same&lt;/em> namespace by simply referencing the app ID (&lt;code>nodeapp&lt;/code>):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>localhost:3500/v1.0/invoke/nodeapp/method/neworder
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Service invocation also supports calls across namespaces. On all supported hosting platforms, Dapr app IDs conform to a valid FQDN format that includes the target namespace. You can specify both:&lt;/p>
&lt;ul>
&lt;li>The app ID (&lt;code>nodeapp&lt;/code>), and&lt;/li>
&lt;li>The namespace the app runs in (&lt;code>production&lt;/code>).&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Example 1&lt;/strong>&lt;/p></description></item></channel></rss>