{"id":19973270,"url":"https://github.com/zeromq/filemq","last_synced_at":"2025-04-05T17:08:34.517Z","repository":{"id":4690823,"uuid":"5837714","full_name":"zeromq/filemq","owner":"zeromq","description":"FileMQ is a publish-subscribe file service based on 0MQ","archived":false,"fork":false,"pushed_at":"2024-04-05T20:13:31.000Z","size":942,"stargazers_count":276,"open_issues_count":9,"forks_count":72,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-03-29T16:08:16.923Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeromq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-09-17T07:35:21.000Z","updated_at":"2025-03-03T15:57:17.000Z","dependencies_parsed_at":"2024-12-15T06:05:28.362Z","dependency_job_id":"1c62035d-ce37-442b-bf44-72b4a132f98f","html_url":"https://github.com/zeromq/filemq","commit_stats":{"total_commits":141,"total_committers":21,"mean_commits":6.714285714285714,"dds":0.375886524822695,"last_synced_commit":"2e30cf31f4c4963dcf3a5e3b523901c8d2aaed81"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Ffilemq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Ffilemq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Ffilemq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Ffilemq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeromq","download_url":"https://codeload.github.com/zeromq/filemq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369952,"owners_count":20927928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T03:10:50.324Z","updated_at":"2025-04-05T17:08:34.491Z","avatar_url":"https://github.com/zeromq.png","language":"Java","funding_links":[],"categories":["进程间通信"],"sub_categories":["Spring Cloud框架"],"readme":"# FileMQ implementation in C\n\n## Why FileMQ?\n\n\"Request-reply is just a vulgar subclass of publish-subscribe\" -- me, in \"Software Architecture over 0MQ\".\n\nIt's the API my 5-year old son can use. It runs on every machine there is. It carries binary objects of any size and format. It plugs into almost every application in existence. Yes, it's your file system.\n\nSo this is FileMQ. It's a \"chunked, flow-controlled, restartable, cancellable, async, multicast file transfer ØMQ protocol\", server and client. The protocol spec is at http://rfc.zeromq.org/spec:19. It's a rough cut, good enough to prove or disprove the concept.\n\nWhat problems does FileMQ solve? Well, two main things. First, it creates a stupidly simple pub-sub messaging system that literally anyone, and any application can use. You know the 0MQ pub-sub model, where a publisher distributes files to a set of subscribers. The radio broadcast model, where you join at any time, get stuff, then leave when you're bored. That's FileMQ. Second, it wraps this up in a proper server and client that runs in the background. You may get something similar to the DropBox experience but there is no attempt, yet, at full synchronization, and certainly not in both directions.\n\n## How to build and use\n\nThis code needs the freshest possible libsodium, libzmq, and CZMQ. To build:\n\n    git clone git://github.com/jedisct1/libsodium.git\n    cd libsodium\n    ./autogen.sh\n    ./configure \u0026\u0026 make check\n    sudo make install\n    sudo ldconfig\n    cd ..\n\n    git clone git://github.com/zeromq/libzmq.git\n    cd libzmq\n    ./autogen.sh\n    ./configure \u0026\u0026 make check\n    sudo make install\n    sudo ldconfig\n    cd ..\n\n    git clone git://github.com/zeromq/czmq.git\n    cd czmq\n    ./autogen.sh\n    ./configure \u0026\u0026 make check\n    sudo make install\n    sudo ldconfig\n    cd ..\n\n    git clone git://github.com/hintjens/filemq.git\n    cd filemq\n    ./autogen.sh\n    ./configure \u0026\u0026 make check\n    sudo make install\n    sudo ldconfig\n    cd ..\n\nContribution process:\n\n    http://rfc.zeromq.org/spec:22\n\n## Internals\n\nI originally designed FileMQ as a training tool for Chapter 6 of the 0MQ Guide (soon in dead tree format from O'Reilly!) and sort of a reusable stack for your own experiments in protocol development. Many concepts in FileMQ are borrowed from other protocols, such as the original AMQP (which, you may not know, had a file transfer class before that was taken out to a dark alley and beaten to death by two red-hatted goons from a firm who shall remain nameless). Of course AMQP borrowed much from other protocols, like its SASL authentication dialog, which came from BEEP, and which I happily used in FILEMQ as well.\n\nSASL is the simple authentication and security layer, and a neat way to make secure protocols over 0MQ. It works for the specific case where peer A talks to peer B over a bidirectional connection. That is any classic client-server model, which is what FILEMQ (the protocol, in upper case), gives us.\n\nIncidentally, it's client-to-server, not peer-to-peer. Fully-symmetric protocols are nasty. Far easier to define client and server as \"roles\" and allow any node to be either, or both. Which is what the filemq main application is.\n\nIf you look at that program (src/filemq.c) you'll see it creates a server object, a client object, runs them until someone interrupts the process, and then quits. Nice and simple.\n\nThe whole thing is written in C, but using my special sauce of class-orientation and generic containers that makes it almost as nice as Python to write, and to read. I'm sure Erlang still outclasses this, but for sheer coverage, it's hard to beat perfect C.\n\nSo there's a client class, and a server class, and then a bunch of utility classes, some of which are more or less reusable for other applications. There's a neat configuration file parser and the SASL class (which is still empty but will hopefully grow). The directory and file management classes may be a little specific to FileMQ's use case.\n\nThe real magic sauce in FileMQ is in the model directory, which you can safely ignore until you feel confident enough to go take a look. As a first start, check out the zeromq/zproto project, and fmq_msg.xml. You will need to grab gsl from https://github.com/zeromq/gsl if you want to generate the code. Check the generate script to see how we run gsl.\n\nSo that's code generation. You can, if you absolutely hate the gsl tool (and people do), you can get the same results with 10x more work using XSTL. There are other ways; in some languages you can parse the XML at runtime. That is, BTW, a rather stupid idea since it means anyone running the code needs the protocol spec at hand.\n\nNow, take a look at fmq_client.xml and fmq_server.xml, and their matching compilers in client_c.gsl and server_c.gsl. These churn out quite ordinary multi-threaded clients and servers for any given state machine. It should take you a week or so to understand what the heck is actually going on. I'm not going to explain too much, it'll spoil the fun.\n\nLet me know how you get on. I'll expand this README as you ask questions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeromq%2Ffilemq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeromq%2Ffilemq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeromq%2Ffilemq/lists"}