I'm trying to open, get, put, close WebSphere MQ queuе through JMS API.
I want to connect to the queue manager, open a specific queue, put in her message, get the message and then close and disconnect. Earlier I connected to the MQ through MQ API.
With the help of colleagues from this forum, I was able to write a program with the help of which I got the opportunity to put messages in the queue and pick them up. This program is very cumbersome. I made it in the OpenEdge 10.1B, using installed the WebSphere MQ client 7.5 and downloaded the manual "MQSeries Application Programming Interface". It was a test and this solution is not used in our product.
Now I'm using version 11.6.3. Having learned that since version 11.5.1 I can interact with WebSphere MQ without using the SonicMQ (I do not have licenses for this product), I became interested and decided to figure it out.
My task of interacting with WebSphere MQ queues is complicated by the fact that I have to access the queue from the server (not from the client, as in the program I wrote earlier). For these purposes, I plan to use purchased and installed on the database server PAS for OE. In any case, this is how I call the web services: the program on the client calls the application server on which the service call programs run.
So, I started to study the documentation "Messaging and ESB". I made the necessary changes in jmsProvider.properties and AdminServerPlugins.properties in In the %DLC%\properties path:
pluginclasspath=C:\Program Files\Progress\OpenEdge_11_6/sonic/MQ8.5/lib/sonic_Client.jar,C:\Program Files\Progress\OpenEdge_11_6/sonic/MQ8.5/lib/mgmt_client.jar,C:\Program Files\Progress\OpenEdge_11_6/java/progress.jar,C:\PROGRA~1\IBM\WEBSPH~1\java\lib\com.ibm.mqjms.jar
classpath=C:\Program Files\Progress\OpenEdge_11_6/sonic/MQ8.5/lib/sonic_Client.jar,C:\Program Files\Progress\OpenEdge_11_6/java/progress.jar,C:\PROGRA~1\IBM\WEBSPH~1\java\lib\com.ibm.mqjms.jar
After that, I began to doubt: there is a WebSphere client on my workstation. But our users work with software using the Client Networking, hosted on a network resource. Probably I should install the WebSphere client on the network? After all, I must somehow run the SonicMQ adapter? On the server in Progress OpenEdge Management I chose the SonicMQ Adapter Resource. But nothing can be created here. Here I am stuck. Do I need to configure something on the server or just make changes to the properties files? Maybe I missed something (did not install it) during the installation of OpenEdge RDBMS?
Can anyone help me? Thanks.
I plan to work with the MQ through the PAS server.
I wrote a test program that calls the PAS and runs a program on it that writes to the queue and reads from the queue. When I try to write a message to the queue, my program does not respond and in the log I see the following:
[17/03/24@11:32:56.959+0300] P-003524 T-C-0001 2 UB Basic The client requested ASK version= 1.0 capabilities= denyClientASK,allowServerASK. (13769)
[17/03/24@11:32:56.959+0300] P-003524 T-C-0001 2 UB Basic The negotiated ASK version= 1.0 capabilities= denyServerASK,denyClientASK. ASK protocol is disabled for this connection. (15256)
[17/03/24@11:32:56.983+0300] P-003524 T-C-0001 2 UB Basic Client disconnected : 172.25.197.193. (8534)
I found SonicMQ1 in OEM. I looked up an article in the knowledge base. And in one of them it is said that this is not a error.
I correctly assume that the port selected on the snapshot is the port that I should use in the program. And do I need to change the "AppServer KeepAlive" property?
Hi, Srinivas! Thank you so much!
Ok. To make sure that the programs for working with the MQ work correctly, I created a program on the server (this is the database server, the PAS is running here, here SonicMQ1 is launched) and launched it.
/* *************************** Main Block *************************** */
DEFINE VARIABLE QueueManager AS CHAR NO-UNDO.
DEFINE VARIABLE QueueName AS CHAR NO-UNDO.
DEFINE VARIABLE CMessage AS CHAR NO-UNDO.
ASSIGN QueueManager = "UNIQM"
QueueName = "TEST.Q"
CMessage = "Hello from DepoNet!!!".
DEFINE VARIABLE ptpsession AS HANDLE.
DEFINE VARIABLE messageH AS HANDLE.
DEFINE VARIABLE lDebug AS LOGICAL.
/* Creates a session object. */
RUN jms/jmssession.p PERSISTENT SET ptpsession ("-H localhost -S 3620 -AppService AD.sonicMQ1").
/* Set user credentials. */
RUN setBrokerURL IN ptpsession (INPUT QueueManager).
/* Connect to the broker. */
RUN beginSession IN ptpsession.
/* Create a text message */
RUN createTextMessage IN ptpsession (OUTPUT messageH).
RUN setText IN messageH (CMessage).
/* Publish the message on the "REQUEST" topic */
RUN sendToQueue IN ptpsession (QueueName, messageH, ?, ?, ?).
RUN deleteMessage IN messageH.
RUN deleteSession IN ptpsession.
MESSAGE "SENT!" VIEW-AS ALERT-BOX.
I get the following:
You need to provide "-DirectConnect" parameter in the RUN method as shown below:
RUN jms/jmssession.p PERSISTENT SET ptpsession ("-H localhost -S 3620 -AppService AD.sonicMQ1 -DirectConnect").
Otherwise, it tries to connect to the NameServer using the port provided using "-S" parameter
Thanks, Srinivas. Connection error is gone. Now an error occurs while executing "RUN beginSession IN ptpsession.". Error text: Error connect to the JMS AppServer service.
I'm trying to find a solution in Google.
Perhaps in [PluginPolicy.Progress.SonicMQ] I must specify the path to WebSphereMQ to lib64 if the interaction with the MQ occurs on the server?
At the moment this section contains the following paths:
If sonicMQ1 started properly then we can find sonicMQ1 service name when we query the nameserver from proenv as shown below.
proenv>nsman -i NS1 -q
This will show whether sonicMQ1 is registered with nameserver or not.
Also, we can find sonicMQ1 port number by executing the following command from proenv section.
proenv>adaptman -i sonicMQ1 -q
We can see the value of "Broker Port" in the result.
If sonicMQ1 is not started then check the sonicMQ1 log files or share the files with us.
Could you please share the following files.
6) Procedures that you are using to send messages to the queue.
Hi, Anand! Of Course! I found a topic where you explain how to set server logging level to 5. I did the same. I started SonicMQ adapter, executed the procedure to connect WebSphereMQ (I do this on the server to exclude the the PAS level). And I see in server log that " A public jmsfromABL.AdminObjectFinder class was not found."
I do not understand what I did wrong?
In my opinion, I understood the problem. In AdminObjectFinder.java i wrote:
Disk J is the disk on my workstation (a shared folder on the disk D of server).
If the script is running on a server, I should write:
Perhaps this is the problem?
I checked my guess. Anyway, when I start SonicMQ1, I see a line in the server log:
Main >(Mar 24, 2017 13:50:42:662) : Reading jmsProvider.properties from location : C:\Program Files\OpenEdge\properties\jmsProvider.properties
Main >: A public jmsfromABL.AdminObjectFinder class was not found.
seems AdminObjectFinder.jar file not available in the specified location in classpath and pluginsclasspath in $DLC/properties/AdminServerPlugins.properties. Could you please check the location of jar file and also increase the server logging level to 5 for sonicMQ1 in $DLC/properties/ubroker.properties file.
During this time I did the following:
1. Change AdminObjectFinder.java
Now, I have 2 forward slashes "//" after "file:"
2. Create and pack the class.
My AdminObjectFinder.jar is located at D:\Depo101\DPRO_31_10\MQ:
It's location on the server. On this server I run the program test_put.p
The logging level is already increased. I've attached the log with an increased level.
I see this log error: AMQ8568: The native JNI library 'mqjbnd64' was not found. For a client installation this is expected.
Anand, is it possible to handle exceptions if I call a program through an application server? I cann't get the error "Error connecting to the JMS AppServer service." when I run program test_q.p on workstation and put.p is executed on server by PASOE. Мy test_q.p hangs.
Are you able to start the sonicMQ1 adapter without any problem? could you please let me know whether the adapter created the connection factory?
Please share the sonicMQ1 log file with logging level 5.