Skip to content

Commit

Permalink
fix advanced pub
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisBiryukov91 committed Dec 11, 2024
1 parent 52c185d commit 7e9508b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/z_advanced_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
struct args_t {
char* keyexpr; // -k, --key
char* value; // -p, --payload
size_t history; // -o, --history
size_t history; // -i, --history
};
struct args_t parse_args(int argc, char** argv, z_owned_config_t* config);

Expand All @@ -34,6 +34,11 @@ int main(int argc, char** argv) {
z_owned_config_t config;
struct args_t args = parse_args(argc, argv, &config);

if (zc_config_insert_json5(z_loan_mut(config), Z_CONFIG_ADD_TIMESTAMP_KEY, "true") < 0) {
printf("Unable to configure timestamps!\n");
exit(-1);
}

printf("Opening session...\n");
z_owned_session_t s;
if (z_open(&s, z_move(config), NULL) < 0) {
Expand All @@ -55,7 +60,7 @@ int main(int argc, char** argv) {
pub_opts.publisher_detection = true;
pub_opts.sample_miss_detection = true;

if (ze_declare_advanced_publisher(z_loan(s), &pub, z_loan(ke), NULL) < 0) {
if (ze_declare_advanced_publisher(z_loan(s), &pub, z_loan(ke), &pub_opts) < 0) {
printf("Unable to declare AdvancedPublisher for key expression!\n");
exit(-1);
}
Expand Down

0 comments on commit 7e9508b

Please sign in to comment.