-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elsa 3.0.5 - Programmatic workflow with MassTransit MessageReceived activity not starting workflow #4968
Comments
Based on the context provided, it seems like you are experiencing an issue where the workflow triggered by a message received from RabbitMQ using Elsa.MassTransit is not starting as expected. This could be due to a variety of reasons, such as misconfiguration of the message handling, incorrect setup of the workflow trigger, or an issue with the Elsa or Elsa.MassTransit packages. To troubleshoot this issue, you can follow these steps:
If you have already tried these steps and are still facing the issue, it would be helpful to provide more detailed information about your configuration and any error messages you are seeing. Additionally, you can check the Elsa GitHub repository for any open issues or discussions related to your problem, as someone else might have encountered a similar issue. For further assistance, you can reach out to the Elsa community on GitHub or Gitter, where you can find support from the developers and other users of the Elsa workflow library. |
From my investigation on making this work on my end, it's because the You can workaround it by overriding that property to match what it does when creating a trigger from the designer. new MessageReceived
{
CanStartWorkflow = true,
Type = ActivityTypeNameHelper.GenerateTypeName(typeof(YourMessageType)),
MessageType = typeof(YourMessageType),
Result = new(message)
} |
@RyoukoKonpaku Thank you for the hint! Added the Type property, now it is working correctly. |
@sfmskywalker is there any way to contribute to the documentation somehow? 😄 |
@ckeller81 For sure, thank you for asking! To contribute, please follow these steps:
Notes:
Please let me know if there's anything I can help with to get you going. Thanks for considering contributing to the documentation, we really could use some help! |
When following this example I get a serialization issue. Have you experienced this as well?
Seems related to: #5210 |
Hey @hrb-amason The serialization issue you encounter is (as stated in #5210) because the System.Text.Json Serializer does not natively support serializing System.Type. Mostly because of this issue (despite others), I always change the serializer to Newtonsoft.Json where I need JSON, also when using MassTransit and Elsa. To change the serializer, you have to add the package MassTransit.Newtonsoft and set the Newtonsoft Serializer inside the RabbitMq configuration part (check the MassTransit documentation and examples for more info). I would consider this, until #5210 is fixed. Hope this helps. |
Hey @ckeller81 Thanks for the response. This was helpful, I was able to replace the serializer for mass transit. Is it possible to point me to sample on how to override the serializer in ELSA? I have ran into some other issues with the serializer and I haven't found a sample that replaces the serializer with Newtonsoft. I tried creating my own implementation of https://github.com/elsa-workflows/elsa-core/blob/main/src/modules/Elsa.Common/Contracts/IJsonSerializer.cs but that hasn't worked. Thanks again! |
Closing this as resolved. Thanks everyone for your contributions! |
Summary:
When using Elsa with Elsa.MassTransit and Elsa.MassTransit.RabbitMq and using the MessageReceived activity in a programmatically defined workflow as a start activity / trigger, the workflow is never started.
Used Version
All packages are from NuGet in the version 3.0.5, the example project does not have any other packages referenced.
Example-Code:
https://github.com/ckeller81/elsa-masstransit-test
Reproduce steps:
Expected behaviour:
Actual behaviour:
Workaround
Use elsa without MassTransit, consume the bus-message in a own consumer and start the workflow from this consumer.
Thoughts
After some hours of research, I found out that the queue-message is consumed correctly, but it seems that the workflow-start trigger is either not finding the workflow, or the bookmark. But this was a bit too deep in the package. 😄
The text was updated successfully, but these errors were encountered: