Author |
Message
|
Gergo2020 |
Posted: Mon Sep 14, 2020 1:25 am Post subject: How To use C examples? |
|
|
Novice
Joined: 25 Jun 2020 Posts: 15
|
Hi all!
I would like to use c:\Program Files\IBM\MQ\Tools\c\Samples\Bin\amqsput.exe
I created a bat file, contents:
""c:\test\amqsput.exe" MQ,MQM,192.168.100.230(1414),DOTNET.SVRCONN
pause"
I got a reason code:2058
What wrong with it?
Thank You! |
|
Back to top |
|
|
PaulClarke |
Posted: Mon Sep 14, 2020 2:18 am Post subject: |
|
|
Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Why have you separated the parameters with commas? Try just using spaces. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
|
Gergo2020 |
Posted: Mon Sep 14, 2020 3:35 am Post subject: |
|
|
Novice
Joined: 25 Jun 2020 Posts: 15
|
Thank you, I replaced, but same error. |
|
Back to top |
|
|
PaulClarke |
Posted: Mon Sep 14, 2020 4:05 am Post subject: |
|
|
Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Well then are you sure that the Queue Manager you are connecting to is called MQM ?
Have you looked in the MQ Client error log for any error messages ? _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
|
fjb_saper |
Posted: Mon Sep 14, 2020 4:59 am Post subject: |
|
|
Grand High Poobah
Joined: 18 Nov 2003 Posts: 20729 Location: LI,NY
|
AMQSPUT will never use a client connection.
Check your mqserver environment variable and use amqsputc _________________ MQ & Broker admin |
|
Back to top |
|
|
bruce2359 |
Posted: Mon Sep 14, 2020 5:04 am Post subject: |
|
|
Poobah
Joined: 05 Jan 2008 Posts: 9442 Location: US: west coast, almost. Otherwise, enroute.
|
|
Back to top |
|
|
markt |
Posted: Mon Sep 14, 2020 5:33 am Post subject: |
|
|
Knight
Joined: 14 May 2002 Posts: 508
|
Quote: |
AMQSPUT will never use a client connection. |
Yes it can. And has been able to for many releases. For example,
Code: |
export MQ_CONNECT_TYPE=CLIENT
|
and then see what happens. libmqm can act as client, so there's really no need for two variants of the programs. |
|
Back to top |
|
|
bruce2359 |
Posted: Mon Sep 14, 2020 9:36 am Post subject: Re: How To use C examples? |
|
|
Poobah
Joined: 05 Jan 2008 Posts: 9442 Location: US: west coast, almost. Otherwise, enroute.
|
Gergo2020 wrote: |
Hi all!
I would like to use c:\Program Files\IBM\MQ\Tools\c\Samples\Bin\amqsput.exe
I created a bat file, contents:
""c:\test\amqsput.exe" MQ,MQM,192.168.100.230(1414),DOTNET.SVRCONN
pause"
I got a reason code:2058
What wrong with it?
Thank You! |
Did you get the same results when you tested this interactively - not a batch script? _________________ 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 |
|
|
RogerLacroix |
Posted: Mon Sep 14, 2020 12:59 pm Post subject: Re: How To use C examples? |
|
|
Jedi Knight
Joined: 15 May 2001 Posts: 3258 Location: London, ON Canada
|
Gergo2020 wrote: |
""c:\test\amqsput.exe" MQ,MQM,192.168.100.230(1414),DOTNET.SVRCONN
pause" |
Hummmm. What's that? Ok, its Monday, but I'm confused.
Here's what my batch files looks like:
Code: |
@echo off
setlocal
rem
rem 1st parameter is the name of the queue
rem
set MQSERVER=DOTNET.SVRCONN/TCP/192.168.100.230(1414)
"C:\Program Files\IBM\MQ\Tools\c\Samples\Bin\amqsputc.exe" %1 MyQMgrName
endlocal |
Then I call the batch file by the action and the name of the queue manager (i.e. Put2MyQMgrName).
To run it and put messages to queue 'TEST.Q1', you just do:
Code: |
Put2MyQMgrName.bat TEST.Q1 |
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
|
fjb_saper |
Posted: Mon Sep 14, 2020 3:26 pm Post subject: |
|
|
Grand High Poobah
Joined: 18 Nov 2003 Posts: 20729 Location: LI,NY
|
markt wrote: |
Quote: |
AMQSPUT will never use a client connection. |
Yes it can. And has been able to for many releases. For example,
Code: |
export MQ_CONNECT_TYPE=CLIENT
|
and then see what happens. libmqm can act as client, so there's really no need for two variants of the programs. |
I stand corrected... Thanks _________________ MQ & Broker admin |
|
Back to top |
|
|
Gergo2020 |
Posted: Mon Sep 21, 2020 3:55 am Post subject: |
|
|
Novice
Joined: 25 Jun 2020 Posts: 15
|
Thank you all for your help. Message sent successfully. That would be my question. How can I compile my own C version? What tools are needed to add it under windows?
Thank you! |
|
Back to top |
|
|
gbaddeley |
Posted: Mon Sep 21, 2020 10:15 pm Post subject: Re: How To use C examples? |
|
|
Jedi Knight
Joined: 25 Mar 2003 Posts: 2527 Location: Melbourne, Australia
|
Gergo2020 wrote: |
Hi all!
I would like to use c:\Program Files\IBM\MQ\Tools\c\Samples\Bin\amqsput.exe
I created a bat file, contents:
""c:\test\amqsput.exe" MQ,MQM,192.168.100.230(1414),DOTNET.SVRCONN
pause"
I got a reason code:2058
What wrong with it?
Thank You! |
I'm not sure where you got the idea that amqsput has this parameter format. Inspecting the source code in Tools\c\Samples\amqsput0.c would reveal the correct format.
You shouldn't copy amqsput.exe (or any of the MQ .exe or other product files) to your own directory. It would mean that the copied files would not be updated if any MQ fix packs or upgrades were installed.
On Windows, the MQ sample bin directory is in the default PATH, so you can specify amqsput.exe (or even just amqsput) in the bat file.
BTW, you can compile C programs on Windows using MS Visual Studio. There is a free Community Edition for personal use, however check if your company has a license to allow you to use Visual Studio Professional or Enterprise. _________________ Glenn |
|
Back to top |
|
|
|