如何在 Aeron Library 中创建 Multi-Destination-Cast
How to create Multi-Destination-Cast in Aeron Library
我正在尝试使用 Multi-Destination-Cast 传输,但我不知道如何配置它,
我正在尝试实施示例 URI 解释 here using the SimplePublisher.java and the SimpleSubscriber.java
我有一个发布者和两个订阅者。
在带有 SimplePublisher.java 和 SimpleSubscriber.java 的默认 aeron 参数中,我更改了:
来自SimplePublisher.java
final String channel = "aeron:udp?control=192.168.0.3:4050|control-mode=manual";
从 SimpleSubscriber.java:
我复制了 class SimpleSubcriber1.java 和 SimpleSubcriber2.java 并且更改了以下配置:
简单订阅者 1:
final String channel = "aeron:udp?endpoint=192.168.0.4:4051"
和
简单订阅者 2:
final String channel = "aeron:udp?endpoint=192.168.0.5:4052"
我为发布者和订阅者得到的错误几乎相同:
对于发布者:
Publishing to aeron:udp?control=192.168.0.3:4050|control-mode=manual on stream Id 10
io.aeron.exceptions.ChannelEndpointException: RuntimeException : Channel error: Cannot assign requested address: bind : aeron:udp?control=192.168.0.3:4050|control-mode=manual
at io.aeron.ClientConductor.onChannelEndpointError(ClientConductor.java:196)
at io.aeron.DriverEventsAdapter.onMessage(DriverEventsAdapter.java:77)
at org.agrona.concurrent.broadcast.CopyBroadcastReceiver.receive(CopyBroadcastReceiver.java:100)
at io.aeron.DriverEventsAdapter.receive(DriverEventsAdapter.java:56)
at io.aeron.ClientConductor.service(ClientConductor.java:660)
at io.aeron.ClientConductor.doWork(ClientConductor.java:151)
at org.agrona.concurrent.AgentRunner.doDutyCycle(AgentRunner.java:233)
at org.agrona.concurrent.AgentRunner.run(AgentRunner.java:159)
at java.lang.Thread.run(Thread.java:748)
Failed to connect to subscriber
并且,对于订阅者:
Subscribing to aeron:udp?endpoint=192.168.0.4:4051 on stream Id 10
io.aeron.exceptions.ChannelEndpointException: RuntimeException : Channel error: Cannot assign requested address: bind : aeron:udp?endpoint=192.168.0.4:4051
at io.aeron.ClientConductor.onChannelEndpointError(ClientConductor.java:187)
at io.aeron.DriverEventsAdapter.onMessage(DriverEventsAdapter.java:77)
at org.agrona.concurrent.broadcast.CopyBroadcastReceiver.receive(CopyBroadcastReceiver.java:100)
at io.aeron.DriverEventsAdapter.receive(DriverEventsAdapter.java:56)
at io.aeron.ClientConductor.service(ClientConductor.java:660)
at io.aeron.ClientConductor.doWork(ClientConductor.java:151)
at org.agrona.concurrent.AgentRunner.doDutyCycle(AgentRunner.java:233)
at org.agrona.concurrent.AgentRunner.run(AgentRunner.java:159)
at java.lang.Thread.run(Thread.java:748)
如果你需要,我可以给你更多的细节。
PD:我有 MediaDriver LowLatencyMediaDriver 正在运行,这不是问题所在
提前致谢
配置如下:
出版商:
aeron:udp?control=<publisher-ip>:<publisher-port>|control-mode=dynamic
订阅者:
aeron:udp?endpoint=<subscriber-ip>:<subscriber-port>|control=<publisher-ip>:<publisher-port>|control-mode=dynamic
MDC 的默认控制模式是动态的(可以省略)。每个订阅将在控制通道上注册自己,随后将在指定的端点上接收消息。
另一种方法是使用 'manual' 控制模式,其中订阅由发布者使用 addDestination
/removeDestination
手动添加。
至于您收到的错误:
Cannot assign requested address: bind : aeron:udp?endpoint=192.168.0.4:4051
at io.aeron.ClientConductor.onChannelEndpointError(ClientConductor.java:187)
您收到该消息很可能是因为该端口上已经有东西在侦听,或者该主机上不存在该接口。
我正在尝试使用 Multi-Destination-Cast 传输,但我不知道如何配置它, 我正在尝试实施示例 URI 解释 here using the SimplePublisher.java and the SimpleSubscriber.java
我有一个发布者和两个订阅者。
在带有 SimplePublisher.java 和 SimpleSubscriber.java 的默认 aeron 参数中,我更改了:
来自SimplePublisher.java
final String channel = "aeron:udp?control=192.168.0.3:4050|control-mode=manual";
从 SimpleSubscriber.java:
我复制了 class SimpleSubcriber1.java 和 SimpleSubcriber2.java 并且更改了以下配置:
简单订阅者 1:
final String channel = "aeron:udp?endpoint=192.168.0.4:4051"
和
简单订阅者 2:
final String channel = "aeron:udp?endpoint=192.168.0.5:4052"
我为发布者和订阅者得到的错误几乎相同:
对于发布者:
Publishing to aeron:udp?control=192.168.0.3:4050|control-mode=manual on stream Id 10
io.aeron.exceptions.ChannelEndpointException: RuntimeException : Channel error: Cannot assign requested address: bind : aeron:udp?control=192.168.0.3:4050|control-mode=manual
at io.aeron.ClientConductor.onChannelEndpointError(ClientConductor.java:196)
at io.aeron.DriverEventsAdapter.onMessage(DriverEventsAdapter.java:77)
at org.agrona.concurrent.broadcast.CopyBroadcastReceiver.receive(CopyBroadcastReceiver.java:100)
at io.aeron.DriverEventsAdapter.receive(DriverEventsAdapter.java:56)
at io.aeron.ClientConductor.service(ClientConductor.java:660)
at io.aeron.ClientConductor.doWork(ClientConductor.java:151)
at org.agrona.concurrent.AgentRunner.doDutyCycle(AgentRunner.java:233)
at org.agrona.concurrent.AgentRunner.run(AgentRunner.java:159)
at java.lang.Thread.run(Thread.java:748)
Failed to connect to subscriber
并且,对于订阅者:
Subscribing to aeron:udp?endpoint=192.168.0.4:4051 on stream Id 10
io.aeron.exceptions.ChannelEndpointException: RuntimeException : Channel error: Cannot assign requested address: bind : aeron:udp?endpoint=192.168.0.4:4051
at io.aeron.ClientConductor.onChannelEndpointError(ClientConductor.java:187)
at io.aeron.DriverEventsAdapter.onMessage(DriverEventsAdapter.java:77)
at org.agrona.concurrent.broadcast.CopyBroadcastReceiver.receive(CopyBroadcastReceiver.java:100)
at io.aeron.DriverEventsAdapter.receive(DriverEventsAdapter.java:56)
at io.aeron.ClientConductor.service(ClientConductor.java:660)
at io.aeron.ClientConductor.doWork(ClientConductor.java:151)
at org.agrona.concurrent.AgentRunner.doDutyCycle(AgentRunner.java:233)
at org.agrona.concurrent.AgentRunner.run(AgentRunner.java:159)
at java.lang.Thread.run(Thread.java:748)
如果你需要,我可以给你更多的细节。
PD:我有 MediaDriver LowLatencyMediaDriver 正在运行,这不是问题所在
提前致谢
配置如下:
出版商:
aeron:udp?control=<publisher-ip>:<publisher-port>|control-mode=dynamic
订阅者:
aeron:udp?endpoint=<subscriber-ip>:<subscriber-port>|control=<publisher-ip>:<publisher-port>|control-mode=dynamic
MDC 的默认控制模式是动态的(可以省略)。每个订阅将在控制通道上注册自己,随后将在指定的端点上接收消息。
另一种方法是使用 'manual' 控制模式,其中订阅由发布者使用 addDestination
/removeDestination
手动添加。
至于您收到的错误:
Cannot assign requested address: bind : aeron:udp?endpoint=192.168.0.4:4051
at io.aeron.ClientConductor.onChannelEndpointError(ClientConductor.java:187)
您收到该消息很可能是因为该端口上已经有东西在侦听,或者该主机上不存在该接口。