Skip to content

Commit

Permalink
make consumer info cluster field optional
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ghtmare authored and caspervonb committed Feb 24, 2023
1 parent 5ad3cf2 commit 046e595
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion async-nats/src/jetstream/consumer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ pub struct Info {
pub num_pending: u64,
/// Information about the consumer's cluster
#[serde(default)]
pub cluster: ClusterInfo,
pub cluster: Option<ClusterInfo>,
/// Indicates if any client is connected and receiving messages from a push consumer
#[serde(default)]
pub push_bound: bool,
Expand Down
4 changes: 3 additions & 1 deletion async-nats/tests/jetstream_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,9 @@ mod jetstream {
.await
.unwrap();

assert_eq!(consumer.cached_info().cluster.replicas.len(), 2);
let cluster = consumer.cached_info().cluster.as_ref().unwrap();

assert_eq!(cluster.replicas.len(), 2);

context.delete_stream("events2").await.unwrap();
}
Expand Down

0 comments on commit 046e595

Please sign in to comment.