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 » WebSphere Message Broker (ACE) Support » [Urgent]Using Pub/Sub in broker v5

Post new topic  Reply to topic
 [Urgent]Using Pub/Sub in broker v5 « View previous topic :: View next topic » 
Author Message
wildtiger
PostPosted: Mon Apr 30, 2007 10:20 am    Post subject: [Urgent]Using Pub/Sub in broker v5 Reply with quote

Acolyte

Joined: 21 Apr 2002
Posts: 55
Location: Canada

Hi,

I'm using Pub/Sub in broker v5. My pub/sub flow doesn't work. Below are my two flows:

Code:

Publish Flow:

                                                           *-----------*
                                                           |  PUBFAILQ |
                            *---------------------------+--|           |
                            |                           |  | (MQOUTPUT)|
                            |                           |  *-----------*
                            |                           |
                            |                           |
*-----------*               |                           |
|   PUBQ    |----(Failure)--*                           |
|           |----(Out)------*                           |
| (MQINPUT) |               |                           |
*-----------*               |                           |
                            |                           |
                            |  *-----------*            |
                            |  |  Compute  |--(Failure)-*
                            +--|           |--(Out)-----*
                               | (Compute) |            |
                               *-----------*            |
                                                        |  *--------------*
                                                        |  |    Publish   |
                                                        +--|              |
                                                           | (Publication)|
                                                           *--------------*

ESQL in Compute Node:

CREATE COMPUTE MODULE Pub_Compute
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      CALL CopyMessageHeaders();
      -- CALL CopyEntireMessage();
      
      SET OutputRoot.MQRFH2.psc."Command" = 'Publish';
      SET OutputRoot.MQRFH2.psc.Topic = 'MYTOPIC';
         
      RETURN TRUE;
   END;

   CREATE PROCEDURE CopyMessageHeaders() BEGIN
      DECLARE I INTEGER 1;
      DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
      WHILE I < J DO
         SET OutputRoot.*[I] = InputRoot.*[I];
         SET I = I + 1;
      END WHILE;
   END;

   CREATE PROCEDURE CopyEntireMessage() BEGIN
      SET OutputRoot = InputRoot;
   END;
END MODULE;

---------------------------------------------------------------------------------
Subscribe Flow:
                                                           *-----------*
                                                           |  SUBFAILQ |
                            *---------------------------+--|           |
                            |                           |  | (MQOUTPUT)|
                            |                           |  *-----------*
                            |                           |
                            |                           |
*-----------*               |                           |
|   SUBQ    |----(Failure)--*                           |
|           |----(Out)------*                           |
| (MQINPUT) |               |                           |
*-----------*               |                           |
                            |                           |
                            |  *-----------*            |
                            |  |  Compute  |--(Failure)-*
                            +--|           |--(Out)-----*
                               | (Compute) |            |
                               *-----------*            |
                                                        |  *----------*
                                                        |  | SubscribQ|
                                                        +--|          |
                                                           |(MQOUTPUT)|
                                                           *----------*


ESQL in Compute Node:

CREATE COMPUTE MODULE Sub17A_Compute
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      CALL CopyMessageHeaders();
      -- CALL CopyEntireMessage();
      
      SET OutputRoot.MQRFH2.pcs.Command = 'RegSub';
      SET OutputRoot.MQRFH2.pcs.Topic = 'MYTOPIC';
      SET OutputRoot.MQRFH2.pcs.QMgrName = 'MYQM';
      SET OutputRoot.MQRFH2.pcs.QName = 'MYSUBQ';
      
      RETURN TRUE;
   END;

   CREATE PROCEDURE CopyMessageHeaders() BEGIN
      DECLARE I INTEGER 1;
      DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
      WHILE I < J DO
         SET OutputRoot.*[I] = InputRoot.*[I];
         SET I = I + 1;
      END WHILE;
   END;

   CREATE PROCEDURE CopyEntireMessage() BEGIN
      SET OutputRoot = InputRoot;
   END;
END MODULE;

--------------------------------------------------------------------------------



When I put a dummy XML message, nothing in the PUBFAILQ.
When I put a dummy XML message, nothing in the SUBFAILQ.
I did it a couple of times and found no message in the MYSUBQ.
I cound not find "MYTOPIC" topic in the "Subscriptions" view.


Can anyone kindly help with it?

Thanks in advance!

WT
Back to top
View user's profile Send private message
wildtiger
PostPosted: Mon Apr 30, 2007 6:44 pm    Post subject: Reply with quote

Acolyte

Joined: 21 Apr 2002
Posts: 55
Location: Canada

Anybody can help? The flow is so simple and I must miss something very little. Please help to figure it out. Thanks.
Back to top
View user's profile Send private message
vk
PostPosted: Mon Apr 30, 2007 7:21 pm    Post subject: Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

