3

https://stackoverflow.com/a/33888439/156458 says

D-Bus didn't used to be a Linux (i.e. kernel) IPC, but an additional middleware IPC. But in the course of introduction of systemd, D-Bus became for several Linux distributions a part of the basic system.

Wikipedia says D-BUS is a "IPC daemon".

Does D-Bus count as

I heard Zeromq, RabbitMQ, Kafka are also middleware for IPC purposes. Are Zeromq, RabbitMQ, Kafka provided at the same level as D-Bus (above the level of Linux IPC methods)? Some compared ZeroMQ to D-Bus, so I was wondering if they are alternative to each other?

Tim
  • 1
  • 141
  • 372
  • 590
  • Imo dbus is both. Why it should be part of the system is a mystery to me, but then the whole systemd stack never has been a sane solution written by sysadmins – Rui F Ribeiro Jan 06 '19 at 12:59
  • Trashing systemd is off-topic here. – Philip Withnall Jan 06 '19 at 15:58
  • Note also that D-Bus and systemd are completely separate projects. D-Bus has been around since 2003, whereas systemd was first released in 2010. systemd depends on D-Bus; D-Bus has some systemd integration but does not depend on it. People use D-Bus because it apparently solves problems that they have with other IPC mechanisms (such as the lack of process addressing or a standard message format and type system). – Philip Withnall Jan 06 '19 at 16:14

1 Answers1

2

Firstly, and it’s slightly picky, but probably relevant enough to mention: ‘D-Bus’ is a protocol which is typically used with a message bus daemon (typically dbus-daemon, but other implementations have been written). It is possible to use the protocol without the daemon (for peer-to-peer messaging between processes on the same machine) or over a network, or whatever you want. The protocol just defines the type system, message structure, and call semantics.

I’ll assume for the rest of this answer that by ‘D-Bus’ you mean (as most people typically do) the combination of the protocol and dbus-daemon.

Does D-Bus count as message-oriented middleware?

Sort of. Wikipedia says that MOM allows storing, routing or transforming of messages, and asynchronicity. D-Bus implements message queueing (but not if a peer is not connected to the bus; in that case an error is returned to the sender), limited routing of messages (broadcast or unicast) and no transformation of messages. Asynchronicity is provided by the D-Bus client libraries coupled with a poll loop.

Does D-Bus count as a message queue?

Sort of. As above, D-Bus implements ordered queueing of messages in the dbus-daemon until the receiving peer reads them. It doesn’t store the queue on disk if the daemon is restarted or if the peer disconnects. The D-Bus specification defines the message ordering guarantees which D-Bus makes.

Is D-Bus like ZeroMQ?

I don’t know ZeroMQ very well, but it seems that the key difference is that D-Bus is for local IPC only, whereas ZeroMQ also targets IPC between multiple machines on a network. While it is possible to run D-Bus over TCP, this is not an officially supported configuration, and not what D-Bus is really designed for.

Philip Withnall
  • 5,293
  • 14
  • 28