rocketmq_remoting/protocol/body/
query_consume_queue_response_body.rs

1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17use cheetah_string::CheetahString;
18use serde::Deserialize;
19use serde::Serialize;
20
21use crate::protocol::body::consume_queue_data::ConsumeQueueData;
22use crate::protocol::heartbeat::subscription_data::SubscriptionData;
23
24#[derive(Serialize, Deserialize, Debug, Clone, Default)]
25#[serde(rename_all = "camelCase")]
26pub struct QueryConsumeQueueResponseBody {
27    subscription_data: SubscriptionData,
28    filter_data: CheetahString,
29    queue_data: Vec<ConsumeQueueData>,
30    max_queue_index: i64,
31    min_queue_index: i64,
32}
33
34#[cfg(test)]
35mod tests {
36    use super::*;
37
38    #[test]
39    fn query_consume_queue_response_body_default_values() {
40        let response_body: QueryConsumeQueueResponseBody = Default::default();
41        //assert_eq!(response_body.subscription_data, SubscriptionData::default());
42        assert_eq!(response_body.filter_data, "");
43        assert!(response_body.queue_data.is_empty());
44        assert_eq!(response_body.max_queue_index, 0);
45        assert_eq!(response_body.min_queue_index, 0);
46    }
47}