
# Dapr 1.4.0

We're happy to announce the release of Dapr 1.4.0!

We would like to extend our thanks to all the new and existing contributors who helped make this release happen.

**Highlights**

If you're new to Dapr, visit the [getting started](https://docs.dapr.io/getting-started/) page and familiarize yourself with Dapr.
* **Service Invocation**
  - Added an HTTP proxy feature for service to service calls similar to gRPC proxy [#3546](https://github.com/dapr/dapr/issues/3546). Now it's easier to use Dapr features with existing HTTP client code.  Simply add a line of metadata with your appid, and call the service (without using Dapr's special URLs or requiring Dapr SDK for service invoke). For more info, see the [docs](https://docs.dapr.io/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services/#additional-url-formats).
* **Pub/Sub**
  - Enabled pub/sub subscribers to perform message routing and filtering based on expressions applied to CloudEvents fields ([preview feature](https://docs.dapr.io/operations/support/support-preview-features)). [#2582](https://github.com/dapr/dapr/issues/2582).  For more info, see the [docs](https://docs.dapr.io/developing-applications/building-blocks/pubsub/howto-route-messages/).
* **State Management**
  - Added automatic encryption of data with support for key rotation ([preview feature](https://docs.dapr.io/operations/support/support-preview-features)) [#1090](https://github.com/dapr/dapr/issues/1090). Enable automatic data-at-rest encryption of your state with support for bringing-your-own-key and key rotation. Supports all Dapr state stores. For more info, see the [docs](https://docs.dapr.io/developing-applications/building-blocks/state-management/howto-encrypt-state/).
* **Bindings**
  - Added the option to specify an HTTP endpoint route for input bindings [#3520](https://github.com/dapr/dapr/issues/3520). For more info, see the [docs](https://docs.dapr.io/developing-applications/building-blocks/bindings/howto-triggers/#specifying-a-custom-route).
* **New components**
  - [In memory Pub/Sub broker](https://docs.dapr.io/reference/components-reference/supported-pubsub/setup-inmemory/)
  - [NATS JetStream Pub/Sub broker](https://docs.dapr.io/reference/components-reference/supported-pubsub/setup-jetstream/)
  - [Alibaba Cloud Tablestore binding](https://docs.dapr.io/reference/components-reference/supported-bindings/alicloudtablestore/)

Docs have been updated with all the new features and changes of this release. To get started with new capabilities introduced in this release, go to the [Concepts](https://docs.dapr.io/concepts/) and the [Developing applications](https://docs.dapr.io/developing-applications/).

> **If you are upgrading from 1.3.0, check [these instructions](#Production-upgrade-from-130-to-140) before proceeding with the upgrade. Then, see [this](#Upgrading-to-Dapr-140) section on upgrading Dapr to version 1.4.0.**

> **Note: This release contains a few [breaking changes](#Breaking-Changes).**

## Acknowledgements

Thanks to everyone who made this release possible!

@1046102779, @AaronCrawfis, @CodeMonkeyLeet, @Fabian-Schmidt, @ItalyPaleAle, @LLKennedy, @TomCools, @UmutComlekci, @amimimor, @artursouza, @beiwei30, @berndverst, @blackstorm, @cshi0, @daixiang0, @dmitsh, @fjvela, @greenie-msft, @halspang, @howlowck, @jigargandhi, @kevinten10, @l0ll098, @li1234yun, @luckyxiaoqiang, @marcmaranon, @marviniter, @matthewgaim, @msfussell, @mthmulders, @mukundansundar, @omidb,  @orizohar, @paulyuk, @pkedy, @ravi-k4, @riezebosch, @tanvigour, @theonefx, @variadico, @vikborisov, @wcs1only, @weibubli, @willtsai, @yaron2, @yufan022, @jerrylisl, @variadico

## New in this release

### Dapr Runtime
- **RESOLVED** Enable automatic encryption of state stores [1090](https://github.com/dapr/dapr/issues/1090)
- **ADDED** Support for CloudEvent filtering in PubSub's subscriber [2582](https://github.com/dapr/dapr/issues/2582)
- **RESOLVED** Dapr does not support Daemonset  [2637](https://github.com/dapr/dapr/issues/2637)
- **RESOLVED** Dapr Actors - "TTL" for timers / reminders [2906](https://github.com/dapr/dapr/issues/2906)
- **BLOCKED** Cross Pods calls to Dapr sidecar by default in K8s [2914](https://github.com/dapr/dapr/issues/2914)
- **RESOLVED** when component yaml format error but there no error log [3157](https://github.com/dapr/dapr/issues/3157)
- **ADDED** body to error in case a binding fails [3220](https://github.com/dapr/dapr/issues/3220)
- **RESOLVED** Imported components are now configurable. [3271](https://github.com/dapr/dapr/issues/3271)
- **RESOLVED** Optimize: Support dashboard service annotation [3363](https://github.com/dapr/dapr/pull/3363)
- **FIXED** Data races of placement member state. [3423](https://github.com/dapr/dapr/issues/3423)
- **RESOLVED** Add an optional public dapr endpoint for healthz and metadata. [3475](https://github.com/dapr/dapr/issues/3475)
- **RESOLVED** feat(diagnostics/binding): add binding reading event to report metrics for grpc protocol [3487](https://github.com/dapr/dapr/pull/3487)
- **RESOLVED** Fetch secrets from Operator on Kubernetes and not from sidecar [3495](https://github.com/dapr/dapr/issues/3495)
- **ENABLED** reduced sampler assignment times and support all service name of Invoke. [3508](https://github.com/dapr/dapr/pull/3508)
- **RESOLVED** fix build error on Arm 32-bit [3509](https://github.com/dapr/dapr/pull/3509)
- **RESOLVED** Allow input bindings to specify routes [3520](https://github.com/dapr/dapr/issues/3520)
- **RESOLVED** Enable route based proxying for HTTP in addition to gRPC [3546](https://github.com/dapr/dapr/issues/3546)
- **FIXED** Data races in placement. [3551](https://github.com/dapr/dapr/issues/3551)
- **RESOLVED** Update to Go 1.17 [3556](https://github.com/dapr/dapr/issues/3556)
- **RESOLVED** Correct ADR links [3584](https://github.com/dapr/dapr/pull/3584)
- **RESOLVED** Add a bit more logging, and split up the binds tests [3612](https://github.com/dapr/dapr/pull/3612)
- **RESOLVED** Setting initialOffset to oldest for e2e Kafka configurations [3614](https://github.com/dapr/dapr/pull/3614)
- **RESOLVED** feat(components): add in-memory pub/sub [3616](https://github.com/dapr/dapr/pull/3616)
- **RESOLVED** Allow unix domain socket mount path [3627](https://github.com/dapr/dapr/pull/3627)
- **RESOLVED** Measure publish time E2E tests. [3630](https://github.com/dapr/dapr/pull/3630)
- **RESOLVED** Fix actor reminders partitioning on CosmosDB. [3648](https://github.com/dapr/dapr/pull/3648)
- **DELETED** Shudown GET API, following deprecation [3651](https://github.com/dapr/dapr/issues/3651)
### Dapr CLI
- **RESOLVED** Improve Dapr download speed. [611](https://github.com/dapr/cli/pull/611)
- **RESOLVED** dapr init failed [740](https://github.com/dapr/cli/issues/740)
- **RESOLVED** Log error messages to stderr. [748](https://github.com/dapr/cli/issues/748)
- **RESOLVED** dapr dashboard should add '--address' option for define listen address [780](https://github.com/dapr/cli/issues/780)
### Components
- **RESOLVED** Add NATS JetStream pubsub component [870](https://github.com/dapr/components-contrib/issues/870)
- **RESOLVED** Add Close() to Azure EventHubs binding to clean up client [894](https://github.com/dapr/components-contrib/issues/894)
- **RESOLVED** Add Close() to Azure ServiceBusQueues binding to clean up client [895](https://github.com/dapr/components-contrib/issues/895)
- **RESOLVED** Add Close() to GCP Bucket binding to clean up client [896](https://github.com/dapr/components-contrib/issues/896)
- **RESOLVED** Add Close() to GCP Pubsub binding to clean up client [897](https://github.com/dapr/components-contrib/issues/897)
- **RESOLVED** Add Close() to Postgres binding to clean up client [901](https://github.com/dapr/components-contrib/issues/901)
- **RESOLVED** Alibaba Cloud TableStore binding [920](https://github.com/dapr/components-contrib/issues/920)
- **RESOLVED** Client Credentials authN & authZ is supported by all Dapr components having an Azure implementation [970](https://github.com/dapr/components-contrib/issues/970)
- **RESOLVED** Adds support for TTL in Memcached State Store [992](https://github.com/dapr/components-contrib/pull/992)
- **FIXED** Dapr state store component is not handling FIRST_WRITE concurrency option correctly [994](https://github.com/dapr/components-contrib/issues/994)
- **RESOLVED** Redis state store: using "first-write" and no etag updates the document if it exists [1010](https://github.com/dapr/components-contrib/issues/1010)
- **RESOLVED** Fix Kafka pubsub use of AuthRequired metadata [1015](https://github.com/dapr/components-contrib/pull/1015)
- **ADDED** SMTP binding added priority option [1017](https://github.com/dapr/components-contrib/issues/1017)
- **ADDED** New binding AWS SES [1019](https://github.com/dapr/components-contrib/issues/1019)
- **RESOLVED** daprd snssqs destroys SNS subscription upon termination  [1029](https://github.com/dapr/components-contrib/issues/1029)
- **UPDATED** Bump alibaba/sentinel-golang version. [1033](https://github.com/dapr/components-contrib/issues/1033)
- **RESOLVED** SNS and SQS topic/queue names - replace SHA256 with AWS-sanitized names [1034](https://github.com/dapr/components-contrib/issues/1034)
- **UPDATED** Bump go-mssqldb dependency version [1036](https://github.com/dapr/components-contrib/issues/1036)
- **ADDED** Add Event Hubs pubsub and bindings conformance tests [1040](https://github.com/dapr/components-contrib/pull/1040)
- **FIXED** binding SMTP multiple recipients [1048](https://github.com/dapr/components-contrib/issues/1048)
- **RESOLVED** Bump go.mongodb.org/mongo-driver from 1.1.2 to 1.5.1 [1054](https://github.com/dapr/components-contrib/pull/1054)
- **UPDATED** State.cosmosdb component for first-write with etag behavior. [1057](https://github.com/dapr/components-contrib/issues/1057)
- **ADDED** support for default TTL in the Redis State Store component [1060](https://github.com/dapr/components-contrib/issues/1060)
- **RESOLVED** pubsub/aws/snssqs component to support sqs dead-letters queue [1065](https://github.com/dapr/components-contrib/issues/1065)
- **RESOLVED** Update S3 binding [1080](https://github.com/dapr/components-contrib/issues/1080)
- **RESOLVED** Update S3 binding [1081](https://github.com/dapr/components-contrib/pull/1081)
- **ENABLE** setup SMTP binding without user and password [1082](https://github.com/dapr/components-contrib/issues/1082)
- **ADDED** Multi-valued secret support in the local file store [1090](https://github.com/dapr/components-contrib/issues/1090)
- **RESOLVED** Support Azure AD auth for Cosmos DB [1104](https://github.com/dapr/components-contrib/pull/1104)
- **RESOLVED** feat(pubsub): add in-memory pub/sub [1106](https://github.com/dapr/components-contrib/pull/1106)
- **FIXED** Fix parseErr return in blobstorage Init() [1108](https://github.com/dapr/components-contrib/pull/1108)
- **RESOLVED** Add Close() method to influx bindings [1114](https://github.com/dapr/components-contrib/pull/1114)
- **RESOLVED** Patch regression in cosmosdb state component Init [1119](https://github.com/dapr/components-contrib/pull/1119)
- **RESOLVED** Adding `initialOffset` option to Kafka binding and pubsub components [1120](https://github.com/dapr/components-contrib/pull/1120)
- **RESOLVED** Support DefaultIdentificationHydrator in cosmosdb state component [1121](https://github.com/dapr/components-contrib/pull/1121)
### Dashboard
- **RESOLVED** Several improvements to the dashboard layout [149](https://github.com/dapr/dashboard/pull/149)
- **RESOLVED** Add a secondary port to try for metadata requests [160](https://github.com/dapr/dashboard/pull/160)
### .NET SDK
- **RESOLVED** Expose http timeout in ActorProxy [728](https://github.com/dapr/dotnet-sdk/issues/728)
- **ADDED** Add match and priority to TopicAttribute for PubSub routing. [746](https://github.com/dapr/dotnet-sdk/pull/746)
- **ADDED** Add support for subscribing to raw messages [709](https://github.com/dapr/dotnet-sdk/issues/728)
- **RESOLVED** Raspberry Pi4 build issue [729](https://github.com/dapr/dotnet-sdk/issues/729)
- **ADDED** Add Dapr authentication handler [688](https://github.com/dapr/dotnet-sdk/pull/688)
### Java SDK
- **FIXED** Pub/sub binding for Spring Boot properly reads @PostMapping value [575](https://github.com/dapr/java-sdk/issues/575)
- **RESOLVED** Automatically unwrap pub/sub CloudEvent [576](https://github.com/dapr/java-sdk/issues/576)
- **RESOLVED** Including in Spring Boot project [582](https://github.com/dapr/java-sdk/issues/582)
- **DEPRECATED** Builder classes in favor of setters on SDK Request classes [587](https://github.com/dapr/java-sdk/issues/587)
- **RESOLVED** Allow development with JDK 16 + add build with multiple JDK versions [594](https://github.com/dapr/java-sdk/issues/594)
### Python SDK
- **RESOLVED** Invoking a service method inside an Actor method doesn't work [260](https://github.com/dapr/python-sdk/issues/260)
- **RESOLVED** Adding optional Rule to subscription annotations for PubSub routing [266](https://github.com/dapr/python-sdk/pull/266)
- **RESOLVED** Add matrix build for python versions [267](https://github.com/dapr/python-sdk/pull/267)
- **FIXED** Actor Reminders do not honour period value, use due time instead [268](https://github.com/dapr/python-sdk/issues/268)
- **RESOLVED** Dev container build breaks on Mac M1 [269](https://github.com/dapr/python-sdk/issues/269)

## Upgrading to Dapr 1.4.0

To upgrade to this release of Dapr, follow the steps here to upgrade.

**Important: If you are running a production cluster and cannot handle some downtime there are special steps that required to upgrade from 1.3.0 to 1.4.0 to ensure no downtime. See [Production upgrade from 1.3.0 to 1.4.0](#Production-upgrade-from-130-to-140) for detailed steps**

### Local Machine / Self-hosted

Uninstall Dapr using the CLI you currently have installed. Note that this will remove the default $HOME/.dapr directory, binaries and all containers dapr_redis, dapr_placement and dapr_zipkin. Linux users need to run sudo if docker command needs sudo:

```bash
dapr uninstall --all
```

For RC releases like this, download the latest and greatest release from [here](https://github.com/dapr/cli/releases) and put the `dapr` binary in your PATH.

Once you have installed the CLI, run:

```bash
dapr init --runtime-version=1.4.0
```

Wait for the update to finish,  ensure you are using the latest version of Dapr(1.4.0) with:

```bash
$ dapr --version

CLI version: 1.4.0
Runtime version: 1.4.0
```

### Kubernetes

#### Upgrading from previous version

You can perform zero-downtime upgrades using both Helm 3 and the Dapr CLI.

##### Upgrade using the CLI

Download the latest RC release from [here](https://github.com/dapr/cli/releases) and put the `dapr` binary in your PATH.

To upgrade Dapr, run:

```
dapr upgrade --runtime-version 1.4.0 -k
```

To upgrade with high availability mode:

```
dapr upgrade --runtime-version 1.4.0 --enable-ha=true -k
```

Wait until the operation is finished and check your status with `dapr status -k`.

All done!

*Note: Make sure your deployments are restarted to pick the latest version of the Dapr sidecar*

##### Upgrade using Helm

To upgrade Dapr using Helm, run:

```
helm repo add dapr https://dapr.github.io/helm-charts/
helm repo update

helm upgrade dapr dapr/dapr --version 1.4.0 --namespace=dapr-system --wait
```

Wait until the operation is finished and check your status with `dapr status -k`.

All done!

*Note: Make sure your deployments are restarted to pick the latest version of the Dapr sidecar*

#### Starting a fresh install on a cluster

Please see [how to deploy Dapr on a Kubernetes cluster](https://docs.dapr.io/operations/hosting/kubernetes/kubernetes-deploy/) for a complete guide to installing Dapr on Kubernetes

You can use Helm 3 to install Dapr:
```
helm repo add dapr https://dapr.github.io/helm-charts/
helm repo update

kubectl create namespace dapr-system

helm install dapr dapr/dapr --version 1.4.0 --namespace dapr-system --wait
```

Alternatively, you can use the latest version of CLI:

```
dapr init --runtime-version=1.4.0 -k
```

##### Post installation

Verify the control plane pods are running and are healthy:

```
$ dapr status -k
  NAME                   NAMESPACE    HEALTHY  STATUS   REPLICAS  VERSION  AGE  CREATED
  dapr-dashboard         dapr-system  True     Running  1         0.8.0   15s  2021-09-13 13:07.39
  dapr-sidecar-injector  dapr-system  True     Running  1         1.4.0   15s  2021-09-13 13:07.39
  dapr-sentry            dapr-system  True     Running  1         1.4.0   15s  2021-09-13 13:07.39
  dapr-operator          dapr-system  True     Running  1         1.4.0   15s  2021-09-13 13:07.39
  dapr-placement         dapr-system  True     Running  1         1.4.0   15s  2021-09-13 13:07.39
```

After Dapr 1.4.0 has been installed, perform a rolling restart for your deployments to pick up the new version of the sidecar.
This can be done with:

```
kubectl rollout restart deploy/<deployment-name>
```
## Production upgrade from 1.3.0 to 1.4.0

In 1.3.0 a bug was introduced that prevented no downtime upgrades, meaning the upgrading from 1.3.0 to 1.4.0 causes all the Dapr sidecars in a cluster to restart at the same time. 

A new patch release v1.3.1 has been released to address this issue. For successful no downtime upgrade, you need to first deploy the v1.3.1 release.

**Overview**

This is a fix for a regression caused by making Dapr sidecar crash if it cannot reach the Dapr Operator. Dapr Operator can be down due to upgrades, for example, and should not impact running Dapr sidecars. Dapr guarantees zero downtime upgrades, and this bug violates this guarantee.

DO NOT upgrade from 1.3.0 to 1.3.1 or any other version without performing the following steps first:

First upgrade the sidecar injector

```
helm repo update
helm upgrade dapr dapr/dapr --set-string dapr_sidecar_injector.image.name=docker.io/daprio/daprd:1.3.1 -n dapr-system
```

Then do a rollout deployment that use the Dapr sidecar

```
kubectl rollout restart deploy/<name>
```

Now, follow [instructions to upgrade to 1.4.0](#Upgrading-to-Dapr-140) as usual.


## Breaking Changes

### Dapr Runtime
- **DELETED** GET shutdown API, following deprecation [3651](https://github.com/dapr/dapr/issues/3651)
- **BLOCKED** Cross Pods calls to Dapr sidecar by default in K8s [2914](https://github.com/dapr/dapr/issues/2914)