|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
publish-subscribe routing exit |
« View previous topic :: View next topic » |
Author |
Message
|
nilendu |
Posted: Thu Sep 14, 2006 8:17 am Post subject: publish-subscribe routing exit |
|
|
Novice
Joined: 14 Sep 2006 Posts: 16
|
Hi All,
I am just 1 months old to the MQ series technology. So please apologies
my ignorance.
My reference material is 'MQ series Publish Subscribe Users Guide.pdf'
BACKGROUD:
I am trying to deploy a publish/subscribe routing exit dll. The sample
code is amqspsra.c
It's available with the WB 6.0 installer at
F:\Program Files\IBM\WebSphere MQ\Tools\c\Samples\pubsub\.
I have simply created a VC project and copied the code into it.
I have successfully compiled the dll and updated the 'routerexitpath'
parameter for WBRK6_DEFAULT_QUEUE_MANAGER
(i am using the default configuration for this) as follows:
C:\Program Files\Microsoft Visual
Studio\MyProjects\messageexit\Debug\messageexit(RoutingExit)
where messageexit.dll is the name of my dll and RoutingExit() is the
function name that I have exported.
MY PROBLEM:
When I start the broker in pub/sub mode using the command 'strmqbrk -m
WBRK6_DEFAULT_QUEUE_MANAGER',
The Router exit gets called immediately after the broker starts.
As per my understanding, the broker should call the exit function only
when a publisher application publishes
something to the broker.
The strange thing is that the parameter pExitParm->ExitReason passed to
the exit function is MQXR_MSG. It means
a publish requests was actually sent to the broker. But I had not sent
any publish requests yet.
How did the exit get called?
The second thing I noticed is that the pExitParm->StreamName parameter
is set to SYSTEM.BROKER.ADMIN.STREAM.
If I am not wrong the default queue used to publish a message by the
broker is SYSTEM.BROKER.DEFAULT.STREAM
My routing code is as simple as follows:
void MQENTRY RoutingExit(PMQPXP pExitParm)
{
int QFound=FALSE;
int QMgrFound=FALSE;
char streamName[MQ_Q_NAME_LENGTH];
char QNameIn[MQ_Q_NAME_LENGTH];
char QNameOut[MQ_Q_NAME_LENGTH];
char QMgrNameIn[MQ_Q_MGR_NAME_LENGTH];
char QMgrNameOut[MQ_Q_MGR_NAME_LENGTH];
char DestQueue[MQ_Q_MGR_NAME_LENGTH];
char QMgrName[MQ_Q_MGR_NAME_LENGTH];
char QMgrName2[MQ_Q_MGR_NAME_LENGTH];
//char CharData[MQ_Q_MGR_NAME_LENGTH];
/***************************************************************************/
/* Switch on the reason the exit was called
*/
/***************************************************************************/
switch (pExitParm->ExitReason)
{
case MQXR_INIT:
break;
case MQXR_TERM:
break;
case MQXR_MSG:
fp =fopen("C:\\MESSAGEEXIT.TXT","w");
memset(streamName, ' ', MQ_Q_NAME_LENGTH);
memset(QNameIn, ' ', MQ_Q_NAME_LENGTH);
memset(QNameOut, ' ', MQ_Q_NAME_LENGTH);
memset(QMgrNameIn, ' ', MQ_Q_MGR_NAME_LENGTH);
memset(QMgrNameOut, ' ', MQ_Q_MGR_NAME_LENGTH);
if (pExitParm->DestinationType == MQDT_APPL)
{
fprintf(fp,"pExitParm->StreamName
%s",pExitParm->StreamName);
fprintf(fp,"pExitParm->ExitReason %s",pExitParm->ExitReason);
if (memcmp(pExitParm->QMgrName, QMgrName,
MQ_Q_MGR_NAME_LENGTH) == 0)
{
}
}
else if (pExitParm->DestinationType == MQDT_BROKER)
{
}
fflush(fp);
fclose(fp);
break;
}
This has led to another issue for me. After I start the broker which
inturn runs the router exit immediately, I am not able to
register any subscriber under this broker. I get an error message with
error number 3081:
MQRCCF_NOT_AUTHORIZED
I am out of clues
Please help!
regards,
Nilendu |
|
Back to top |
|
 |
malammik |
Posted: Thu Sep 14, 2006 10:18 am Post subject: |
|
|
 Partisan
Joined: 27 Jan 2005 Posts: 397 Location: Philadelphia, PA
|
There are like 100 different questions inside your post but the reason you see exit called right away is because many components inside broker communicate with each other via pub/sub and publish on $SYS topics performance, change control, status data. The security error proly has nothing to do with the exit, try removing it all together and attempt to re-subscribe exactly the same way? And why do u need such an exit? _________________ Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex |
|
Back to top |
|
 |
nilendu |
Posted: Thu Sep 14, 2006 11:48 am Post subject: |
|
|
Novice
Joined: 14 Sep 2006 Posts: 16
|
Mikhail,
Thanks for your update.
The security problem occurs as soon as I add routerexitpath
entry. The problem gets resolved once the routerexit entry is
removed.
I have tested it couple of times.
I need the exit to change the destination queue at run time.
e.g if dest. Q is A change it to B if dest Q is C change it to D
Awaiting your comments.
Thanks and regards,
Nilendu |
|
Back to top |
|
 |
malammik |
Posted: Thu Sep 14, 2006 11:57 am Post subject: |
|
|
 Partisan
Joined: 27 Jan 2005 Posts: 397 Location: Philadelphia, PA
|
Not sure why. I never installed such an exit but I was in a similar situation with subscribers and destinations. Perhaps it would make sense to find a different alternative rather than using an exit??? For example all subscribers could subscribe on teh same queue, and you could have some process which reads off that queue and delivers messages while performing some routing that broker cannot do. _________________ Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Sep 14, 2006 3:15 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Also, let's be very very very clear right now.
If you are using Message Broker, then you must use the command mqsistart <broker name> to start the broker.
If you use the command strmqbrk, then you start the WebSphere MQ Pub/Sub broker, which is entirely different. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
nilendu |
Posted: Thu Sep 14, 2006 10:41 pm Post subject: |
|
|
Novice
Joined: 14 Sep 2006 Posts: 16
|
Hi jefflowrey/malammik,
Yes you are right. The message exit gets called only when the WBRK6_DEFAULT_BROKER is running.
AUTHORIZATION error :
ERROR response returned :
MQPSCompCode 2 MQPSReason 3081 MQPSReasonText MQRCCF_NOT_AUTHORIZED MQPSErrorId
2292
definitely happens when the routing exit exits in the routingexitpath.
But I noticed that it logs the following warning message in the event log:
.............
Event Type: Warning
Event Source: WebSphere MQ
Event Category: None
Event ID: 8075
Date: 9/15/2006
Time: 12:05:01 PM
User: N/A
Computer: DASNI01-XP2
Description:
Authorization failed because the SID for entity 'administrato' cannot be obtained.
The Object Authority Manager was unable to obtain a SID for the specified entity.
Ensure that the entity is valid, and that all necessary domain controllers are available.
.............
The user name I am logged in with is 'Administrator'. Is the userID limited to 12 charaters?
Is that the reason?
But how come the authorization gets through when the router exit is not specified?
Please advice!!
regards,
Nilendu |
|
Back to top |
|
 |
nilendu |
Posted: Mon Sep 18, 2006 12:53 am Post subject: |
|
|
Novice
Joined: 14 Sep 2006 Posts: 16
|
Hi All,
The subscriber issue is resolved now.
The problem occured because the truncated userID.
As mentioned in my previous update, I had the following error message in the event log:
Authorization failed because the SID for entity 'administrato' cannot be obtained.
So I created a new user 'MQUSER' (6 characters), logged in using this ID and subscribed to the app.
Things went smoothly.
i.e The message exit was called twice
once when the pub/sub broker was call and again when my publisher app. published a message.
One point is still a mystery:
why the auth. issue happened only when the router exit was configured.
How did the subscriber app. work with a truncated username 'administrato' when the router exit was not specified.
But that's for another post...
Thank you all for your help.
regards,
Nilendu |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|