英文:
AMQP 1.0 library for Java with full peer-to-peer (brokerless) support?
问题
关于上面的问题:是否有一个支持完全支持点对点(点对点,无需经纪人)功能的AMQP 1.0的Java库?
我缺失的部分是用于打开本地端口以直接接收消息而无需通过代理的功能。
到目前为止,我已经使用了SwiftMQ AMQP 1.0客户端库,它可以很好地通过代理发送和接收(在这里使用了RabbitMQ服务器,没有任何缺陷),也可以直接发送到另一个端点。
另一端点是使用C#编写的,使用了AMQPNetLite库。我发现AMQPNetLite库通过ContainerHost
类提供了上述功能(详见此处)。
我最好的猜测是QPID Proton-J在某种程度上支持我正在寻找的功能,但文档和示例很少。QPID Proton库的Python变体在此示例中也显示了Container
类。然而,无论是Container
类还是类似的内容都没有包含在QPID Proton-J(Java)库中。
是的,我也看到了这个问题,这让我对我正在寻找的内容是否存在产生了疑虑...
任何帮助都将不胜感激。
英文:
Regarding the question above: Is there a Java library for AMQP 1.0 which fully supports peer-to-peer (point-to-point, brokerless) functionality?
The part that I am missing is the functionality for opening a local port for messages incoming directly without going through a broker.
So far I have used the SwiftMQ AMQP 1.0 Client library which is fine for sending and receiving through a broker (used RabbitMQ server here without any flaws) and also for sending directly to another endpoint.
The other endpoint is written in C#, using the AMQPNetLite library. I found out that the AMQPNetLite lib provided the mentioned functionality through the ContainerHost
class (see also here).
My best guess is that the QPID Proton-J somehow supports what I am looking for, but documentation and examples are rare. The Python variant of the QPID Proton library also shows the Container
class in this example. However, neither the Container
class nor something that seems similar is not contained in the QPID Proton-J (Java) lib.
Yes, I also saw this question, which makes me doubt that what I search for exists at all...
Any help would be greatly appreciated.
答案1
得分: 0
目前我所知并没有维护良好的Java点对点(peer-to-peer)实现。proton-j 项目具有一个相当古老的实验性 API,名为 "reactor",可以执行这样的操作,但并未得到维护,可能存在相当多的错误。vertx-proton 项目提供了一个相对简单的基于服务器的实现,可能适用于您的情况,但我不清楚它目前是否得到了积极的维护,因此您需要尝试并查看其表现如何。
您也可以自行编写代码,尽管 AMQP 协议具有许多复杂性,因此您需要权衡点对点通信与嵌入式代理(broker)或简单消息路由器之类的功能的重要性。这里有一些基本的 AMQP 服务器代码,可以作为基于 proton-j 的机制编写的起点。
英文:
There aren't any actively maintained Java peer-to-peer capable implementations that I'm aware of. The proton-j project has a rather old experimental API called reactor that can do that but is not maintained and likely has a fair amount of bugs. The vertx-proton project has a relatively naive server based implementation that might work for you but I don't know how actively maintained it is so you'd have to try it out and see how it goes.
You could write your own although the AMQP protocol has many complexities so you need to weigh how important peer-to-peer is vs something like an embedded broker or simple message router. There is some basic AMQP server code here that be a start on writing your own proton-j based mechanism.
答案2
得分: 0
不要轻易修改 AMQP 1.0 协议。它实在太复杂了。SwiftMQ AMQP 1.0 客户端能够无缺地运行,因为每个人都在用它来测试他们的实现。
一个嵌入式代理,你在 intravm 中启动它,这就是你所需要的。你使用哪一个无所谓,但我猜应该选择 Java。所以可以选择 Artemis 或者甚至是 SwiftMQ CE,它们同样是开源的。
然后将你的客户端连接到本地的嵌入式代理,并配置它来打开 AMQP 端口。
英文:
Don’t mess with the AMQP 1.0 protocol. It‘s just too complicated. The SwiftMQ AMQP 1.0 Client works flawlessly because everybody used it for testing their implementation.
An embedded broker that you launch intravm is what you need. Which one you use doesn’t matter but it should be Java I guess. So go for Artemis or even SwiftMQ CE which is open source as well.
Then connect your client to the local embedded broker and configure it to open the AMQP port.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论