| /** |
| * 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. |
| */ |
| |
| #ifndef ROCKETMQ_CLIENT_PHP_PUSH_CONSUMER_H_ |
| #define ROCKETMQ_CLIENT_PHP_PUSH_CONSUMER_H_ |
| |
| #include "common.h" |
| #include "message.h" |
| #include <rocketmq/DefaultMQPushConsumer.h> |
| |
| |
| class PushConsumer : public Php::Base{ |
| private: |
| std::string groupName; |
| std::string namesrv_domain; |
| std::string topic; |
| rocketmq::DefaultMQPushConsumer *consumer; |
| Php::Value callback; |
| int msgListenerType; |
| int maxRequestTime = 3600; |
| |
| public: |
| PushConsumer(){} |
| virtual ~PushConsumer(){} |
| virtual void __construct(Php::Parameters ¶ms); |
| |
| void doRebalance(); |
| |
| void persistConsumerOffset(); |
| |
| void persistConsumerOffsetByResetOffset(); |
| |
| void setNamesrvDomain(Php::Parameters ¶m); |
| |
| Php::Value getNamesrvDomain(); |
| |
| void setNamesrvAddr(Php::Parameters ¶m); |
| |
| Php::Value getNamesrvAddr(); |
| |
| void setInstanceName(Php::Parameters ¶m); |
| |
| void setTryLockTimeout(Php::Parameters ¶m); |
| |
| void setConnectTimeout(Php::Parameters ¶m); |
| |
| void setListenerType(Php::Parameters ¶m); |
| |
| void setThreadCount(Php::Parameters ¶m); |
| |
| void subscribe(Php::Parameters ¶m); |
| |
| void setCallback(Php::Parameters ¶m); |
| |
| Php::Value getConsumeType(); |
| |
| Php::Value getConsumeFromWhere(); |
| |
| void setConsumeFromWhere(Php::Parameters ¶m); |
| |
| void setMaxRequestTime(Php::Parameters ¶m); |
| |
| void start(); |
| |
| void shutdown(); |
| |
| virtual void __destruct() { } |
| |
| void setSessionCredentials(Php::Parameters ¶m); |
| Php::Value getSessionCredentials(); |
| |
| Php::Value getMessageModel(); |
| void setMessageModel(Php::Parameters ¶ms); |
| |
| // void setTcpTransportPullThreadNum(int num); |
| void setTcpTransportPullThreadNum(Php::Parameters ¶m); |
| |
| // const int getTcpTransportPullThreadNum() const; |
| Php::Value getTcpTransportPullThreadNum(); |
| |
| // void setTcpTransportConnectTimeout(uint64_t timeout); // ms |
| void setTcpTransportConnectTimeout(Php::Parameters ¶m); |
| // const uint64_t getTcpTransportConnectTimeout() const; |
| Php::Value getTcpTransportConnectTimeout(); |
| |
| // void setTcpTransportTryLockTimeout(uint64_t timeout); // ms |
| void setTcpTransportTryLockTimeout(Php::Parameters ¶m); |
| // const uint64_t getTcpTransportConnectTimeout() const; |
| Php::Value getTcpTransportTryLockTimeout(); |
| |
| //void setUnitName(std::string unitName); |
| void setUnitName(Php::Parameters ¶m); |
| //const std::string& getUnitName(); |
| Php::Value getUnitName(); |
| |
| //void setLogLevel(elogLevel inputLevel); |
| void setLogLevel(Php::Parameters ¶m); |
| //ELogLevel getLogLevel(); |
| Php::Value getLogLevel(); |
| //void setLogFileSizeAndNum(int fileNum, long perFileSize); // perFileSize is MB unit |
| void setLogFileSizeAndNum(Php::Parameters ¶m); |
| |
| |
| }; |
| |
| void registerPushConsumer(Php::Namespace &rocketMQNamespace); |
| |
| #endif |