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 Java / JMS » dynamic set remote queue name on a remote definition

Post new topic  Reply to topic
 dynamic set remote queue name on a remote definition « View previous topic :: View next topic » 
Author Message
zzx04h
PostPosted: Tue Jun 08, 2004 1:34 am    Post subject: dynamic set remote queue name on a remote definition Reply with quote

Newbie

Joined: 08 Jun 2004
Posts: 2

Hi,

how should I from Java be able to set the remote queue name in a remote definition queue?

Example QM A have a remote definition queue where only the remote queuemanager name to QM B and the transmit queue to QM B is defined.

I would like to use this definition to be able to send messages to several queues on QM B without the need of creating separate remote definitions in QM A for each queueu on QM B.

Regards
Lasse
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jun 08, 2004 3:27 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You should look at queue manager aliases.

The only way to do what you're asking about programmatically is to create a new remote queue every time you need one using PCF messages.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Tue Jun 08, 2004 12:01 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

You can do what you are asking but drop the idea of using a Remote Queue definition.

If your transmission queues (XMITQ) are NOT the same name as remote queue managers then as Jeff mentioned you need to create Queue Manager Aliases.

Lets say you have 2 queue managers MQA1 and MQB1. On MQB1, you have 5 queues called B1, B2, B3, B4 & B5.

If your application connects to MQA1 but wants to put to any queue on MQB1 (i.e. B3) without creating remote queue definitions on MQA1, this is what you do:
Code:
memset(od.ObjectName, ' ', MQ_Q_NAME_LENGTH);
memset(od.ObjectQMgrName, ' ', MQ_Q_NAME_LENGTH);
//
strncpy(od.ObjectName, "B3", MQ_Q_NAME_LENGTH);
strncpy(od.ObjectQMgrName, "MQB1", MQ_Q_NAME_LENGTH);
//
MQOPEN(Hcon,                      /* connection handle            */
       &od,                       /* object descriptor for queue  */
       O_options,                 /* open options                 */
       &Hobj,                     /* object handle                */
       &OpenCode,                 /* MQOPEN completion code       */
       &Reason);                  /* reason code                  */

Since your application is specifying a different queue manager name than what it is connecting to, MQA1 does not valid the queue name. It ONLY validates that it has a path to MQB1 (either XMITQ or Queue Manager alias). Of course, when the message arrives at MQB1, it will validate that a queue called "B1" does exist.

That's it. Nothing complicated, you just need to know how a queue manager does its name resolution.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
zzx04h
PostPosted: Wed Jun 09, 2004 3:32 am    Post subject: Reply with quote

Newbie

Joined: 08 Jun 2004
Posts: 2

Thanks,

I have understand it now. It was a little confusing before I realized that the remote definition is a QM Alias.

Lasse
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Wed Jun 09, 2004 9:18 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

Be care with a statement like:
Quote:
before I realized that the remote definition is a QM Alias.

That statement is not entirely correct. A remote queue definition can be used for 2 different purposes:
    (1) As a remote queue defintion meaning a pointer to a queue that resides on a different queue manager (queue name resolution).
    (2) As a queue manager alias meaning a pointer or path to another queue manager (queue manager name resolution).


Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
PeterPotkay
PostPosted: Wed Jun 09, 2004 2:54 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

And don't forget Purpose #3, as a ReplyToQueue Alias, where the remote queue def you define can be used to remap the Reply2Q / Reply2QM fields of out going Request messages. Very useful when your internal QMs are sending messages out to another company, and you want to have all the replies come back to your Edge QM, where they can then be routed safely into your internal MQ network. This prevents the outside company knowing anything about your internal MQ setup.
_________________
Peter Potkay
Keep Calm and MQ On
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 » IBM MQ Java / JMS » dynamic set remote queue name on a remote definition
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.