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 » Propagate and destination list

Post new topic  Reply to topic
 Propagate and destination list « View previous topic :: View next topic » 
Author Message
mqbrk_newbie
PostPosted: Thu May 13, 2010 9:18 am    Post subject: Propagate and destination list Reply with quote

Acolyte

Joined: 13 Sep 2004
Posts: 70

Hello All.

Can I use propagate and destination list at the same time ? I currently have message broker version 6.1.

I need to parse a large xml message , hence I used Handling large xml message technique published by storey.

http://www.ibm.com/developerworks/websphere/library/techarticles/0505_storey/0505_storey.html

For example if I have a messge like this..

<outer message>

<innermessage>
<element1></element1>
<element2></element2>
</innermessage>

<innermessage>
<element1></element1>
<element2></element2>
</innermessage>
.
.
.
.
.
<innermessage>
<element1></element1>
<element2></element2>
</innermessage>
</outerMessage>

I was able to propagate inner message chunk as individual message. But I also wanted to route element1 to one queue and element2 to a different queue before the message is propagated to next individual chunk. So I used destination list before propagate. I am not sure whether I did the right thing . Can someone help me how to achieve this scenario,


this is my code snippet

CREATE COMPUTE In_Compute13
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN

SET OutputRoot.MQMD = NULL;
SET OutputRoot.Properties =NULL;

DECLARE nam char;
Declare I Integer 0;
Declare J INTEGER;

-- no of Inner messages

Set J=CARDINALITY(innermessage);

-- Move onto the first Inner Message

DECLARE InputMessage REFERENCE TO innermesage;

-- Check if we are at the root or at the end of the outer message

While (I<J)
DO
IF I>=1 THEN DELETE PREVIOUSSIBLING OF InputMessage;

END IF;

-- Increment the Inner Message counter

SET I = I + 1;


SET firstElement = innermessage.element1;

SET OutputLocalEnvironment.Destination.MQ.Defaults.queueName='queue1';


SET OutputRoot.Properties.MessageSet= 'DTN8B3O002001';
SET OutputRoot.Properties.MessageType= 'msg_element1';
SET OutputRoot.Properties.MessageFormat= 'CWF1';
SET OutputRoot.MRM = Environment.outmsg;

SET SecondElement = innermessage.element2;

SET OutputRoot.Properties.MessageSet= 'DTN8B3O002001';
SET OutputRoot.Properties.MessageType= 'msg_element2';
SET OutputRoot.Properties.MessageFormat= 'CWF1';
SET OutputRoot.MRM = Environment.outmsg;

SET OutputLocalEnvironment.Destination.MQ.Defaults.queueName='queue2';



PROPAGATE;

MOVE InputMessage NEXTSIBLING;
END WHILE;

RETURN FALSE ;
END;
END MODULE;

Appreciate your help in advance.
Back to top
View user's profile Send private message Yahoo Messenger
Vitor
PostPosted: Thu May 13, 2010 9:35 am    Post subject: Reply with quote

Grand High Poobah

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

Don't you need to PROPOGATE element1 so it can reach queue1 before overwriting it with element2?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqbrk_newbie
PostPosted: Thu May 13, 2010 9:44 am    Post subject: Propagate and destination list Reply with quote

Acolyte

Joined: 13 Sep 2004
Posts: 70

No. My goal is to route element1 and element2 to different queues before it goes to next chunk of inner message.
Back to top
View user's profile Send private message Yahoo Messenger
Vitor
PostPosted: Thu May 13, 2010 10:03 am    Post subject: Re: Propagate and destination list Reply with quote

Grand High Poobah

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

mqbrk_newbie wrote:
My goal is to route element1 and element2 to different queues before it goes to next chunk of inner message.


I understood that from your post. My question stands. You're populating the output with element1 then, without propogating, you're overwriting it with element2. So how does element1 get anywhere (use of a distribution list notwithstanding)?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqbrk_newbie
PostPosted: Thu May 13, 2010 10:31 am    Post subject: Propagate and destination list Reply with quote

Acolyte

Joined: 13 Sep 2004
Posts: 70

Hi Vitor,

Yea I understand. I was wondering the same thing. Its quite not posssible . Is there any way that I could achieve what I need ?

I have to handle large messages at the same time I need to parse the inner structure and route to different queues.

I couldnt think of any other way of doing this.

