ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Where to specify server and port in amqsput from shell scrip

Post new topic  Reply to topic
 Where to specify server and port in amqsput from shell scrip « View previous topic :: View next topic » 
Author Message
sumithar
PostPosted: Tue Apr 18, 2017 12:34 pm    Post subject: Where to specify server and port in amqsput from shell scrip Reply with quote

Apprentice

Joined: 13 Jun 2008
Posts: 47

Hi- Am forced to get my feet with both shell scripting and mq at the same time.
I researched and found I could use amqsput command from the terminal or shell script to put a message on a queue.
This is one such
Code:
/opt/mqm/samp/bin/amqsput QUEUE_NAME QUEUE_MANAGER_NAME

I got my sysadm to rpm the sample codepack.

I could not find any examples on how I specify the host and port for the queue manager?

I tried by specifying MQSERVER via an export command like so
Code:
$ export MQSERVER="X.Y.SVRCONN/TCP/hostname(1515)"

followed by
Code:
$ amqsput QUEUENAME MQSERVER

but I got a 2058 error which is a bad queue manager name. I"ve checked the queue manager name and I can't see any issue there

Any suggestions?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Apr 18, 2017 1:13 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

You missed the fact where you have to use amqsputc for the client version.
Most client versions of the sample programs finish with the letter c.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
sumithar
PostPosted: Tue Apr 18, 2017 6:16 pm    Post subject: Reply with quote

Apprentice

Joined: 13 Jun 2008
Posts: 47

fjb_saper wrote:
You missed the fact where you have to use amqsputc for the client version.
Most client versions of the sample programs finish with the letter c.

Have fun


Oh really? I didn't know that, I was going by the example I had found on stack overflow! If I'm not flouting any rules, this is the link
http://stackoverflow.com/questions/34742635/how-to-use-amqsput-command-in-shell-script-to-push-data-into-a-queue

I did try amqsputc from the command line with the same 2058 error message, btw.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Apr 18, 2017 7:05 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

The stackoverflow URL is for using amqsput sample. amqsput uses server-bindings, which means it MQCONNECTs cross-memory - to a local qmgr in the same o/s.

Amqsputc is bound to client-bindings libraries. MQCONNECTs are cross-network. As such, ipaddress(port) needs to be supplied.

Many samples come in the two flavors (flavours), server- and client-bindings.
_________________
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
View user's profile Send private message
PaulClarke
PostPosted: Tue Apr 18, 2017 10:38 pm    Post subject: Reply with quote

Grand Master

Joined: 17 Nov 2005
Posts: 1002
Location: New Zealand

You wrote that you tried the command
Code:
amqsput QUEUENAME MQSERVER

but what you should have tried is just

Code:
amqsputc QUEUENAME

You can specify the Queue Manager as the second parameter but there's not really any point in this case since the MQSERVER environment variable should be pointing at the right Queue Manager. If you progress to using the CCDT then you may well want to add the Queue Manager name parameter.

Cheers,
Paul.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Where to specify server and port in amqsput from shell scrip
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.