0

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.

mjn
  • 36,362
  • 28
  • 176
  • 378
Yury Kerbitskov
  • 643
  • 1
  • 7
  • 21
  • "Connection Closed Gracefully" is a perfectly natural message. You need to understand what it means. – Jerry Dodge Jul 01 '14 at 12:23
  • You can contact me (I am the author of the Habari Client libraries) for support. A Habari Client connection requires that OpenMQ has an active STOMP listener. You can find steps to enable STOMP in OpenMQ in the Habari documentation. – mjn Jul 01 '14 at 17:57
  • p.s. all JMS brokers use their own proprietary wire format, while STOMP, AMQP and MQTT are examples for standardized wire formats which work with many message brokers. (JMS is an API, not a protocol) – mjn Jul 01 '14 at 18:01
  • Thank you very much for helping me to understand this problem. As i understand i need to enable STOMP on Glassfish server. If so, there is a problem. I can't do it, because server belongs to the other organization. And they gave me QBrowser to test connection. QBrowser can receive messages without any problems. P.S. I decided to write receiving module on java and then use this module in delphi project. But i don't think that this is the best solution of the problem. – Yury Kerbitskov Jul 02 '14 at 05:47

1 Answers1

3

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.

mjn
  • 36,362
  • 28
  • 176
  • 378
  • I think now i'm undestanding the problem. If the STOMP protocol will be enabled can i get messages directly from delphi using some stomp client library like this for example https://code.google.com/p/delphistompclient/source/checkout ? – Yury Kerbitskov Jul 02 '14 at 06:41
  • @YuryKerbitskov OpenMQ has subtle differences in the STOMP implementation - so that open source client may or may not work. But yes, enabling STOMP on the OpenMQ side is required. Also the firewall must be open for the STOMP port (7672 by default for OpenMQ) – mjn Jul 02 '14 at 06:47
  • Thanks a lot! You have answered my question. – Yury Kerbitskov Jul 02 '14 at 06:57