rocketmq-client-nodejs-beta
Version:
RocketMQ Node.js Client
47 lines • 3.41 kB
JavaScript
;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.MessageQueue = void 0;
const definition_pb_1 = require("../../proto/apache/rocketmq/v2/definition_pb");
const util_1 = require("../util");
const Broker_1 = require("./Broker");
class MessageQueue {
topic;
queueId;
broker;
permission;
acceptMessageTypesList;
constructor(messageQueue) {
this.topic = messageQueue.getTopic().toObject();
this.queueId = messageQueue.getId();
this.permission = messageQueue.getPermission();
this.acceptMessageTypesList = messageQueue.getAcceptMessageTypesList();
this.broker = new Broker_1.Broker(messageQueue.getBroker().toObject());
}
toProtobuf() {
const messageQueue = new definition_pb_1.MessageQueue();
messageQueue.setId(this.queueId);
messageQueue.setTopic((0, util_1.createResource)(this.topic.name));
messageQueue.setBroker(this.broker.toProtobuf());
messageQueue.setPermission(this.permission);
messageQueue.setAcceptMessageTypesList(this.acceptMessageTypesList);
return messageQueue;
}
}
exports.MessageQueue = MessageQueue;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWVzc2FnZVF1ZXVlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3JvdXRlL01lc3NhZ2VRdWV1ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7Ozs7OztHQWVHOzs7QUFFSCxnRkFHc0Q7QUF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