zeromq / jeromq

Pure Java ZeroMQ
Mozilla Public License 2.0
2.34k stars 484 forks source link

[Question] Message Persistence #965

Closed pandaapo closed 7 months ago

pandaapo commented 7 months ago

Does JeroMQ support message persistence? If so, are there any relevant documentation or examples for me to learn about?

Thanks!

fbacchella commented 7 months ago

Did you read https://zguide.zeromq.org ?

pandaapo commented 7 months ago

I was hoping for a more definitive and accurate answer than what I understood. However, thank you for your reply.

We don’t attempt to cover the following:

  • ...

  • The handling of persistent messages or transactions in any way. We assume the existence of a network of unreliable (and probably untrusted) servers or Binary Star pairs.

Here’s the Titanic implementation. This server handles the three services using three threads, as proposed. It does full persistence to disk using the most brutal approach possible: one file per message.

These are two descriptions related to persistence on the website https://zguide.zeromq.org/. It feels a bit contradictory, so I'm not sure.

fbacchella commented 7 months ago

That’s an accurate and definitive answer, even if you don’t like it.

pandaapo commented 7 months ago

We don’t attempt to cover the following:

  • ...

  • The handling of persistent messages or transactions in any way. We assume the existence of a network of unreliable (and probably untrusted) servers or Binary Star pairs.

Here’s the Titanic implementation. This server handles the three services using three threads, as proposed. It does full persistence to disk using the most brutal approach possible: one file per message.

Therefore, the conclusion drawn from the two contradictory statements on the official website is that 0MQ does not support message persistence by itself, but supports developers to implement it themselves if needed. Is that correct?

fbacchella commented 7 months ago

Yes. That’s the spirit of ZMQ.

trevorbernard commented 7 months ago

jeromq's job is to send opaque bytes across some interface. It doesn't much care how you serialize or deserialize the bytes. It provides certain guarantees like: atomicity when sending or receiving multipart messages. You can achieve different workflows by applying patterns described in the zguide as @fbacchella mentioned.