Crates.io | kooka_lib_messenger |
lib.rs | kooka_lib_messenger |
version | 0.1.2 |
source | src |
created_at | 2018-08-07 12:05:26.200919 |
updated_at | 2019-05-29 01:12:55.51379 |
description | Communication between services by using Nats |
homepage | |
repository | https://bitbucket.org/green__team/lib_messenger/ |
max_upload_size | |
id | 78017 |
size | 6,157 |
Communication between services by using Nats
use kooka_lib_messenger::sender;
if let Err(e) = sender::produce_message(&data, &format!("{}.{}", SUBJECT_BASE, "test_request")) {
println!("Failed producing messages: {}", e);
}
use kooka_lib_messenger::receiver;
match receiver::subscribe("some_route", None) {
Ok(client) => {
println!("Connected....");
let message = receiver::consume_messages(client).unwrap();
println!("Message: ", message);
},
Err(e) => {
println!("Subscribe error: {}", e);
}
}