lintel 0.2.0
Loading...
Searching...
No Matches
MessageQueueService.h
Go to the documentation of this file.
1#ifndef LINTEL_MESSAGEQUEUESERVICE_H
2#define LINTEL_MESSAGEQUEUESERVICE_H
3
6#include <map>
7#include <memory>
8#include <string>
9
15
16namespace lintel {
20class MessageQueueService : public AbstractService<MessageQueueService>
21{
22private:
23 std::shared_ptr<ProcessName> m_processName;
24 std::shared_ptr<IMessageQueueRepository> m_messageQueueRepository;
25 std::map<std::string, std::shared_ptr<MessageQueueEntry>> m_configurationMap;
26 std::map<std::string, std::shared_ptr<MessageQueue<Message>>> m_messageQueues{};
27
28 static std::map<std::string, std::shared_ptr<MessageQueueEntry>> init(
29 const std::shared_ptr<Configuration> &configuration);
30
31public:
38 MessageQueueService(const std::shared_ptr<Configuration> &configuration,
39 std::shared_ptr<ProcessName> processName,
40 std::shared_ptr<IMessageQueueRepository> messageQueueRepository);
41
47 std::unique_ptr<MessageQueue<Message>> of(const std::string &name);
48
54 std::pair<MessageQueueEntry, int32_t> numberMessagesOf(const MessageQueueEntry &entry);
55
56 void onInitialize() override;
57
58 void onShutdown() override {}
59};
60
61}// namespace lintel
62#endif// LINTEL_MESSAGEQUEUESERVICE_H
Definition AbstractService.h:58
Definition MessageQueueEntry.h:14
Definition MessageQueueService.h:21
std::unique_ptr< MessageQueue< Message > > of(const std::string &name)
void onInitialize() override
void onShutdown() override
Definition MessageQueueService.h:58
std::pair< MessageQueueEntry, int32_t > numberMessagesOf(const MessageQueueEntry &entry)
MessageQueueService(const std::shared_ptr< Configuration > &configuration, std::shared_ptr< ProcessName > processName, std::shared_ptr< IMessageQueueRepository > messageQueueRepository)
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9