Skip to content

Releases: ene-rs/ene-kafka

0.2.0

22 Sep 12:08
903bdd2
Compare
Choose a tag to compare

What's Changed

  • id is now a mandatory field in the cloud event macro. It should be one of the event fields
  • New consumer interface! This release introduces an more intuitive consumer declaration interface for the handlers:
let consumer = kafka_consumer!(
    topic = KafkaTopic {
        name: "test".to_string(),
        content_type: ContentType::Json
    },
    dlq_topic = KafkaTopic {
        name: "test-dlq".to_string(),
        content_type: ContentType::Json
    },
    consumer_group_id = "test-group",
    bootstrap_servers = bootstrap_servers,
    handlers = {
        entity_created_event_handler: EntityCreatedEventHandler = EntityCreatedEventHandler {}
    }
);

With this interface update, the implementation has been significantly simplified. Previously, an enumeration was generated for all the handlers of a consumer, and a vector was used to store each enumeration variant. This was not great, because you needed to iterate through the heap-stored vector, destructure the enumeration, and check if any variant match the event type. With this new interface, The consumer will contain a dispatcher, which has a fixed list of handlers as fields. The macro will generate a set of if statements to check whether any handle can handle the event.

  • rdkafka as a feature flag
    As a preparation for a potentially another underlying kafka implementation, rdkafka is now a feature flag of the ene_kafka crate. This means that when we have more implementations later, the crates user just needs to change the feature flag to the desired implementation :). For now, rdkafka is the default feature flag

  • Various bug fixes and improvements

0.1.2

13 Sep 05:07
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.1.1...0.1.2

0.1.1

06 Sep 18:10
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.1.0...0.1.1

0.1.0

29 Jul 18:49
Compare
Choose a tag to compare

Initial alpha release