elsa-core/src/modules/Elsa.Workflows.Runtime/Extensions
Sipke Schoorstra b534b42a60
Update Kafka Module: Add Support for Configuring Consumer and Producer Factories (#6139)
* Enable Kafka Worker Factory and Refactor Worker Implementation

Introduce a flexible worker factory mechanism allowing custom worker creation with DefaultWorkerFactory as the initial implementation. Enhance Worker class to be generic, remove manual consumer configuration, and streamline message processing logic, improving code maintainability and extensibility.

* Refactor Kafka configuration properties

Renamed configuration properties in Consumer and Producer entities. Updated references in the codebase to use the new `Config` property instead of `ConsumerConfig` and `BootstrapServers`. Adjusted appsettings.json to match the new configuration schema.

* Add Kafka producer and consumer implementation

Implemented classes and interfaces to handle Kafka producers and consumers, including `ProducerProxy`, `ConsumerProxy`, and related context classes and factories. Refactored existing code to utilize these new implementations, replacing worker terminology with consumer and addressing context-specific fields.

* Remove redundant code in DefaultConsumerFactory and SendMessage

Removed commented-out unused return statement in DefaultConsumerFactory. Also eliminated explicit producer.Dispose() call in SendMessage, as the 'using' statement already handles resource cleanup.

* Add ExpandoObject producer and consumer factories

Replaced DefaultSerializers with new JsonSerializer and JsonDeserializer classes. Introduced ExpandoObjectProducerFactory and ExpandoObjectConsumerFactory to handle dynamic types. Updated workflow and configuration to use the new factories.

* Refactor bookmark processing and manage worker subscriptions

Refactored bookmark processing logic to utilize extension methods. Optimized worker subscriptions by centralizing topic subscription management and added logging for subscribed topics. This improves maintainability and clarity of the codebase.

* Refactor worker creation to use ActivatorUtilities

Updated WorkerManager to instantiate workers using ActivatorUtilities for better dependency injection support. This enhances code readability and maintains consistency with the service provider approach used throughout the codebase.
2024-11-22 20:07:14 +01:00
..
ActivityExecutionPipelineBuilderExtensions.cs Remove unnecessary namespace declarations and using statements 2024-07-24 22:51:06 +02:00
BookmarkExtensions.cs Update Kafka Module: Add Support for Configuring Consumer and Producer Factories (#6139) 2024-11-22 20:07:14 +01:00
BookmarkQueueItemExtensions.cs Add Bookmark Queue and Restore Background Activity Execution (#5758) 2024-07-15 22:37:14 +02:00
DeferredTasksExecutionContextExtensions.cs Fix all broken summary xml docs (#6123) 2024-11-18 13:41:27 +01:00
DependencyInjectionExtensions.cs Multitenancy (#5159) 2024-06-10 21:30:53 +02:00
LogExtensions.cs Add log message sanitization for PostgreSQL (#5104) 2024-03-20 19:29:12 +01:00
ModuleExtensions.cs Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
PipelineWorkflowsFeatureExtensions.cs Fix all broken summary xml docs (#6123) 2024-11-18 13:41:27 +01:00
StoredBookmarkExtensions.cs Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
StoredTriggerExtensions.cs
StoredTriggerStoreExtensions.cs Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
WorkflowBrokerExtensions.cs Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
WorkflowClientExtensions.cs Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
WorkflowDictionaryExtensions.cs Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
WorkflowDispatcherExtensions.cs Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
WorkflowExecutionPipelineBuilderExtensions.cs Fix all broken summary xml docs (#6123) 2024-11-18 13:41:27 +01:00
WorkflowsFeatureExtensions.cs Add OpenTelemetry support for tracing workflow execution 2024-09-23 11:35:43 +02:00
WorkflowTriggerExtensions.cs Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00