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 » Unsubscribe problem

Post new topic  Reply to topic
 Unsubscribe problem « View previous topic :: View next topic » 
Author Message
yeahyeah
PostPosted: Wed Aug 16, 2006 11:18 pm    Post subject: Unsubscribe problem Reply with quote

Novice

Joined: 06 Aug 2006
Posts: 18
Location: HK

I have some unused JMS durable subscriber in broker and want to kill them. (Well, we really need to use durable subscriber)I have some questions:
1. I have tried UnSubscriber.java and DumpBroker.java, it gives the following error
Quote:

Unsubscribe failed for reason NOT_REGISTERED
Format error in source file on line 20

this is the file i provided to unsubscribe.java
Quote:


Publishers
--------------
Stream Name: SYSTEM.BROKER.DEFAULT.STREAM

Subscribers
--------------
Stream Name: SYSTEM.BROKER.DEFAULT.STREAM
Topic: trigger
BrokerCount: 0
ApplCount: 2
AnonymousCount: 0
RegistrationQMgrName: test6.queue.manager
RegistrationQName: SYSTEM.JMS.D.SUBSCRIBER.QUEUE
RegistrationCorrellId: 414D512074657374362E71756575652EB903DB4420004C05
RegistrationUserIdentifier: Yeah
RegistrationOptions: 1048577 : MQREGO_CORREL_ID_AS_IDENTITY
RegistrationTime: 2006081010443957

RegistrationQMgrName:
RegistrationQName: SYSTEM.JMS.D.SUBSCRIBER.QUEUE
RegistrationCorrellId: 414D512074657374362E71756575652EB903DB4420002D05
RegistrationUserIdentifier: Yeah
RegistrationOptions: 1048577 : MQREGO_CORREL_ID_AS_IDENTITY
RegistrationTime: 2006081010245812



What's wrong?

2. I have tried to create a class sends PCF to do the same function:
Quote:

PCFMessageAgent pcfa = null;
boolean retry = true;
do {
try {
pcfa = new PCFMessageAgent("hostname", portNo, "SYSTEM.DEF.SVRCONN");
retry = false;
} catch (MQException e) { // Try to reconnect
System.out.println(e.getMessage());
e.printStackTrace();
System.out.println("Connect failed, waiting for retry.");
try {
Thread.sleep(15000);
} catch (InterruptedException e1) {
}
}
} while (retry);

// Prepare command
PCFMessage pcfm = new PCFMessage(CMQCFC.MQCMD_DEREGISTER_SUBSCRIBER);
pcfm.addParameter(CMQCFC.MQIACF_REGISTRATION_OPTIONS, CMQCFC.MQREGO_CORREL_ID_AS_IDENTITY);
pcfm.addParameter(CMQCFC.MQCACF_TOPIC, "trigger");
pcfm.addParameter(CMQC.MQCA_Q_NAME, "SYSTEM.JMS.D.SUBSCRIBER.QUEUE");
pcfm.addParameter(CMQC.MQCA_Q_MGR_NAME, "test6.queue.manager");

// Send command and retrive reply
PCFMessage[] pcf = null;
do {
retry = false;
try {
pcf = pcfa.send(pcfm);
} catch (Exception e) { // PCF, MQ or IO exception to be handled here
e.printStackTrace();
return;
}
...........

Yet it gives the following error:
Quote:

MQJE001: Completion Code 2, Reason 3007
com.ibm.mq.pcf.PCFException: MQJE001: Completion Code 2, Reason 3007
at com.ibm.mq.pcf.PCFMessageAgent.send(PCFMessageAgent.java:299)
at com.ibm.mq.pcf.PCFMessageAgent.send(PCFMessageAgent.java:224)
at DeregisterSubscriber.<init>(DeregisterSubscriber.java:69)
at DeregisterSubscriber.main(DeregisterSubscriber.java:23)


I know 3007->MQRCCF_CFH_COMMAND_ERROR, so what can i do? In addition, i wrote a clear queue PCF pgm that has similar logic, thus i don't really know why i obtain this error. Can't i solely depend on PCFMessage?

3. In JMS Session.createDurableConsumer(), we have to apply a name that identifies this subscription. What attribute will this name be in MQMessage, or in Broker's view?

Thanks for reading and hope someone could help....
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Aug 17, 2006 1:59 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I don't think you are using the UnSubscribe Java correctly, I don't think you are sending it the right file.

I don't think that the "Unsubscribe" command is a PCF command... I think it's built according to the rules in the Publish/Subscribe User's Guide manual using an RFH2 header.

I think you can also manually clear all subscriptions by clearing the SYSTEM.BROKER.IQ.* queues, and then reregistering needed subscribers.
_________________
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 » IBM MQ Java / JMS » Unsubscribe problem
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.