dapr / dapr/samples

Transactional outbox messages not being published in Outbox sample

Open
#221 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
443
Forks
180
PR merge metrics
No merged PRs in 30d

Description

## In what area(s)?

/area runtime

> /area operator

> /area placement

> /area docs

> /area test-and-release

## What version of Dapr?

Sample is on 1.12.0, but I have also reproduced the behavior in 1.13.5

## Expected Behavior

I was interested in trying out the Transactional Outbox feature which is currently in preview along with Azure Cosmos DB and Azure Service Bus. I downloaded the [sample application for Transactional Outbox](https://github.com/dapr/samples/tree/master/outbox) and made a couple modifications to use Cosmos and Service Bus instead, which I've detailed in the "Steps to Reproduce the Problem" section below. Since [Cosmos DB supports Transactions](https://docs.dapr.io/reference/components-reference/supported-state-stores/), I was under the impression this should work out of the box.

The expected behavior is that, after the sample makes a state transaction, a message should be published to the configured `outboxPublishPubsub` and `outboxPublishTopic` given by the state component.

## Actual Behavior

The actual behavior is that no messages are sent.

If I look in Azure Service Bus, I can see that `defaultorder-processorordersoutbox`, `defaultorder-processorordersoutbox`, and `orders` topics are created, but none of those topics have any messages published to them.

## Steps to Reproduce the Problem

1. Clone the [sample application for Transactional Outbox](https://github.com/dapr/samples/tree/master/outbox) and replace the following resource files with the given snippets:

`resources/pubsub.yaml`:
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: orderpubsub
spec:
type: pubsub.azure.servicebus.topics
version: v1
metadata:
- name: connectionString
value:
```

`resources/statestore.yaml`:
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
spec:
type: state.azure.cosmosdb
version: v1
metadata:
- name: url
value:
- name: masterKey
value:
- name: database
value: Orders
- name: collection
value: Items
- name: outboxPublishPubsub
value: orderpubsub
- name: outboxPublishTopic
value: orders
```

(Everything else is unmodified.)

2. Run the applications using `dapr run -f .` as indicated in the instructions.

3. Observe that the messages that are supposed to be published as a result of the state transaction are not actually published.

I have also tried replacing those with the SQLite storage component and the In-Memory pubsub component, and both of those appear to exhibit the same issue.

## Release Note

RELEASE NOTE:

Contributor guide

Open the contributing guide

Research direction

Start by running the outbox sample with the `resources/pubsub.yaml` and `resources/statestore.yaml` configurations, using `dapr run -f .` as described. Compare the state transaction behavior with the expected publication to the configured `outboxPublishPubsub` and `outboxPublishTopic`; done means messages appear in the configured topic, including with the reported Cosmos DB, SQLite, and in-memory combinations.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
backend, databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.