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 » General IBM MQ Support » support ma01 help

Post new topic  Reply to topic
 support ma01 help « View previous topic :: View next topic » 
Author Message
mqwanderer
PostPosted: Mon Feb 03, 2014 10:01 am    Post subject: support ma01 help Reply with quote

Novice

Joined: 14 May 2013
Posts: 12

I want to pick messages from a local QM and copy them to a remote QM and so far I have had no luck.

My syntax seems to be off and I have had a tough time understanding how to use the various options in the README file. I don't know how to mix the two types of connections.

Code:

./q -m QM1 -i Q1 -m QM2  -o Q2\
...
Connecting ...connected to 'QM1'.
Connecting ...failed.
MQCONN on object 'QM2' returned 2058 QMgr name error..

Back to top
View user's profile Send private message
wmbwmq
PostPosted: Mon Feb 03, 2014 10:58 am    Post subject: Reply with quote

Acolyte

Joined: 18 Jul 2011
Posts: 66

Try this...
./q -m QM1 -i Q1 -o QM2/Q2
Back to top
View user's profile Send private message
wmbwmq
PostPosted: Mon Feb 03, 2014 10:59 am    Post subject: Reply with quote

Acolyte

Joined: 18 Jul 2011
Posts: 66

also, you might need
export MQSERVER=<whatever for QM2>
Back to top
View user's profile Send private message
exerk
PostPosted: Mon Feb 03, 2014 11:49 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

wmbwmq wrote:
also, you might need
export MQSERVER=<whatever for QM2>

Or, if the queue managers are interconnected, define a QREMOTE in QM1 and use that...
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
mqwanderer
PostPosted: Mon Feb 03, 2014 11:50 am    Post subject: Reply with quote

Novice

Joined: 14 May 2013
Posts: 12

Tried it; no luck.

Code:

:
MQSERVER=QM2.CLNTCONN/TCP/xx.xx.xx(12345)
:
$./q -m QM1 -i Q1 -o QM2/Q2
Connecting ...connected to 'QM1'.
MQOPEN on object 'Q2' returned 2087 Unknown remote QMgr..

[/code]
Back to top
View user's profile Send private message
zpat
PostPosted: Mon Feb 03, 2014 12:00 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

You can't do that in a single command unless you have a xmit queue called QM2 defined on QM1.

You can then do it that way, or use a remote queue definition. That remote queue definition will then refer to the queue on QM2

Either way the messages will travel over a standard sender channel from QM1 to QM2 (this needs to be defined as well).

OR you can save messages to a file with MA01 and run the command again to upload the file to a different QM (although qload is better for that).

To use MQ client mode in MA01 you need to code an option to do so. You can't use bindings and client mode at the same time. You could use client mode for both QM1 and QM2 with a CCDT.

However the easy answer is to understand how to send messages from one QM to another using a xmit queue and sender/receiver channel.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Tue Feb 04, 2014 6:31 am    Post subject: Reply with quote

Grand Master

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

Yes you can. Q will let you connect to two Queue Managers either locally or over a client. So, you can indeed move message between Queue Managers without requiring other channels or transmission queues or anything. However, it is worth pointing out that it does it single phase, it won't use a global transaction etc.

Essentially you need to provide multiple -m parameters to identify the Queue Managers and you need to use parameter -xb. -xb signifies shared handles since, by default, MQ does not allow you to connect to two different Queue Managers on the same thread.

So, to copy messages from one QM to the other you could say something like...


q -m QM1 -iQ1 -m QM2 -oQ3 -xb

This will copy all the messages from QM1 queue Q1 to QM2 Q3


If you want to connect over a client for, say QM2, you would say

q -m QM1 -iQ1 -m QM2 -lmqic32 -oQ3 -xb

The parameters are relative to the last -m flag.

Hope this helps,

Paul.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
zpat
PostPosted: Tue Feb 04, 2014 6:44 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

Would need a CCDT for the second option.

But useful to know yet another way to use MA01!
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Tue Feb 04, 2014 6:48 am    Post subject: Reply with quote

Grand Master

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

Well, you don't *need* a CCDT - normal client rules apply. So, if you are use MQSERVER or ActiveDirectory or a PreConnect exit etc then you wouldn't need one but clearly the CCDT offers the easiest flexibility.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
zpat
PostPosted: Tue Feb 04, 2014 6:56 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

How can you client connect to two different QMs at the same time without a CCDT?

MQSERVER can only refer to one QM surely?
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Tue Feb 04, 2014 7:00 am    Post subject: Reply with quote

Grand Master

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

The second option was showing how you can connect to a local QM (QM1) and a client QM (QM2).

If you wanted both to be connected as clients then you would need something like......

q -m QM1 -lmqic32 -iQ1 -m QM2 -lmqic32 -oQ3 -xb

Note that we have now said -lmqic32 for both Queue Managers.

In this case, as you say, you couldn't use MQSERVER but the other mechanisms would work.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
mqwanderer
PostPosted: Tue Feb 04, 2014 8:05 am    Post subject: Reply with quote

Novice

Joined: 14 May 2013
Posts: 12

Thanks all, I went the XMITQ route and that worked!

I am going to try it the way Paul mentioned. This is what I initially set out to do.

I am trying to use ma01 as a splitter. I may end up with one cron job to move messages from one IN Q over to two OUT Qs and then using the second cron job to to clear the IN Q.

Is there an *elegant* solution to achieve the same ?
Back to top
View user's profile Send private message
exerk
PostPosted: Tue Feb 04, 2014 8:23 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

mqwanderer wrote:
Is there an *elegant* solution to achieve the same ?

You could use the 'native' pub/sub capability of WMQ to 'split' the messages, then it's just a case of clearing the IN queue...
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Feb 04, 2014 8:28 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

There is a free open source message splitter (multiplexer) utility here

http://www.capitalware.biz/mmx_tryit.html
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
mqwanderer
PostPosted: Tue Feb 04, 2014 10:54 am    Post subject: Reply with quote

Novice

Joined: 14 May 2013
Posts: 12

The MMX tool works out great!

I am using channel triggering with it and everything seems to be in a happy state.

Thanks all!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » support ma01 help
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.