-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build in KafkaPort, added KafkaConsumerPort
- Loading branch information
Neil Stephens
committed
Jul 26, 2024
1 parent
4aa47fe
commit 7045679
Showing
8 changed files
with
212 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* opendatacon | ||
* | ||
* Copyright (c) 2014: | ||
* | ||
* DCrip3fJguWgVCLrZFfA7sIGgvx1Ou3fHfCxnrz4svAi | ||
* yxeOtDhDCXf1Z4ApgXvX5ahqQmzRfJ2DoX8S05SqHA== | ||
* | ||
* Licensed 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. | ||
*/ | ||
/* | ||
* KafkaConsumerPort.cpp | ||
* | ||
* Created on: 26/07/2024 | ||
* Author: Neil Stephens | ||
*/ | ||
|
||
#include "KafkaConsumerPort.h" | ||
#include "KafkaPort.h" | ||
#include <opendatacon/asio.h> | ||
#include <opendatacon/spdlog.h> | ||
#include <kafka/KafkaConsumer.h> | ||
#include <chrono> | ||
#include <memory> | ||
|
||
void KafkaConsumerPort::Build() | ||
{ | ||
pKafkaConsumer = KafkaPort::Build<KCC::KafkaConsumer>("Consumer"); | ||
//TODO: set up the consumer | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* opendatacon | ||
* | ||
* Copyright (c) 2014: | ||
* | ||
* DCrip3fJguWgVCLrZFfA7sIGgvx1Ou3fHfCxnrz4svAi | ||
* yxeOtDhDCXf1Z4ApgXvX5ahqQmzRfJ2DoX8S05SqHA== | ||
* | ||
* Licensed 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. | ||
*/ | ||
/* | ||
* KafkaConsumerPort.h | ||
* | ||
* Created on: 26/07/2024 | ||
* Author: Neil Stephens | ||
*/ | ||
|
||
#ifndef KAFKACONSUMERPORT_H | ||
#define KAFKACONSUMERPORT_H | ||
|
||
#include "KafkaPort.h" | ||
#include <kafka/KafkaConsumer.h> | ||
|
||
using namespace odc; | ||
namespace KCC = kafka::clients::consumer; | ||
|
||
class KafkaConsumerPort: public KafkaPort | ||
{ | ||
public: | ||
KafkaConsumerPort(const std::string& Name, const std::string& Filename, const Json::Value& Overrides) | ||
:KafkaPort(Name,Filename,Overrides){}; | ||
virtual ~KafkaConsumerPort(){}; | ||
|
||
virtual void Build() override; | ||
virtual void Event(std::shared_ptr<const EventInfo> event, const std::string& SenderName, SharedStatusCallback_t pStatusCallback) override {} | ||
private: | ||
std::shared_ptr<KCC::KafkaConsumer> pKafkaConsumer; | ||
}; | ||
|
||
#endif // KAFKACONSUMERPORT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters