{"forkee":{"id":125817846,"name":"alibaba-mom","full_name":"hwlsniper/alibaba-mom","owner":{"login":"hwlsniper","id":16130690,"avatar_url":"https://avatars1.githubusercontent.com/u/16130690?v=4","gravatar_id":"","url":"https://api.github.com/users/hwlsniper","html_url":"https://github.com/hwlsniper","followers_url":"https://api.github.com/users/hwlsniper/followers","following_url":"https://api.github.com/users/hwlsniper/following{/other_user}","gists_url":"https://api.github.com/users/hwlsniper/gists{/gist_id}","starred_url":"https://api.github.com/users/hwlsniper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hwlsniper/subscriptions","organizations_url":"https://api.github.com/users/hwlsniper/orgs","repos_url":"https://api.github.com/users/hwlsniper/repos","events_url":"https://api.github.com/users/hwlsniper/events{/privacy}","received_events_url":"https://api.github.com/users/hwlsniper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hwlsniper/alibaba-mom","description":"2015 ali中间件比赛项目，1. 通信模块： 涉及到了消息架构设计，每一个主题分配1-2个队列，这个是可以横向增加，考虑到了一个主题有多个消费者订阅，而且还有过滤条件，为了负载均衡，对应的队列投递消息是根据随机数对队列数取膜完成的。以上是内存队列。 2. 持久化系统：因为考虑到机器坏掉，broker不可用等等原因导致的消息丢失，就需要每次收到的消息必须及时落盘，这个就是比赛优化的重中之重。为此设计了一个小型的文件系统，借鉴阿里的rocketmq. 用一个大的日志文件，一般1G大小每个，和内存队列的结构映射到实体队列。整个日志文件是顺序文件，每条消息固定大小，里面有对应的队列号，消息号，还有长度等等。这个方便恢复消息到实体队列用的。 同步刷盘，异步刷盘，持久化必须可靠，所以一般是同步刷盘到日志文件，日志文件定时异步刷盘到实体队列，实体队列里面是索引，消息的本体在日志文件里面。为了加快大面积的写入速度，用了内存映射：内存映射文件首先将外存上的文件映射到内存中的一块连续区域，被当成一个字节数组进行处理，读写操作直接对内存进行操作，而后再将内存区域重新映射到外存文件，这就节省了中间频繁的对外存进行读写的时间，大大降低了读写时间","fork":true,"url":"https://api.github.com/repos/hwlsniper/alibaba-mom","forks_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/forks","keys_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/teams","hooks_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/hooks","issue_events_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/issues/events{/number}","events_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/events","assignees_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/assignees{/user}","branches_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/branches{/branch}","tags_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/tags","blobs_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/git/refs{/sha}","trees_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/statuses/{sha}","languages_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/languages","stargazers_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/stargazers","contributors_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/contributors","subscribers_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/subscribers","subscription_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/subscription","commits_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/commits{/sha}","git_commits_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/git/commits{/sha}","comments_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/comments{/number}","issue_comment_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/issues/comments{/number}","contents_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/contents/{+path}","compare_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/merges","archive_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/downloads","issues_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/issues{/number}","pulls_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/pulls{/number}","milestones_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/milestones{/number}","notifications_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/labels{/name}","releases_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/releases{/id}","deployments_url":"https://api.github.com/repos/hwlsniper/alibaba-mom/deployments","created_at":"2018-03-19T07:26:12Z","updated_at":"2018-03-19T07:26:13Z","pushed_at":"2016-04-23T07:11:49Z","git_url":"git://github.com/hwlsniper/alibaba-mom.git","ssh_url":"git@github.com:hwlsniper/alibaba-mom.git","clone_url":"https://github.com/hwlsniper/alibaba-mom.git","svn_url":"https://github.com/hwlsniper/alibaba-mom","homepage":null,"size":8465,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","public":true}}
{"actor":{"display_login":"hwlsniper"}}