The MQRFH2 header setting in the subscribe flow is wrong. The folder is spelt as "pcs" instead of "psc".

Also, I hope the subscription flow is putting messages into the queue SYSTEM.BROKER.CONTROL.QUEUE

Regards,
VK.
Back to top
View user's profile Send private message
wildtiger
PostPosted: Tue May 01, 2007 10:17 am    Post subject: Reply with quote

Acolyte

Joined: 21 Apr 2002
Posts: 55
Location: Canada

Hi VK,

Thank you very much for your help.

I've changed the ESQL of Pub flow from "psc" to "pcs". But it still not working. Also, the queue name for SubscribQ is "SYSTEM.BROKER.CONTROL.QUEUE".

After I put a dummy message, nothing failed. But I'm still not able to see the topic from the "Subscriptions" view in broker toolkit. Also no message delivered to "OutputRoot.MQRFH2.pcs.QName" specified in the sub flow.

Do I need to install User Name Server to make it work? Or something else that I missed?

Thanks,

WT
Back to top
View user's profile Send private message
wildtiger
PostPosted: Tue May 01, 2007 10:19 am    Post subject: Reply with quote

Acolyte

Joined: 21 Apr 2002
Posts: 55
Location: Canada

BTW, I have MQSeries Pub/Sub installed. Does it conflict with broker's pub/sub? From manual and redbooks, it looks like not.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue May 01, 2007 10:50 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

wildtiger wrote:
BTW, I have MQSeries Pub/Sub installed. Does it conflict with broker's pub/sub? From manual and redbooks, it looks like not.


You can't have both on the same qmgr.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wildtiger
PostPosted: Tue May 01, 2007 12:38 pm    Post subject: Reply with quote

Acolyte

Joined: 21 Apr 2002
Posts: 55
Location: Canada

Good news. I made one step further.

After I put a message through the sub flow. I can see the topic being subscribe on the "Subscriptions" view. But when I put a message to the publish flow, no message is delivered to the subscritpion queue.

Does it mean that the sub flow is good and publish flow has problems?

Thanks,

WT
Back to top
View user's profile Send private message
wildtiger
PostPosted: Tue May 01, 2007 12:55 pm    Post subject: Reply with quote

Acolyte

Joined: 21 Apr 2002
Posts: 55
Location: Canada

Below is the newest esql code in the compute of pub flow:

Code:

CREATE COMPUTE MODULE Pub17A_Compute1
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      CALL CopyMessageHeaders();
      -- CALL CopyEntireMessage();

      SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
      SET OutputRoot.MQRFH2.psc."Command" = 'Publish';
      SET OutputRoot.MQRFH2.psc.Topic = 'FRUIT_ORANGE';

      SET OutputRoot.XML.PubMsg.Header = 'Testing Pub Msg';
      SET OutputRoot.XML.PubMsg.Body = 'Testing Pub Msg Content';

      RETURN TRUE;
   END;

   CREATE PROCEDURE CopyMessageHeaders() BEGIN
      DECLARE I INTEGER 1;
      DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
      WHILE I < J DO
         SET OutputRoot.*[I] = InputRoot.*[I];
         SET I = I + 1;
      END WHILE;
   END;

   CREATE PROCEDURE CopyEntireMessage() BEGIN
      SET OutputRoot = InputRoot;
   END;
END MODULE;



Still, no message delivered to my subscription queue.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue May 01, 2007 1:00 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

What is the Topic that you subscribed to?

What is the Topic that you published to?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wildtiger
PostPosted: Tue May 01, 2007 8:39 pm    Post subject: Reply with quote

Acolyte

Joined: 21 Apr 2002
Posts: 55
Location: Canada

Sorry, my mistake. I've changed all topic that I published and subscribed to "FRUIT_ORANGE".

...... any advice?
Back to top
View user's profile Send private message
dilse
PostPosted: Wed May 02, 2007 7:58 am    Post subject: Reply with quote

Master

Joined: 24 Jun 2004
Posts: 270

wildtiger,
I hope you are seeing the topic in 'FRUIT_ORANGE' in the subscribers list.
If Yes, then try to add these two lines in the Publish flow compute node.

Code:
      SET OutputRoot.MQMD.MsgType = MQMT_REQUEST;
      SET OutputRoot.MQMD.ReplyToQ = 'BROKER.REPLY.QUEUE';


Do not forget to create a 'BROKER.REPLY.QUEUE' queue in your Publish Queue Manager. This way you will know the reason code if it is failing to publish for any reason.

Hope this helps.
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 » WebSphere Message Broker (ACE) Support » [Urgent]Using Pub/Sub in broker v5
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.