Receiving OpenMQ messages in Delphi [closed]

和自甴很熟 提交于 2019-12-11 23:18:21

问题


I need to make a communication between Glassfish server and Delphi. I need to recieve messages from it. As i found Glassfish uses OpenMQ broker.

First, i found jms library for delphi. I found there just JMS interface. And found there SonicMQ JMS implemantation. But as i found, SonicMQ and OpenMQ - different brokers for JMS. Maybe i'm wrong.

Also i found Habari Client Libraries for OpenMQ, but this libraries are not free.

Maybe someone know any free solution for this problem? Or i'm mistaking and i can use SonicMQ implemantation?

I have downloaded Habari demo programms, but can't connect to glassfish server (Connection Closed Grasefully). Maybe i'm doing something wrong? I just need to get messages. I don't need to send them.

I have never worked with JMS before, that's why i have such questions.


回答1:


As you wrote in your comment, the organization which runs the GlassFish server does not allow to use the platform-independent STOMP protocol to access the server.

This means that the only way to exchange messages with the message broker is using the proprietary Java client for OpenMQ (the default JMS provider in GlassFish).

So you would need a Java / Delphi bridge which receives the messages using the Java client, and then passes them to the Delphi side. The communication with the Delphi side could be done over TCP/IP, this would allow both synchronous and asynchronous receive of messages: either using the request/response communication style ("synchronous" communication, pulling the next message is initiated by the Delphi side) or a listener thread on the Delphi side to which the messages will "asynchronously" be pushed to from the Java side.


A different path to communication could be over the C API. This would require importing the C client library in Delphi. The programmers guide to the c-api is available in the MQ document collection.



来源:https://stackoverflow.com/questions/24509805/receiving-openmq-messages-in-delphi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!