Receiving OpenMQ messages in Delphi

I need to make communication between Glassfish server and Delphi. I need to get messages from him. As I noticed Glassfish uses the OpenMQ broker.

I first found a jms library for delphi. I only found the JMS interface there. And found a SonicMQ JMS implementation there. But as I found SonicMQ and OpenMQ are different brokers for JMS. Maybe I'm wrong.

Also I found Habari Client Libraries for OpenMQ, but these libraries are not free.

Perhaps anyone knows of any free solution to this problem? Or am I wrong and can I use SonicMQ?

I downloaded the Habari demos but cannot connect to the Glassfish server (Connection Closed Grasefully). Maybe I am doing something wrong? I just need to receive messages. I don't need to send them.

I've never worked with JMS before, so I have questions like this.

0


source to share


1 answer


As you wrote in your comment, the organization that runs the GlassFish server does not allow the platform independent STOMP protocol to be used to access the server.

This means that the only way to communicate with the message broker is to use the native Java client for OpenMQ (the default JMS provider in GlassFish).

Thus, you need a Java / Delphi bridge that receives messages using a Java client and then passes them to the Delphi side. Communication with the Delphi side can be done over TCP / IP, which will allow synchronous and asynchronous reception of messages: either use a request / response communication style ("synchronous" communication by pulling the next message from the Delphi side) or a listener thread on the Delphi side, to which messages will be "asynchronously" sent from the Java side.




Another way to communicate can be with the C API. This will require importing the C client library into Delphi. A Programmer's Guide for c-api is available in the MQ docs collection .

+3


source







All Articles