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 » Java Compute Node Propagating in a loop

Post new topic  Reply to topic
 Java Compute Node Propagating in a loop « View previous topic :: View next topic » 
Author Message
new2wmbdev
PostPosted: Tue May 08, 2012 12:14 pm    Post subject: Java Compute Node Propagating in a loop Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Tue May 08, 2012 12:17 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Propagate to a queue which is connected to subflow.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
new2wmbdev
PostPosted: Tue May 08, 2012 2:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
McueMart
PostPosted: Tue May 08, 2012 11:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
Esa
PostPosted: Tue May 08, 2012 11:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed May 09, 2012 2:24 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Wed May 09, 2012 5:06 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Esa wrote:
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...



Thanks Esa.

http://www-304.ibm.com/jct03001c/services/learning/ites.wss/us/en?pageType=course_description&courseCode=WM663

By the way, this page now has updated info.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Java Compute Node Propagating in a loop
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.