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 » UDP Saga

Post new topic  Reply to topic
 UDP Saga « View previous topic :: View next topic » 
Author Message
raj12121
PostPosted: Wed Mar 09, 2011 8:57 pm    Post subject: UDP Saga Reply with quote

Newbie

Joined: 09 Mar 2011
Posts: 8

I have two message flows (udp1.msgflow and udp2.msgflow) in the same schema (project.test).

Requirement : Set up a UDP (e.g database schema ) which will be visible to all the flows inthe same schema.


Experiment:


Created an UDP (V1) in the flow edtitor and specified the UDP DECLARE ** syntax in the esql of flow1 (udp1.msgflow) with a default value DEFV1.
The value of UDP on udp1.msgflow is set to MYV1.

UDP variable is accessed from second flow.

Issue :
UDP variable V1 in udp1.msgflow correctly display the customised value i.e MYV1
Where as UDP variable V1 in udp2.msgflow displays the default value DEFV1.


Any ideas.

udp2.esql
Code:
BROKER SCHEMA project.test


CREATE COMPUTE MODULE udp2_Compute
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      CALL CopyMessageHeaders();
      CALL CopyEntireMessage();
      SET OutputRoot.XML.UDP.V1 = V1;
      RETURN TRUE;
   END;

   CREATE PROCEDURE CopyMessageHeaders() BEGIN
      DECLARE I INTEGER 1;
      DECLARE J INTEGER;
      SET J = 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;

udp1.esql
Code:
BROKER SCHEMA project.test
DECLARE V1 EXTERNAL CHARACTER 'DEFV1' ;

CREATE COMPUTE MODULE upd_Compute
   
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      CALL CopyMessageHeaders();
      CALL CopyEntireMessage();
      SET OutputRoot.XML.UDP.V1 = V1;
      RETURN TRUE;
   END;

   CREATE PROCEDURE CopyMessageHeaders() BEGIN
      DECLARE I INTEGER 1;
      DECLARE J INTEGER;
      SET J = 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;


[/img][/code]
Back to top
View user's profile Send private message
MQEnthu
PostPosted: Wed Mar 09, 2011 9:41 pm    Post subject: Reply with quote

Partisan

Joined: 06 Oct 2008
Posts: 329
Location: India

AFAIK... if you edit the UDP values using the Message Flow editor in a flow, the newly edited value is available to all the nodes in that flow....And the new value is not available to the other flow even though they are in same schema...
_________________
-----------------------------------------------
It is good to remember the past,
but don't let past capture your future
Back to top
View user's profile Send private message
raj12121
PostPosted: Thu Mar 10, 2011 11:50 am    Post subject: Reply with quote

Newbie

Joined: 09 Mar 2011
Posts: 8

The value was edited using bar editor. How can this be achieved ? Any solution ?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Mar 10, 2011 12:47 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I do not believe that user defined properties exist outside the context of a given flow.

Likewise, ESQL SHARED variables are not shared between flows.
Back to top
View user's profile Send private message
raj12121
PostPosted: Thu Mar 10, 2011 4:59 pm    Post subject: Reply with quote

Newbie

Joined: 09 Mar 2011
Posts: 8

Thanks mqjeff,

what is the solution for the below requirement .

Multiple flows in same schema requires a customisable property (e.g database schema) at deploy time. Instead of exposing UDPs for each and every flow .. is there a way to define one customisable property which will be visible to all the flows in the same schema.

Thanks
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Mar 10, 2011 10:20 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

do you really mean
Quote:
deploy time

and not run time?
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
raj12121
PostPosted: Fri Mar 11, 2011 3:15 am    Post subject: Reply with quote

Newbie

Joined: 09 Mar 2011
Posts: 8

yes, my bad also should be visible at run time.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Mar 11, 2011 3:29 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You are not asking how to define a variable that is visible to many flows - you already have that.

You are asking how to ensure that all of the flows access the same instance of that variable.

I don't think you can do that from ESQL, because the ESQL runtime is not constructed the same way that a JVM is constructed.

But I don't think you need to do this, really. How often is this variable really going to change? Does it really need to be changed without redeploying things?
Back to top
View user's profile Send private message
raj12121
PostPosted: Fri Mar 11, 2011 3:36 am    Post subject: Reply with quote

Newbie

Joined: 09 Mar 2011
Posts: 8

thanks mqjeff, i will go with defining udp for every flow.
Back to top
View user's profile Send private message
terminator_xyz
PostPosted: Tue Aug 19, 2014 4:16 pm    Post subject: one question Reply with quote

Novice

Joined: 29 Jul 2014
Posts: 15

sorry to reopen this topic.

If i need to use the UDP V1 in 2nd flow, should I still declare this UDP in 2nd flow, and not need to declare in 2nd esql using DECLARE EXTERNAL....?
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 » UDP Saga
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.