LucidMQ
This subdirectory contains the library code for LucidMQ. LucidMQ is a library that implements event streaming directly into your application in a brokerless fashion. There is no external processes running, just import LucidMQ and start passing message though to your different applications that are also using LucidMQ.
Basic Useage
There are 4 main components that LucidMQ exposes:
-
LucidMQ: Handles all the metadata of the topics and initialization of consumers and producers.
-
Producer: Given a topic, the producer will write persistent messages to that topic.
-
Consumer: Given a topic, the consumer will read messages from that topic. It will know it's last read offset which is persisted. ALl consumers start at the oldest offset.
-
Message: Similar to kafka all messages utilize a key, value and timestamp format.
use ;
// Create our lucidmq instance
let mut lucidmq = new;
// Let's produce message to our message queue
let mut producer = lucidmq.new_producer;
// Create a message that you want to send.
// Every message has a key, value and timestamp.
let key = format!;
let value = format!;
let message = new;
producer.produce_message;
// Let's create a consumer to consumer our messages
let mut consumer = lucidmq.new_consumer;
// Get all the messages for that polling period
let records = consumer.poll;
// Print out all of the messages recieved.
for record in records