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 » PCF to inquire topics and subscriptions

Post new topic  Reply to topic Goto page 1, 2  Next
 PCF to inquire topics and subscriptions « View previous topic :: View next topic » 
Author Message
mqtablet
PostPosted: Sat Jul 17, 2010 3:53 am    Post subject: PCF to inquire topics and subscriptions Reply with quote

Acolyte

Joined: 09 Jun 2009
Posts: 71

Hi All,

is there a way to inquire the attributes of topics and subscriptions?
Does any one have a working example / dot net source code which works to inquire the attributes of subscriptions?

Thanks,
mqtablet
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sat Jul 17, 2010 5:27 am    Post subject: Reply with quote

Poobah

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

Take a look at the WMQ Script Command (MQSC) Reference manual for DISPLAY SUB and DISPLAY PUB.
_________________
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
mqjeff
PostPosted: Sun Jul 18, 2010 10:57 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Or more correctly, read the "programmable command format" manual for the description of the PCF commands INQUIRE SUBSCRIPTION and the INQUIRE TOPIC.
Back to top
View user's profile Send private message
mqtablet
PostPosted: Sun Aug 15, 2010 10:26 am    Post subject: Reply with quote

Acolyte

Joined: 09 Jun 2009
Posts: 71

Hi All,

I'm trying the same as in the below link. Even I'm facing the same problem. Any advice? I'm able to inquire properties of all MQ objects except Subscriptions. I have read and understood the PCF command formats, parameters. I do not get a PCF or MQ Exception, rather it is throwing me System.Exception. Not sure what to do.

http://www.ibm.com/developerworks/forums/thread.jspa?threadID=334753&tstart=0

Thanks,
mqtablet
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sun Aug 15, 2010 10:57 am    Post subject: Reply with quote

Poobah

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

Quote:
it is throwing me System.Exception

What is? From what call? Paste the output you see.
_________________
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
mqtablet
PostPosted: Sun Aug 15, 2010 11:48 am    Post subject: Reply with quote

Acolyte

Joined: 09 Jun 2009
Posts: 71

Hi Bruce,

The below is the code I'm using to inquire the subscription

Code:

void ButtonInquireSubscriptionClick(object sender, EventArgs e)
      {
         try
         {
            MQQueueManager qmgr = new MQQueueManager("MY.TEST.QMGR.V7", "SYSTEM.DEF.SVRCONN", "MQSERVER(1414)");
            PCFMessageAgent ag = new PCFMessageAgent(qmgr);
            PCFMessage rq = new PCFMessage(MQC.MQCMD_INQUIRE_SUBSCRIPTION);
            rq.AddParameter(MQC.MQCACF_SUB_NAME, "*");
            PCFMessage[] rs = ag.Send(rq);
            MessageBox.Show("Inquire Subscription Successful");
         }
         catch(PCFException PCFEX)
         {
            MessageBox.Show(PCFEX.ReasonCode + "   " + PCFEX.Message);
         }
         catch(Exception Ex)
         {
            MessageBox.Show(Ex.Message);
         }
      }


