在Delphi中接收OpenMQ消息 [英] Receiving OpenMQ messages in Delphi

查看:133
本文介绍了在Delphi中接收OpenMQ消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Glassfish服务器和Delphi之间进行沟通。我需要从中收到消息。正如我发现Glassfish使用OpenMQ经纪人。

首先,我找到了delphi的jms库。我发现那里只有JMS接口。并发现了SonicMQ JMS的实现。但是,正如我发现的,SonicMQ和OpenMQ-- JMS的不同代理商。也许我错了。



另外我还发现了Habari Client Library for OpenMQ,但这个库不是免费的。

可能有人知道任何东西免费解决这个问题?或者我错了,我可以使用SonicMQ实现?



我已经下载了Habari演示程序,但无法连接到glassfish服务器(连接已关闭)。也许我做错了什么?我只需要得到消息。我不需要发送它们。



我之前从未使用JMS,这就是为什么我有这样的问题。


$ b

这意味着与消息代理交换消息的唯一方式是使用专有的Java客户端用于OpenMQ(GlassFish中的默认JMS提供程序)。



所以你需要一个Java / Delphi桥接器,它使用Java客户端接收消息,然后将它们传递给Delphi端。与Delphi端的通信可以通过TCP / IP完成,这将允许同步和异步接收消息:或者使用请求/响应通信风格(同步通信,拉动下一个消息由Delphi端启动)或者Delphi端的一个监听器线程,这些消息将被异步地从Java端推送到该端。






通信的另一种途径可能是C API。这需要在Delphi中导入C客户端库。程序员指南中的c-api位于 MQ文档集合中


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.

解决方案

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.

这篇关于在Delphi中接收OpenMQ消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