# aeron-go/archive
Implementation of [Aeron Archive](https://github.com/real-logic/Aeron/tree/master/aeron-archive) client in Go.
The [Aeron Archive
protocol](http://github.com/real-logic/aeron/blob/master/aeron-archive/src/main/resources/archive/aeron-archive-codecs.xml)
is specified in xml using the [Simple Binary Encoding (SBE)](https://github.com/real-logic/simple-binary-encoding)
## Current State
The implementation is an alpha release. The API is not yet considered 100% stable.
# Design
## Guidelines
The structure of the archive client library is heavily based on the
Java archive library. It's hoped this will aid comprehension, bug fixing,
feature additions etc.
Many design choices are also based upon the golang client library as
the archive library is a layering on top of that.
Finally golang idioms are used where reasonable.
The archive library does not lock and concurrent calls to archive
library calls that invoke the aeron-archive protocol calls should be
externally locked to ensure only one concuurrent access.
### Naming and other choices
Function names used in archive.go which contains the main API are
based on the Java names so that developers can more easily switch
between langugages and so that any API documentation is more useful
across implementations. Some differences exist due to capitalization
requirements, lack of polymorphism, etc.
Function names used in encoders.go and proxy.go are based on the
protocol specification. Where the protocol specifies a type that cab
ne naturally repreented in golang, the golang type is used used where
possible until encoding. Examples include the use of `bool` rather than
`BooleanType` and `string` over `[]uint8`
## Structure
The archive protocol is largely an RPC mechanism built on top of
Aeron. Each Archive instance has it's own aeron instance running a
[proxy](proxy.go) (publication/request) and [control](control.go) (subscription/response)
pair. This mirrors the Java implementation. The proxy invokes the
encoders to marshal packets using SBE.
Additionally there are some asynchronous events that can arrive on a
[recordingevents](recordingevents.go) subscription. These
are not enabled by default to avoid using resources when not required.
## Synchronous unlocked API optionally using polling
The implementation provides a synchronous API as the underlying
mechanism is largely an RPC mechanism and archive operations are not
considered high frequency.
Associated with this, the library does not lock and assumes management
of reentrancy is handled by the caller.
If needed it is simple in golang to wrap a synchronous API with a
channel (see for example aeron.AddSubscription(). If overlapping
asynchronous calls are needed then this is where you can add locking.
Some asynchronous events do exist (e.g, recording events) and to be
delivered a polling mechanism is provided. Again this can be easily
wrapped in a goroutine if it's desired but ensure there are no other
operations in progress when polling.
## Examples
Examples are provided for a [basic_recording_publisher](examples/basic_recording_publisher/basic_recording_publisher.go) and [basic_replayed_subscriber](examples/basic_replayed_subscriber/basic_replayed_subscriber.go) that interoperate with the Java examples
# Backlog
## Working Set
* [S] [Bug] RecordingSignalEvents currently throw off the count of
fragments/records we want. Need a mechanism to adjust for them.
* [L] Expand testing
* [M] So many tests to write
* [?] archive-media-driver mocking/execution
* test cleanup in the media driver can be problematic
* [S} The archive state is largely unused.
* IsOpen()?
* 10 FIXMEs
* [?] Implement AuthConnect, Challenge/Response
* [?] Add remaining archive protocol packets to proxy, control, archive API, and tests.
## Recently Done
* Logging at level normal should be mostly quiet if nothing goes wrong
* Improve the Error handling / Error listeners (mostly)a
* Ephemeral port usage is dependent upon accessing the counters which is out of scope here and doesn't buy much
* Error listener
* Logging tidying
* Removed the archive context, it was offering little value. Instead,
the proxy, control, and recrodingevents all have a reference
* Made tests a little reliable but cleanup is still a problem
# Bigger picture issues
* Decided not to do locking in sync api, could subsequently add locks, or just async with locks if desired.
It may be that the marshaller should be parameterized for this.
* Java and C++ poll the counters to determine when a recording has actually started but the counters are not
availabe in go. As a result we use delays and hope which isn't ideal.
* OnAvailableCounter noise
* Within aeron-go there are cases of Log.Fatalf(), see for example trying to add a publication on a "bogus" channel.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
aeron-go在Go中实现Aeron消息传递客户端。 可以在此处找到Aeron的体系结构,设计和协议。在此处可以找到用法示例订户。 示例出版物可在此处找到。 aeron-go在Go中实现Aeron消息传递客户端。 可以在此处找到Aeron的体系结构,设计和协议,在此处可以找到用法示例订户。 示例出版物可在此处找到。 通用实例化带有上下文的Aeron:ctx:= aeron.NewContext()。MediaDriverTimeout(time.Second * 10)a:= aeron.Connect(ctx)订阅者创建订阅:subscription:=
资源推荐
资源详情
资源评论
收起资源包目录
高效可靠的UDP单播,UDP组播和IPC消息传输-Go端口-Golang开发 (137个子文件)
.gitignore 489B
.gitignore 25B
.gitignore 25B
archive.go 44KB
encoders.go 28KB
RecordingDescriptor.go 23KB
clientconductor.go 21KB
control.go 19KB
proxy.go 17KB
ReplicateRequest2.go 17KB
TaggedReplicateRequest.go 14KB
BoundedReplayRequest.go 12KB
ListRecordingSubscriptionsRequest.go 11KB
ReplicateRequest.go 11KB
ReplayRequest.go 10KB
FindLastMatchingRecordingRequest.go 10KB
archive_test.go 10KB
ExtendRecordingRequest2.go 10KB
ListRecordingsForUriRequest.go 10KB
flyweights.go 10KB
RecordingSignalEvent.go 9KB
ExtendRecordingRequest.go 9KB
RecordingStarted.go 9KB
RecordingSubscriptionDescriptor.go 9KB
ControlResponse.go 9KB
appender.go 9KB
StartRecordingRequest2.go 9KB
buffer.go 8KB
publication.go 8KB
AuthConnectRequest.go 8KB
systest.go 8KB
CatalogHeader.go 8KB
descriptor.go 8KB
StartRecordingRequest.go 8KB
SbeMarshalling.go 7KB
MigrateSegmentsRequest.go 7KB
listeneradapter.go 7KB
DetachSegmentsRequest.go 7KB
ListRecordingsRequest.go 7KB
PurgeSegmentsRequest.go 7KB
TruncateRecordingRequest.go 7KB
StopRecordingRequest.go 7KB
ConnectRequest.go 7KB
Challenge.go 6KB
publication_test.go 6KB
RecordingDescriptorHeader.go 6KB
aeron.go 6KB
StopRecordingSubscriptionRequest.go 6KB
StopRecordingByIdentityRequest.go 6KB
proxy.go 6KB
DeleteDetachedSegmentsRequest.go 6KB
RecordingPositionRequest.go 6KB
StopReplicationRequest.go 6KB
PurgeRecordingRequest.go 6KB
AttachSegmentsRequest.go 6KB
StopAllReplaysRequest.go 6KB
ListRecordingRequest.go 6KB
StartPositionRequest.go 6KB
StopReplayRequest.go 6KB
StopPositionRequest.go 6KB
ChallengeResponse.go 6KB
counters.go 5KB
RecordingStopped.go 5KB
RecordingProgress.go 5KB
manytoone.go 5KB
image.go 5KB
subscription.go 5KB
ping.go 5KB
MessageHeader.go 5KB
fields.go 4KB
logbuffers.go 4KB
KeepAliveRequest.go 4KB
context.go 4KB
recordingevents.go 4KB
basic_replayed_subscriber.go 4KB
logbuffers_test.go 4KB
memmap.go 4KB
channeluri.go 4KB
receiver.go 4KB
pong.go 3KB
basic_recording_publisher.go 3KB
bits.go 3KB
backoffidlestrategy.go 3KB
buffer_test.go 3KB
RecordingSignal.go 3KB
flyweights.go 3KB
FrameDescriptor.go 3KB
fragmentassembler.go 3KB
claim.go 3KB
CloseSessionRequest.go 3KB
options.go 3KB
channeluri_test.go 3KB
header.go 3KB
ControlResponseCode.go 2KB
VarAsciiEncoding.go 2KB
VarDataEncoding.go 2KB
basic_publisher_claim.go 2KB
basic_publisher.go 2KB
basic_subscriber.go 2KB
reader.go 2KB
共 137 条
- 1
- 2
资源评论
普通网友
- 粉丝: 31
- 资源: 4570
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Rainbow 8.1.0.SPC3 迁移工具操作指南
- 水泵反渗透和一拖3恒压供水 1.西门子SMART和海为云触摸屏做的反渗透和恒压供水电气控制系统, 程序注释完善,在山东某养鸡场运行正常 2,有正常制水模式,反洗模式,原水恒压供水和供水恒压供水(1托
- Python 与 MySQL 基础:开发数据管理应用的必备技能 - pdf
- PLC工业超滤净水控制系统(牧场用的比较多) 1.西门子SMART和海为云触摸屏做的超滤控制系统 或者是昆仑同泰触摸屏加远程模块,可以手机远程监控,修改监控程序; 2,包括单套和双套系统(可以清洗超滤
- 癌症数据,癌症患者数据集,涵盖:人口统计学细节、生活方式因素、癌症诊断信息、治疗详情以及结果等
- 全套恒压供水一拖三程序图纸(看描述)恒压供水一拖三图纸程序 1.采用西门子SMART SR20 CPU 加AE04模块; 2.触摸屏采用昆仑通态;同时通讯PLC和变频器; 3.PLC模拟量检测压
- python使用mysql基础教程
- python使用mysql基础教程
- Python 与 MySQL 基础:数据交互与数据库操作-pdf
- python使用mysql基础教程
- 永磁同步电机的谐波注入补偿simulink模型仿真 5次7次电流谐波抑制;
- python使用mysql基础教程
- python使用mysql基础教程
- python使用mysql基础教程
- 西门子1200-1500博途追款锁机软件程序例程,经典程序编程及到期催款锁机,采用SCL语言编程子程序,内含物料运输顺序控制,运料车自动装卸料控制,展厅人数控制,风机运行监控,卫生间定时冲水,冒泡排序
- python使用mysql基础教程
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功