148 points · by mhausenblas · 9y ago · 30 comments
Id like to see a more 'low tech' version, or in the very least, a plan to transition from a 'heavy' reference implementation to a 'lighter' one once one became available since having a concise reference implementation makes porting and compatibility significantly easier.
> To try it out yourself, you first need a to install a DC/OS cluster and then Apache Kafka...
When I see that, I know the cost of satisfying my curiosity is going to be a lot higher than I'm willing to pay right now.
I'm all open for GitHub issues that capture this request and/or PR ;)
$ mkdnpipe /tmp/a.fifo 192.168.1.10:123
With the target host running a dnpipe daemon.
socat PIPE:myfifo TCP-LISTEN:7766
socat PIPE:myfifo2 TCP:192.0.2.1:7766UNIX pipes are stream interfaces, whereas this looks to be message based - that's a fundamental difference.
Named pipes are uniquely identified in a well-defined local namespace, i.e the filesystem, whereas this seems to be an abstraction on top of Kafka with service discovery TBD.
This confused me while reading up on the project.
SOCK_DGRAM at least appears to be widely supported (FreeBSD & Illumos & OpenBSD). SOCK_SEQPACKET is at least supported by OpenBSD (I'm going by what's in various docs/man pages).
(I don't know much about Unix streams, so correct me if I'm wrong.)
"A message queue works kind of like a FIFO but supports some additional functionality."
The interface specification has problems. "A pull does not remove a message from a dnpipes, it merely delivers its content to the consumer." So if the same consumer pulls the same dnpipe again, does it get the same message? Do messages ever get removed from dnpipes without a reset? Unclear.
Does pull block, support async completions, or just return an error when no data is available?
Reset, rather than sending an EOF which passes through the queue, implies that shutdown is either drastic or requires external coordination to empty the queue and stop the sending end before the reset.
No. Each message is delivered at most once. But good point, need to make that clearer!
> Do messages ever get removed from dnpipes without a reset.
No. Again, something I need to clarify as it seems.
> Does pull block, support async completions, or just return an error when no data is available?
It blocks.
> Reset, rather than sending an EOF which passes through the queue, implies that shutdown is either drastic or requires external coordination to empty the queue and stop the sending end before the reset.
I don't follow. Reset empties the underlying queue.
In general, since the consumers start to consume not from the beginning of time (as in Kafka's `--from-beginning`) but wherever they happen to be (that is, in Kafka terminology from `latest` index) this shouldn't be a problem.
I tried to model as close as possible and as it makes sense after the semantics of (local) named pipes. I might have fudged up here but I'm not 100% clear on where :)
You could make actual named pipes and connect them to the "dnpipes" tool, I guess...
Joking aside: since I've used Kafka for the reference implementation it naturally looks very similar, yes but it's really about the semantics. For example, does your 'normal' Kafka consumer start from the beginning or use latest index, etc.