mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
cluster/zeromq: Use NodeId(), drop my_node_id
This commit is contained in:
parent
769044e8e1
commit
df78a94c76
2 changed files with 3 additions and 5 deletions
|
@ -80,7 +80,6 @@ ZeroMQBackend::ZeroMQBackend(std::unique_ptr<EventSerializer> es, std::unique_pt
|
|||
void ZeroMQBackend::DoInitPostScript() {
|
||||
ThreadedBackend::DoInitPostScript();
|
||||
|
||||
my_node_id = zeek::id::find_val<zeek::StringVal>("Cluster::Backend::ZeroMQ::my_node_id")->ToStdString();
|
||||
listen_xpub_endpoint =
|
||||
zeek::id::find_val<zeek::StringVal>("Cluster::Backend::ZeroMQ::listen_xpub_endpoint")->ToStdString();
|
||||
listen_xsub_endpoint =
|
||||
|
@ -241,7 +240,7 @@ bool ZeroMQBackend::DoPublishEvent(const std::string& topic, const std::string&
|
|||
// * The serialized event itself.
|
||||
std::array<zmq::const_buffer, 4> parts = {
|
||||
zmq::const_buffer(topic.data(), topic.size()),
|
||||
zmq::const_buffer(my_node_id.data(), my_node_id.size()),
|
||||
zmq::const_buffer(NodeId().data(), NodeId().size()),
|
||||
zmq::const_buffer(format.data(), format.size()),
|
||||
zmq::const_buffer(buf.data(), buf.size()),
|
||||
};
|
||||
|
@ -305,7 +304,7 @@ bool ZeroMQBackend::DoPublishLogWrites(const logging::detail::LogWriteHeader& he
|
|||
// * The serialized log write itself.
|
||||
std::array<zmq::const_buffer, 4> parts = {
|
||||
zmq::const_buffer{message_type.data(), message_type.size()},
|
||||
zmq::const_buffer(my_node_id.data(), my_node_id.size()),
|
||||
zmq::const_buffer(NodeId().data(), NodeId().size()),
|
||||
zmq::const_buffer{format.data(), format.size()},
|
||||
zmq::const_buffer{buf.data(), buf.size()},
|
||||
};
|
||||
|
@ -438,7 +437,7 @@ void ZeroMQBackend::Run() {
|
|||
|
||||
// Filter out messages that are coming from this node.
|
||||
std::string sender(msg[1].data<const char>(), msg[1].size());
|
||||
if ( sender == my_node_id )
|
||||
if ( sender == NodeId() )
|
||||
continue;
|
||||
|
||||
detail::byte_buffer payload{msg[3].data<std::byte>(), msg[3].data<std::byte>() + msg[3].size()};
|
||||
|
|
|
@ -62,7 +62,6 @@ private:
|
|||
bool DoProcessBackendMessage(int tag, detail::byte_buffer_span payload) override;
|
||||
|
||||
// Script level variables.
|
||||
std::string my_node_id;
|
||||
std::string connect_xsub_endpoint;
|
||||
std::string connect_xpub_endpoint;
|
||||
std::string listen_xsub_endpoint;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue