Search code examples
dbus

What happens to the undelivered dbus messages?


What happens to the DBus messages after the timeout is reached or when the reciever is unavailable? Is there any cleaning mechanism that deletes such messages? Can we try to access those undelivered messages by any chance?

I saw that my receiver dies and is back after sometime. I want to try and access the undelivered message. Would that be possible?


Solution

  • There is no way to retrieve undelivered messages (see: https://stackoverflow.com/a/76127223/624483)

    If the receiving application does not exist for some reason, the implementation that you are using should report back an error of some kind, probably org.freedesktop.DBus.Error.ServiceUnknown. Some implementations will throw an exception, while the default C implementation does not(as C does not have exceptions).