Subject: | Cannot create subscription objects |
Date: | Fri, 24 Aug 2012 19:02:27 +0200 |
To: | <bug-MQSeries [...] rt.cpan.org> |
From: | <carsten.ditze [...] lhsystems.com> |
Hello !!
whenever I try to create a Subscription to a topic with destination
queue in MQ using the MQSeries::Command module, I get the problem
"CreateObject: Unable to determine object type."
Maybe it is just misuse maybe it is really a bug.
I appreciate very much if you can give me some hint!
If it is not a bug: I do not find any documentation how to do it
correctly. E.g. What parameters does a CreateSubscription method
expect? or
how to use CreateObject correctly to create the subscription?
Any help is welcome.
Below first find my environment information followed by the detailed
error I get and then by the code snippet.
Best regards and greeting from Frankfurt in Germany,
Carsten Ditze
fltwindsbuild <fltwinds> perl -v
This is perl, v5.8.8 built for i386-linux-thread-multi
fltwindsbuild <fltwinds> uname -a
Linux fltwindsbuild.lsya.dlh.de 2.6.18-274.7.1.el5 #1 SMP Mon Oct 17
11:57:40 EDT 2011 i686 i686 i386 GNU/Linux
CreateObject: Unable to determine object type.
More than one of the following was specified:
(Exception: ProcessName and QName can both be present, since
the former is an attribute of the latter.
We assume ObjectType == Queue in this case)
ChannelName
NamelistName
ProcessName
QName
StorageClassName
AuthInfoName
CFStructName
CFStrucName
ListenerName
ServiceName
SubName
TopicName
#-----------------------------------------------------------------------
-----
sub createSubscription {
#-----------------------------------------------------------------------
-----
my($name, $topicName, $destQueueName, %options) = @_;
my($result) = "Error: unknown result";
my @elements = $command->InquireSubscription( 'SubName' => $name );
if ( @elements == 0 ) {
#MQSC command: my $cmd = "def sub($subscriberName) topicstr(\'\')
topicobj($topicName) DEST($destQueueName)";
$result = $command->CreateObject(
Quite => 1,
Attrs => {
SubName => $name,
TopicName => $topicName,
TopicString => '',
Destination => $destQueueName,
Expiry => getValue($options{"-Expiry"}, -1),
}
) ? "created" : "Error: " . $command->ReasonText();
} elsif ( @elements == 1 ) {
$result = "existed";
} else {
$result = "Error: more then one alias exists with name '$name' for
topic '$topicName'";
}
return $result;
}
Dr. Carsten Ditze
Senior Software Architect
Lufthansa Systems AG
FRA AP/A-FF
Am Prime Parc 2
65479 Raunheim
Tel: +49 (0)69 696 52032
E-Mail: Carsten.Ditze@LHSystems.com
Internet: www.LHsystems.com
Sitz der Gesellschaft / Corporate Headquarters: Lufthansa Systems Aktiengesellschaft, Kelsterbach, Registereintragung / Registration: Amtsgericht Darmstadt 84307
Stellv. Vorsitzender des Aufsichtsrats / Deputy Chairman of the Supervisory Board: Carmen Galinier
Vorstand / Executive Board: Stefan Hansen (Vorsitzender / Chairman), Dr. Gunter Kuechler