dapr / java-sdk

Dapr SDK for Java
Apache License 2.0
260 stars 206 forks source link

Undocumented checks prevent PublishEventRequest metadata fields to reach the pubsub.azure.servicebus component #675

Open MoeweX opened 2 years ago

MoeweX commented 2 years ago

Expected Behavior

When we set metadata fields on a PublishEventRequest field, they should be received and processed by the pubsub.azure.servicebus component.

Actual Behavior

It seems like the fields are set properly (when we log the PublishEventRequest object before publishing it we can see them), but they do not reach the component (visible when inspecting the events in the Azure Portal).

Steps to Reproduce the Problem

Tested with dapr-sdk version 1.3.1 and dapr-runtime 1.4.3

  1. Create a PublishEventRequest
  2. Set a metadata field, e.g., with eventRequest.getMetadata().put(“MessageId”, id); and eventRequest.getMetadata().put(“ScheduledEnqueueTimeUtc”, “Wed Jan 19 11:06:00 GMT 2022”)
  3. Log the PublishEventRequest, the output might look like so: publishing event with metadata: ScheduledEnqueueTimeUtc=Wed Jan 19 11:06:00 GMT 2022;MessageId=time-trigger;1642590360;Europe/Berlin;0;1000
  4. Publish the event via Dapr
  5. Observe the event in the Azure portal, the events do not have a message id and are also available immediately.

Release Note

RELEASE NOTE:

MoeweX commented 2 years ago

We digged some deeper into this and found a lot of undocumented errors that prevented us from using it, e.g.,

  1. use wrong date format -> message appears immediately -> property is not shown
  2. use date in past -> message appears immediately -> property is visible
  3. use date too far in future -> message appears nowhere -> gives the impression, nothing worked
  4. typo in property name -> -> message appears immediately -> property is not shown
  5. time must be given in GMT -> 10:17 CET (Berlin) == 09:17 CET

Date in correct format that works is e.g. Wed, 19 Jan 2022 09:04:00 GMT. 2022-01-19T18:30:17.001453Z does not work

jjcollinge commented 2 years ago

Thanks for digging into this, I'll see if we can make this a little easier 👍.

mukundansundar commented 2 years ago

@MoeweX Are you seeing this issue only with azure servicebus component ?