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 » Clustering » Connecting to the cluster without source code

Post new topic  Reply to topic
 Connecting to the cluster without source code « View previous topic :: View next topic » 
Author Message
bigdavem
PostPosted: Wed Nov 05, 2003 10:26 pm    Post subject: Connecting to the cluster without source code Reply with quote

Acolyte

Joined: 16 Sep 2001
Posts: 69
Location: Sydney, Australia

We are transitioning from a hub-and-spoke architecture to an MQ cluster under MQ 5.3. One of our apps is a third party app and we have no source code so we can't change the MQ calls it makes. This app connects to qmgr A and tries to write to queue B1 on qmgr B. Both qmgrs are in the same cluster, and B1 is a cluster queue.

The app fails with reason code 2085 (MQRC_UNKNOWN_OBJECT_NAME). We've seen this before, and generally it means that the app has supplied both the qmgr and queue name when calling the MQOPEN so it is trying to bind to a local instance of cluster queue B1 on qmgr A, which doesn't exist. The simple solution is to just move spaces to od.ObjectQMgrName so that the qmgr will resolve the queue by itself, but we can't do that because we can't change the code.

To work around this I tried setting up a queue alias A1 on qmgr A which resolves to queue B1. A1 is a member of the cluster and DEFBIND is set to NOTFIXED. However, I am receiving reason code 2082 (MQRC_UNKNOWN_ALIAS_BASE_Q).

I know the definition of A1 is ok because I can run amqsput A1 A successfully and the message ends up on queue B1.

Am I missing something here? Should this work? Is there an alternative, other than defining a remote queue definition, xmitq and channels?
Back to top
View user's profile Send private message Send e-mail
TonyD
PostPosted: Thu Nov 06, 2003 4:00 pm    Post subject: Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

Does queue B1 appear as a cluster queue in qmgr A. I tried what you want to do, with queue alias A1 specified as 1) not in the cluster, 2) in the cluster, and both times messages put to A1 on A reached B1 on B.
Back to top
View user's profile Send private message Send e-mail
bigdavem
PostPosted: Thu Nov 06, 2003 4:31 pm    Post subject: Reply with quote

Acolyte

Joined: 16 Sep 2001
Posts: 69
Location: Sydney, Australia

Yes it does appear - if I do DIS QCLUSTER(B1) on qmgr A I can see the queue. And like I said, amqsput A1 A works ok.

I can reproduce the problem from a simple VB app, but if I change it so that it doesn't set the queue mgr name in the OD then I can put to the queue ok. Of course, I can't make that change to the actual app in question....
Back to top
View user's profile Send private message Send e-mail
bigdavem
PostPosted: Thu Nov 06, 2003 5:03 pm    Post subject: Reply with quote

Acolyte

Joined: 16 Sep 2001
Posts: 69
Location: Sydney, Australia

For what it's worth, here's the VB code. The form is just two buttons, Open and Exit. Qmgr A is actually called INTMQI1, queue A1 is called MQSI.HIPORT.UPDATE2, qmgr B is called INTHPT1 queue B1 is called HIPORT.UPDATE.

Code:
Dim Hconn As Long
Dim od As MQOD
Dim CompCode As Long
Dim Reason As Long
Dim Hobj As Long
Dim O_options As Long

Private Sub Command1_Click()
   
    MQOD_DEFAULTS od
    od.ObjectQMgrName = "INTMQI1"
    od.ObjectName = "MQSI.HIPORT.UPDATE2"
    O_options = MQOO_OUTPUT + MQOO_FAIL_IF_QUIESCING
    MQOPEN Hconn, od, O_options, Hobj, CompCode, Reason
    If CompCode = MQCC_OK Then
        MQCLOSE Hconn, Hobj, 0, CompCode, Reason
        MsgBox "Open succeeded", vbOKOnly, "Open Succeeded"
    Else
        MsgBox "Open failed with reason code " + CStr(Reason), vbOKOnly, "Open Failed"
    End If
   
End Sub

Private Sub Command2_Click()

    Unload Me

End Sub

Private Sub Form_Load()

    QMgrName = "INTMQI1"
   
    MQ_SETDEFAULTS

    MQCONN QMgrName, Hconn, CompCode, Reason
    If CompCode = MQCC_FAILED Then
        MsgBox "Unable to connect to queue manager - RC " + CStr(Reason), vbOKOnly, "Connection Error"
        Exit Sub
    End If
   
End Sub

Private Sub Form_Unload(Cancel As Integer)

    MQDISC Hconn, CompCode, Reason
   
    End

End Sub


And here are the definitions from qmgr "A" (INTHPT1):

Code:
    14 : DIS QA(MQSI.HIPORT.UPDATE2)
AMQ8409: Display Queue details.
   DESCR( )                                TARGQ(HIPORT.UPDATE)
   CLUSTER(INTCLU1)                        CLUSNL( )
   QUEUE(MQSI.HIPORT.UPDATE2)              ALTDATE(2003-11-07)
   ALTTIME(10.47.04)                       GET(ENABLED)
   PUT(ENABLED)                            DEFPRTY(0)
   DEFPSIST(NO)                            SCOPE(QMGR)
   DEFBIND(NOTFIXED)                       TYPE(QALIAS)

    15 : DIS QCLUSTER(HIPORT.UPDATE)
