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 » 2085 while putting messages to a cluster queue

Post new topic  Reply to topic
 2085 while putting messages to a cluster queue « View previous topic :: View next topic » 
Author Message
inblue
PostPosted: Wed Aug 10, 2005 4:19 am    Post subject: 2085 while putting messages to a cluster queue Reply with quote

Newbie

Joined: 28 Oct 2003
Posts: 3

I have a cluster (TEST) which has 3 QMgrs QMA,QMB,QMC.
QMB is the full repository and i have a local Q L1 on QMC that is shared in the cluster

Now, logically my java application should be able to put a message to L1 by connecting to QMA even though L1 physically resides on QMC.

However, while running the java application ( ie connecting it to QMA and putting to L1 ),I get a 2085 error. i.e Object unknown.

The java code is as below
Code:

import java.util.*;
import java.io.*;
import com.ibm.mq.*;


public class MQSeriesClientput {

   static String HostName  = "x.x.x.x";


   private static  String qmanager = "QMA";
   private static String qchannel = "SYSTEM.DEF.SVRCONN";
   private static String qname    = "L1";


   public static void main(String[] args){


     //Step 1. Connect Application to the Queue Manager
       try {

         MQEnvironment env = new MQEnvironment();
         env.hostname = HostName;     // Could have put the hostname & channel
          env.channel  = qchannel;     // string directly here!
         env.port    =   1000;

         MQQueueManager qmgr = new MQQueueManager(qmanager);

         int openOptions = MQC.MQOO_OUTPUT |MQC.MQOO_BIND_ON_OPEN ;


   //Step 2. Open a Queue for output

           MQQueue myq = qmgr.accessQueue( qname,
                       openOptions,
                       qmanager,
                                             null,
                                             null );


     //Step 3. Put message into the queue

      MQMessage mymsg = new MQMessage();
      mymsg.messageId = null;
      mymsg.correlationId = null;
      mymsg.format = MQC.MQFMT_STRING;

      String sendToMQ = "Test Message!";
       mymsg.writeString( sendToMQ );

        myq.put(mymsg);

   System.out.println("Your job has been submitted ..."+"\n");

     //Step 4. Close the Queue

      myq.close();

      //Step 5. Disconnect the Queue
         qmgr.disconnect();


      } catch(MQException mx) {
         System.out.println( mx);
        mx.printStackTrace();}
         catch(IOException Ix) {
         System.out.println( Ix);
         Ix.printStackTrace();}

   }
}




More so , when i use amqsput to write messages using the following command, it works, although i am connecting to QMA where L1 does not reside physically.
Code:

amqsput L1 QMA 


The output from the amqusput is
Quote:


C:\Program Files\MQSeries\tools\c\samples\bin>amqsput L1 QMA
Sample AMQSPUT0 start
target queue is L1
test

Sample AMQSPUT0 end




Now, if i alter the accessqueue function as below

Code:


           MQQueue myq = qmgr.accessQueue( qname,
                       openOptions,
                       "QMC",
                                             null,
                                             null );

That is, specify the name of the residing queuemanager while accessing the queue, i am successfully able to put the message to the cluster Q L1 although my application connected to QMA .

I do not understand why the code in the first case does not work.

I am wondering why put from amqsput is successful and it is not successful using the java code i specified in the first case.

Am i missing somethinng ?
Can anyone help me understand wht is the reason for this discrepancy

Thanks
Back to top
View user's profile Send private message
Mr Butcher
PostPosted: Wed Aug 10, 2005 4:21 am    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

if you do the open with qname and lokal qmgrname, mq looks for a local defined queue, it does not check the cluster. use a blank queuemanagername when opening the queue and it will work.
_________________
Regards, Butcher
Back to top
View user's profile Send private message
happyj
PostPosted: Wed Aug 10, 2005 5:17 am    Post subject: Reply with quote

Voyager

Joined: 07 Feb 2005
Posts: 87

chapter 8 of the application programming guide goes into
how MQOPEN works in detail.
Also look at MQOO_BIND_NOT_FIXED and MQ_OO_BIND_ON_OPEN

you might want to look at local alias queues to the remote Q
Back to top
View user's profile Send private message
EddieA
PostPosted: Wed Aug 10, 2005 9:16 am    Post subject: Reply with quote

Jedi

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

Quote:
you might want to look at local alias queues to the remote Q

Why. This is using a Cluster.

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
inblue
PostPosted: Wed Aug 10, 2005 7:54 pm    Post subject: Reply with quote

Newbie

Joined: 28 Oct 2003
Posts: 3

hey Butcher, specfying a blank queuemanager name while opening the queue did it.

thanks for the help
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 API Support » 2085 while putting messages to a cluster queue
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.