Thanks really for your quick response.
Back to top
View user's profile Send private message Yahoo Messenger
Vitor
PostPosted: Thu May 13, 2010 11:15 am    Post subject: Re: Propagate and destination list Reply with quote

Grand High Poobah

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

mqbrk_newbie wrote:
Yea I understand. I was wondering the same thing. Its quite not posssible . Is there any way that I could achieve what I need ?


Well I've been pushing for a propogate between the 2 settings in my previous posts; why don't you feel that's a good idea given your set up (I could be missing something in your requirement here).

mqbrk_newbie wrote:
I couldnt think of any other way of doing this.


No, it seems reasonable. You might want to avoid the use of CARDINALITY and counters; nothing to do with the problem described here but it's a very inefficient way of dealing with a large tree.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Sam Uppu
PostPosted: Thu May 13, 2010 1:21 pm    Post subject: Re: Propagate and destination list Reply with quote

Yatiri

Joined: 11 Nov 2008
Posts: 610

mqbrk_newbie wrote:
Hello All.

Can I use propagate and destination list at the same time ? I currently have message broker version 6.1.

I need to parse a large xml message , hence I used Handling large xml message technique published by storey.

http://www.ibm.com/developerworks/websphere/library/techarticles/0505_storey/0505_storey.html

For example if I have a messge like this..

<outer message>

<innermessage>
<element1></element1>
<element2></element2>
</innermessage>

<innermessage>
<element1></element1>
<element2></element2>
</innermessage>
.
.
.
.
.
<innermessage>
<element1></element1>
<element2></element2>
</innermessage>
</outerMessage>

I was able to propagate inner message chunk as individual message. But I also wanted to route element1 to one queue and element2 to a different queue before the message is propagated to next individual chunk. So I used destination list before propagate. I am not sure whether I did the right thing . Can someone help me how to achieve this scenario,


this is my code snippet

CREATE COMPUTE In_Compute13
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN

SET OutputRoot.MQMD = NULL;
SET OutputRoot.Properties =NULL;

DECLARE nam char;
Declare I Integer 0;
Declare J INTEGER;

-- no of Inner messages

Set J=CARDINALITY(innermessage);

-- Move onto the first Inner Message

DECLARE InputMessage REFERENCE TO innermesage;

-- Check if we are at the root or at the end of the outer message

While (I<J)
DO
IF I>=1 THEN DELETE PREVIOUSSIBLING OF InputMessage;

END IF;

-- Increment the Inner Message counter

SET I = I + 1;


SET firstElement = innermessage.element1;

SET OutputLocalEnvironment.Destination.MQ.Defaults.queueName='queue1';


SET OutputRoot.Properties.MessageSet= 'DTN8B3O002001';
SET OutputRoot.Properties.MessageType= 'msg_element1';
SET OutputRoot.Properties.MessageFormat= 'CWF1';
SET OutputRoot.MRM = Environment.outmsg;

SET SecondElement = innermessage.element2;

SET OutputRoot.Properties.MessageSet= 'DTN8B3O002001';
SET OutputRoot.Properties.MessageType= 'msg_element2';
SET OutputRoot.Properties.MessageFormat= 'CWF1';
SET OutputRoot.MRM = Environment.outmsg;

SET OutputLocalEnvironment.Destination.MQ.Defaults.queueName='queue2';



PROPAGATE;

MOVE InputMessage NEXTSIBLING;
END WHILE;

RETURN FALSE ;
END;
END MODULE;

Appreciate your help in advance.


I think you can propagate element 1 via out terminal 1 to queue 1 and element 2 via out terminal 2 to queue 2 .
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu May 13, 2010 1:42 pm    Post subject: Re: Propagate and destination list Reply with quote

Grand High Poobah

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

Sam Uppu wrote:
I think you can propagate element 1 via out terminal 1 to queue 1 and element 2 via out terminal 2 to queue 2 .


It's a valid alternative, but does assume the existence of 2 output nodes with queue names coded or overridden; the OP seems to want to avoid that.

It still requires 2 propogate statements as I've been saying.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqbrk_newbie
PostPosted: Thu May 13, 2010 11:51 pm    Post subject: Propagate and destination list Reply with quote

Acolyte

Joined: 13 Sep 2004
Posts: 70

Thanks a lot for your input Vitor I used mulitple propagate to Terminals to achieve what I needed .
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Propagate and destination list
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.