AMQ8409: Display Queue details.
   DESCR(Generic queue for HiPort updates)
   CLUSTER(INTCLU1)                        QUEUE(HIPORT.UPDATE)
   CLUSQMGR(INTHPT1)                       QMID(INTHPT1_2003-08-29_21.48.10)
   CLUSDATE(2003-11-06)                    CLUSTIME(15.27.12)
   ALTDATE(2003-11-05)                     ALTTIME(15.39.27)
   CLUSQT(QLOCAL)                          TYPE(QCLUSTER)
   PUT(ENABLED)                            DEFPRTY(0)
   DEFPSIST(YES)                           DEFBIND(OPEN)
Back to top
View user's profile Send private message Send e-mail
EddieA
PostPosted: Fri Nov 07, 2003 10:57 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Maybe a Queue Manager alias, changing the name of B to spaces.

Just a thought.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Nov 07, 2003 7:17 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Eddie got the right idea.

On QMA, create a QMALIAS for QMB like this:

DEFINE QREMOTE ('QMB') +
RNAME (' ') +
RMNAME (' ') +
RQMNAME (' ') +
XMITQ(' ') +
REPLACE

Now any app that specifies QMB for the QMname will have that attribute wiped out to nothing, leaving only the queue name, and the message will get where it needs to via good ol' clustering.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
bigdavem
PostPosted: Sun Nov 09, 2003 2:53 pm    Post subject: Reply with quote

Acolyte

Joined: 16 Sep 2001
Posts: 69
Location: Sydney, Australia

I like your thinking, but the app actually specifies QMA as the qmgr name so I don't think setting up an alias for QMB will work? I tried setting up an alias for QMA as per your suggestion but still got the 2085 error, which surprised me....
Back to top
View user's profile Send private message Send e-mail
PeterPotkay
PostPosted: Mon Nov 10, 2003 2:30 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

ok, this makes sense. If you specify a Qname in the od.ObjectQMgrName, then name resolution works as designed and MQ only looks on QMA for the queue.

Sometimes we cant see the forest thru the trees. The solution is simple: Define a remote queue definition on QMA pointing at queue B1 on QMB.

On QMA, do this:
DEFINE QREMOTE ('QueueB1') +
RNAME ('QueueB1 ') +
RQMNAME ('QMB') +
REPLACE

No XMITQ, no CLUSTER attribute. It assumes QMA and QMB are clustered, and QueueB1 is clustered.

It works on my setup.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
bigdavem
PostPosted: Mon Nov 10, 2003 3:02 pm    Post subject: Reply with quote

Acolyte

Joined: 16 Sep 2001
Posts: 69
Location: Sydney, Australia

Yep, that works. Thanks! Only disadvantage is it ties me into the specific instance of that queue on that queue manager so I can't take advantage of multiple instances of the queue on multiple queue managers, but I can live with that.
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Mon Nov 10, 2003 3:12 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You could try specifying an empty queue manager name on the remote definition.

That will probably just give you an error. But it might also give you access to the whole cluster.

Or you could tie your tail into knots, and specify a remote defintion that points to an alias queue on QMA for the cluster queue on QMB.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Mon Nov 10, 2003 3:25 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Does QMA have to be in the same cluster as QMB, QMB.1, QMB.2, etc?
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
QDogg
PostPosted: Wed May 11, 2005 7:48 am    Post subject: Reply with quote

Newbie

Joined: 11 May 2005
Posts: 2

Quote:
Yep, that works. Thanks! Only disadvantage is it ties me into the specific instance of that queue on that queue manager so I can't take advantage of multiple instances of the queue on multiple queue managers, but I can live with that.


The remote queues work, but does anyone know of a solution that would be able to take advantage of multiple instances of the queue on multiple queues for load balancing and fail over purposes?
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed May 11, 2005 12:01 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Cluster them.

And make sure the app that is putting to the q is connected to a QM that does not host an instance of that q, as it will block the round robining to the other QMs.

In MQ 6.0, this restriction has been removed.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
QDogg
PostPosted: Thu May 12, 2005 6:55 am    Post subject: Reply with quote

Newbie

Joined: 11 May 2005
Posts: 2

Thanks for the reply, but If I cluster them, I have the same issue as the original author where the app gets a return code of 2082. amqsput works though. I used the remote queue solution you suggested and it works,

Quote:
On QMA, do this:
DEFINE QREMOTE ('QueueB1') +
RNAME ('QueueB1 ') +
RQMNAME ('QMB') +
REPLACE


but this is tied to QueueB1 on QMB. If I have another QueueB1 on QMC, how do I configure it so that it would go to either one.

What restriction are you referring to that was removed in MQ6?

Thanks,
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu May 12, 2005 7:07 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

QDogg wrote:
What restriction are you referring to that was removed in MQ6?


The cluster workload algorithm in v6 is changed so that it will not always pick a local queue if there is one.
_________________
I am *not* the model of the modern major general.
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 » Clustering » Connecting to the cluster without source code
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.