|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
C/C++ MQ Client Application SSL |
« View previous topic :: View next topic » |
Author |
Message
|
vaso |
Posted: Tue Sep 14, 2021 2:06 am Post subject: C/C++ MQ Client Application SSL |
|
|
Newbie
Joined: 14 Sep 2021 Posts: 1
|
Hi,
I've written a client application in C++ which connects to a remote MQ server and reads data via a SSL connection. The C++ application works fine, but I'm trying to convert it to a C application, because I need to be able to assign a SSL certificate label via the application, and I understand that this is only available via the C API.
I'm trying to convert the amqssslc.c sample application to try to GET data from the remote queue (INPUT_AS_DEF), but the MQOPEN function call keeps failing with reason 2045 (MQRC_OPTION_NOT_VALID_FOR_TYPE - not valid option when trying to browse a non-local queue).
My question is whether it is possible to use the C API to connect and read data from a remote queue, and if yes are there any options I might be looking to change when initialising the connection via MQCONNX?
MQCONNX(QMName, /* queue manager */
&ConnectOptions, /* options for connection */
&Hcon, /* connection handle */
&CompCode, /* completion code */
&CReason); /* reason code
// This works fine and the client is connected to the remote server
od.ObjectType = MQOT_Q_MGR; /* open the queue manager object*/
O_options = MQOO_INPUT_AS_Q_DEF + MQOO_FAIL_IF_QUIESCING;
MQOPEN(Hcon, /* connection handle */
&od, /* object descriptor for queue */
O_options,
&Hobj, /* object handle */
&OpenCode, /* MQOPEN completion code */
&Reason);
// MQOPEN fails with code 2045
Thanks,
V |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Sep 14, 2021 4:22 am Post subject: Re: C/C++ MQ Client Application SSL mqrc 2045 |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
vaso wrote: |
od.ObjectType = MQOT_Q_MGR; /* open the queue manager object*/
O_options = MQOO_INPUT_AS_Q_DEF + MQOO_FAIL_IF_QUIESCING;
MQOPEN(Hcon, /* connection handle */
&od, /* object descriptor for queue */
O_options,
&Hobj, /* object handle */
&OpenCode, /* MQOPEN completion code */
&Reason);
// MQOPEN fails with code 2045
|
A qmgr object is not a queue. _AS_Q_DEF is not compatible with a qmgr object type.
Ref: https://www.ibm.com/docs/en/ibm-mq/7.5?topic=calls-mqopen-open-object _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|