Closed Euynac closed 10 months ago
hi
Please check the Dapr integration sample.
https://github.com/abpframework/abp-samples/tree/master/Dapr
Thank you for the information. I discovered that in order to parse the Content-Type application/cloudevents+json
with JSON format data_base64
while setting RawPayload
to true, I have to use the app.UseCloudEvents()
middleware. Additionally, this middleware should be placed before the app.UseConfiguredEndpoints()
middleware to work.
Is there an existing issue for this?
Description
I appreciate the integration of Dapr within the framework; however, I've encountered challenges that need attention.
Documentation lack of clarity
While meticulously following the documentation for my project setup, specifically regarding endpoints such as
/dapr/subscribe
, I faced difficulty achieving the expected results. Upon extensive investigation, I discovered that the addition ofapp.UseConfiguredEndpoints();
is necessary for ABP to appropriately register the relevant endpoints.Subscriber Error
Upon configuring the endpoints as directed, I managed to acquire two endpoints for Dapr invocation. Nevertheless, an error persists:
The error stems from the source code of AbpAspNetCoreMvcDaprEventsController, specifically:
The problem lies in the exception thrown when a JSON property isn't found, leading to the failure of the conditional check. If there is no json property named given key, it will throw exception rather than given null or empty, so the judge part will never work if there has some error in request body.
Source Code Adjustment
I identified that the root cause of the unsupported request JSON format is the hardcoded metadata:
rawPayload: true
inAbpAspNetCoreMvcDaprEventBusModule
. Despite attempting to disableapp.UseCloudEvents()
, the issue persisted.Upon experimentation, I discovered that altering rawPayload to false enables proper functionality between ABP pubsub and Dapr.
For reference, here's a link detailing the specifications of Dapr pubsub regarding raw payload: dapr pubsub about raw payload
I would greatly appreciate any guidance or assistance in rectifying these issues to ensure seamless interoperability between ABP and Dapr's DistributedEventBus.
Reproduction Steps
No response
Expected behavior
No response
Actual behavior
No response
Regression?
No response
Known Workarounds
No response
Version
7.4.2
User Interface
Common (Default)
Database Provider
EF Core (Default)
Tiered or separate authentication server
None (Default)
Operation System
Windows (Default)
Other information
No response