Author |
Message
|
new2wmbdev |
Posted: Tue May 08, 2012 12:14 pm Post subject: Java Compute Node Propagating in a loop |
|
|
Newbie
Joined: 12 Apr 2012 Posts: 5
|
Hi,
Here is the process/problem:
1. Read Multiple files from a zip file in Java Compute Node
2. Based on the file name rout the message to either out or alt node.
3. This is done within a loop of files using PROPAGATE
Pseudo-Code:
// Read bitstream to zipEntry
while files in zipEntry
{
// Check file
if
out.propagate
else
alt.propagate
}
The problem is if I use PROPAGATE the control comes back only after executing the subsequent sub-flow. I understand Propagation is a synchronous process. In this case alt terminal is connected to a sub-flow which takes lot of time processing.
Is there a better approach on designing the flow?
I tried using collector node but there seems to be issues with the same.
Any suggestion on possible ways to spawn multiple simultaneous messages from JCN.
Thank you. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue May 08, 2012 12:17 pm Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
new2wmbdev |
Posted: Tue May 08, 2012 2:05 pm Post subject: |
|
|
Newbie
Joined: 12 Apr 2012 Posts: 5
|
Thank you for the reply.
How do you call a new queue from JCN?
Can we send multiple messages to the queue and let it trigger only after receives the last file?
Any pointers.
Thx again. |
|
Back to top |
|
 |
McueMart |
Posted: Tue May 08, 2012 11:35 pm Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
Quote: |
How do you call a new queue from JCN? |
You'll be using a MQOutput node after your JCN. You'll have to set up your message payload to hold the file content (Or potentially the message could contain a path to where you extracted the file to?).
Quote: |
Can we send multiple messages to the queue and let it trigger only after receives the last file? |
Using a transactional message flow (i.e. setting the transaction mode of your input terminal to yes), the messages you write to the queue will only be committed when the flow completed (i.e. when all of your files have been written to your queue). This should have the desired effect. |
|
Back to top |
|
 |
Esa |
Posted: Tue May 08, 2012 11:44 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
new2wmbdev wrote: |
Thank you for the reply.
How do you call a new queue from JCN?
Can we send multiple messages to the queue and let it trigger only after receives the last file?
Any pointers.
Thx again. |
With that kind of reply you are deliberately challenging lancelotlinc to post you a link to IBM education pages
I think you should in fact follow the link when you get it...
new2wmbdev wrote: |
The problem is if I use PROPAGATE the control comes back only after executing the subsequent sub-flow. |
That's not a problem. That's the way the product works. You will learn to embrace it.
lancelotlinc is telling you to replace the subflow with an MQOuput node and moving the subflow to another flow that listens to the same queue that your new MQOutput node puts messages on. That would make the unzipper flow faster, if that is what you want. But it won't make the overall processing time any shorter. The subflow will take its time even if it is detached from the main flow...
new2wmbdev wrote: |
Can we send multiple messages to the queue and let it trigger only after receives the last file? |
Yes. A Message flow is a transactional MQ application. The messages your flow instance puts in the queue will all become available simultaneously when the flow terminates and commits. Unless you configure it otherwise. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed May 09, 2012 2:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
And as you are working in a java compute node make sure you have the right logic behind all this:
try{ terminal.propagate(outassembly);}finally{outmessage.clear();} or you will run into memory problems...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed May 09, 2012 5:06 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
|