I'm able to connect to the queue manager successfully. The PCF messages are prepared well. When the agent tries to send the request to the command server and get a response, it throws an exception.
(Note: The command server is running and I'm successfully able to inquire the properties of queues, channels etc...)

When the compiler tries to execute the code

Code:
 PCFMessage[] rs = ag.Send(rq);


It goes to the General Exception Section

Code:
catch(Exception Ex)
         {
            MessageBox.Show(Ex.Message);
         }


This is the exception detail I get

Quote:

System.Exception : Unknown type
at IBM.WMQ.PCF.PCFParameter.NextParameter(MQMessage message)
at IBM.WMQ.PCF.PCFMessage..ctor(MQMessage message)
at IBM.WMQ.PCF.PCFMessageAgent.Send(PCFMessage request, Boolean check)
at IBM.WMQ.PCF.PCFMessageAgent.Send(PCFMessage request)
at InquireSub.MainForm.ButtonInquireSubscriptionClick(Object sender, EventArgs e) in c:\Documents and Settings\admin\Desktop\InquireSub\MainForm.cs:line 43
Source : amqmdnet


I've installed IBM WebSphere MQ client v7.0.1.1 on the machine to run this program, and the MQ server (MQSERVER) has IBM WebSphere MQ Server v7.0.1.1.

I'm also referring the latest amqmdnet.dll of MQ 7.0, which is 773KB.
I'm able inquire the properties of all the other MQ objects in this queue manager (including Topics) in a similar manner using PCFs. But not able to inquire the properties of only Subscriptions. Not sure where I'm going wrong.

Please let me know if you need more information. Thanks for your inputs in advance.

-mqtablet.
Back to top
View user's profile Send private message
mqtablet
PostPosted: Tue Aug 24, 2010 9:01 am    Post subject: Reply with quote

Acolyte

Joined: 09 Jun 2009
Posts: 71

Hi Bruce,

Any inputs on this? Do you need any more information?

thanks
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Aug 24, 2010 9:56 am    Post subject: Reply with quote

Poobah

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

I'm not a dot net person.

But it appears that the inquire parameters passed were out of order, incomplete, or otherwise in error.

Quote:
rq.AddParameter(MQC.MQCACF_SUB_NAME, "*");

Are you trying to inquire on all subscriptions? Is that what the * is for here?

The InfoCenter seems to suggest that you must supply a unique subid, and not a wild-card.

From the InfoCenter:
SubName (MQCFST)
The application's unique identifier for a subscription (parameter identifier: MQCACF_SUB_NAME).
If SubName is not provided, SubId must be specified to identify the subscription to be inquired.

The maximum length of the string is MQ_SUB_NAME_LENGTH.

SubId (MQCFBS)
Subscription identifier (parameter identifier: MQBACF_SUB_ID).
Specifies the unique internal subscription identifier.

I'm sure someone will correct me shortly.
_________________
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
mqtablet
PostPosted: Tue Aug 24, 2010 11:43 pm    Post subject: Reply with quote

Acolyte

Joined: 09 Jun 2009
Posts: 71

Yes, I'm trying to inquire the names of all subscriptions.

Also, the same code, if used with topics, works fine.

Quote:
rq.AddParameter(MQC.MQCA_TOPIC_NAME, "*");


works fine.

If my understanding is correct, either SUB name or SUB ID or both can be provided to inquire the parameters.
Back to top
View user's profile Send private message
mqtablet
PostPosted: Tue Aug 31, 2010 7:57 am    Post subject: Reply with quote

Acolyte

Joined: 09 Jun 2009
Posts: 71

Need real help now.. Not sure where I'm going wrong.

Code:

                PCFMessage rq = new PCFMessage(MQC.MQCMD_CREATE_SUBSCRIPTION);
                rq.AddParameter(MQC.MQCACF_SUB_NAME, "TEST.SUB");
                rq.AddParameter(MQC.MQCACF_DESTINATION, "LQ");
                rq.AddParameter(MQC.MQCA_TOPIC_STRING, "/tp1");
                PCFMessage[] rs = ag.Send(rq);



works fine.

Code:

                PCFMessage rq = new PCFMessage(MQC.MQCMD_DELETE_SUBSCRIPTION);
                rq.AddParameter(MQC.MQCACF_SUB_NAME, "TEST.SUB");
                PCFMessage[] rs = ag.Send(rq);



also works fine.

Code:

                PCFMessage rq = new PCFMessage(MQC.MQCMD_INQUIRE_SUBSCRIPTION);
                rq.AddParameter(MQC.MQCACF_SUB_NAME, "*");
                PCFMessage[] rs = ag.Send(rq);


Not sure why this is not working.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Aug 31, 2010 8:05 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqtablet wrote:
Need real help now..


You feel the help you've been getting up to now is fake? Some kind of knock off?

mqtablet wrote:
Not sure why this is not working.


Well (given that like my associate my .NET is somewhat dubious) this would seem to prove the assertion that a wildcard is not allowed.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqtablet
PostPosted: Tue Aug 31, 2010 8:15 am    Post subject: Reply with quote

Acolyte

Joined: 09 Jun 2009
Posts: 71

Hey Vitor,

Even when I used the actual subscription name (without a wild card), also did not work.

Code:

                PCFMessage rq = new PCFMessage(MQC.MQCMD_INQUIRE_SUBSCRIPTION);
                rq.AddParameter(MQC.MQCACF_SUB_NAME, "TEST.SUB");
                PCFMessage[] rs = ag.Send(rq);

Back to top
View user's profile Send private message
kevinf2349
PostPosted: Wed Sep 01, 2010 5:37 am    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

Maybe I am missing something (like a clue) but....

where do you specify where to put the results of the inquire?
Back to top
View user's profile Send private message
mqtablet
PostPosted: Wed Sep 01, 2010 11:28 pm    Post subject: Reply with quote

Acolyte

Joined: 09 Jun 2009
Posts: 71

The result in every case is put on to the PCFMessage array - 'rs'
Back to top
View user's profile Send private message
mqtablet
PostPosted: Tue Sep 21, 2010 8:19 am    Post subject: Reply with quote

Acolyte

Joined: 09 Jun 2009
Posts: 71

Analysis:

The amqmdnet.dll is missing a type. There is a problem in this dll.
And as far as I know, IBM will not support PCFs in .net. Currently, PCFs are supported only in Java by IBM. Hence no use of raising a PMR.

Not sure what to do.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » General IBM MQ Support » PCF to inquire topics and subscriptions
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.