Author |
Message
|
francoisvdm |
Posted: Thu May 21, 2009 4:51 am Post subject: CopyMessageHeaders() and CopyEntireMessage() |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
Every time you create a compute node these two procedures gets created automatically for you.
Is it good practice to remove those two procedures (or the one you do not use) from your ESQL code?
The reason why I ask is... what happens during deploy time? Is those code deployed multiple times...or is it smart enough to re-use the code if it was deployed somewhere else?
Will this save a little bit of memory if we remove all unused procedures?
Thanks all _________________ If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.
Francois van der Merwe |
|
Back to top |
|
 |
Hari |
Posted: Thu May 21, 2009 1:00 pm Post subject: |
|
|
 Centurion
Joined: 21 Nov 2002 Posts: 117 Location: USA
|
Quote: |
The reason why I ask is... what happens during deploy time? Is those code deployed multiple times...or is it smart enough to re-use the code if it was deployed somewhere else? |
Its the msg flow which is deployed (atleast superficially), not the procedure...you can consider the procedures (loosely) something like a method in Java.
The way the procedures are defined (scope) you cannot re-use it from somewhere else.
Quote: |
Will this save a little bit of memory if we remove all unused procedures? |
a really minute bit I say....may be the memory for the defined integers when the procedures are executed and may be some other which I am not aware of.
Quote: |
Is it good practice to remove those two procedures (or the one you do not use) from your ESQL code? |
If you are not using these procedures, remove them...I dont use these procedures.
If needed I do a direct copy of the msg tree in my Main function. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri May 22, 2009 5:00 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you do not call a procedure at all from within the esql added to a bar file, the bar file compiler will remove it, at least in later versions of Broker.
The only impact that leaving these procedures in will have is to take up some additional space in the broker database. And by "additional space" what I mean is "space equivalent to the number of characters in them". This is a small number.
It's entirely possible to put these procedures into a shared schema, and call those copies instead. It then takes extra effort every time you create a new compute module to remove those and update the template to call the shared version.
I generally find it more readable to use the pre-supplied procedures, and never edit or change them, than to copy/paste them into the main routine. |
|
Back to top |
|
 |
Hari |
Posted: Fri May 22, 2009 9:57 am Post subject: |
|
|
 Centurion
Joined: 21 Nov 2002 Posts: 117 Location: USA
|
Direct copy of the msg tree, well I meant to say doing a
SET OutputRoot.Properties = InputRoot.Properties ....etc, instead of calling the copymessageHeader()
IMO the cardinality and the looping makes the CopyMessageHeader() a tad bit expensive.......and since most of the time, I know the headers in the incoming msg, I try not using the procedure in their original form. |
|
Back to top |
|
 |
Sridar |
Posted: Tue Jun 16, 2009 11:09 pm Post subject: |
|
|
Acolyte
Joined: 14 May 2006 Posts: 72 Location: Chennai, India
|
I have tried calling from a seperae function but failed.
The problem arises because of the cardinality, and passing and retireving the tree(atleast the headers).
I had posed the same question long time back but no result.
I think it is more easier to call it everytime.
Sridar _________________ Thanks and Regards
Sridar |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 17, 2009 2:21 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Sridar wrote: |
I have tried calling from a seperae function but failed.
The problem arises because of the cardinality, and passing and retireving the tree(atleast the headers).
I had posed the same question long time back but no result.
I think it is more easier to call it everytime.
Sridar |
As said many times on this forum, if you try to do this from a common broker schema you need to pass the arguments (InputRoot, OutputRoot) by REFERENCE...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|