Author |
Message
|
murdeep |
Posted: Wed Jul 22, 2009 9:10 am Post subject: FileOutput File Name Generation |
|
|
Master
Joined: 03 Nov 2004 Posts: 211
|
Hello, running WMB V6.1.0.4
I have a requirement to read grouped messages from a queue and produce a file. The catch is that I need to set the file name to contain the PutDate and PutTime of the first message in the group.
My question is how do I save the first grouped message PutDate/PutTime so that it can be used when I write out subsequent messages in the group? I also need to ensure when the next group arrives on the input queue that I calculate the new file name.
I have managed to recognize the first message of the group so I can filter on that to set the Date/Time but am having trouble saving it so I can reference it on subsequent gets of the other messages in the group.
I know there is a way to save info across gets in a variable but am having trouble recalling how to do that. Your help is appreciated. |
|
Back to top |
|
 |
zpat |
Posted: Wed Jul 22, 2009 9:22 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Use shared variables in ESQL. |
|
Back to top |
|
 |
murdeep |
Posted: Wed Jul 22, 2009 9:36 am Post subject: |
|
|
Master
Joined: 03 Nov 2004 Posts: 211
|
Thanks. For the life of me I couldn't recall this but know that you mention it it's obvious. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Wed Jul 22, 2009 11:49 pm Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
Of course you are treating the group as one transaction arent you....
What if this UOW becomes very large?
If not, what happens if the broker goes down after processing the first message in the group?
An alternative might be to store a mapping between groupids and put date / time in a DB and then look this up for subesquent messages of the group.
Just my quick thoughts. |
|
Back to top |
|
 |
murdeep |
Posted: Thu Jul 23, 2009 8:45 am Post subject: |
|
|
Master
Joined: 03 Nov 2004 Posts: 211
|
I am consuming the msg group as as single UOW (i.e. Logical order is checked, All messages available is checked and Commit by message group is checked on the MQInput node). So if the broker abends the messages should be backed out. On subsequent reprocessing the FileOutput node will see the file already exists and I have configured the node to archive the previously created partial file before writing out the new file.
I thought about storing the groupid, date and time but after analyzing this I don't believe that will buy me anything. Correct me if I am wrong. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Thu Jul 23, 2009 9:26 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
murdeep wrote: |
I am consuming the msg group as as single UOW (i.e. Logical order is checked, All messages available is checked and Commit by message group is checked on the MQInput node). |
just checking
Quote: |
I thought about storing the groupid, date and time but after analyzing this I don't believe that will buy me anything. Correct me if I am wrong.
|
I was just thinking that if the UOW grew too big you could break the work down into smaller chunks and if the broker restarted it would be able to continue processing without needing the 1st message again. If you've already considered all this (and it sounds like you have) then ill say no more  |
|
Back to top |
|
 |
|