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 » disable TimeoutNotification node in Automatic mode

Post new topic  Reply to topic Goto page 1, 2  Next
 disable TimeoutNotification node in Automatic mode « View previous topic :: View next topic » 
Author Message
lium
PostPosted: Mon Sep 23, 2013 5:08 am    Post subject: disable TimeoutNotification node in Automatic mode Reply with quote

Disciple

Joined: 17 Jul 2002
Posts: 184

I have a business requirement to initialize the message flow before the first message comes in.

I think I can use TimeoutNotification node in Automatic mode to generate the first trigger message to initialize. however, I want to ignore the afterwards message.
Of course, I can set very long time interval or use logic to filter out any but the first message.
However, I am wondering if I can disable the node when the first message comes in since I don't want the message flow invoked after the first message.

Thanks,
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Sep 23, 2013 5:09 am    Post subject: Reply with quote

Jedi Knight

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

This is like the third time someone has asked this question in the last week.

Consider overriding the Constructor in a JCN.
_________________
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
smdavies99
PostPosted: Mon Sep 23, 2013 5:26 am    Post subject: Reply with quote

Jedi Council

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

lancelotlinc wrote:


Consider overriding the Constructor in a JCN.


If you want an example of why people who can write ESQL can't automatically write (good) Java then this is a good one to start with!
_________________
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
mqjeff
PostPosted: Mon Sep 23, 2013 5:39 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Maybe it's just me, but it seems much easier to just RETURN FALSE; in the appropriate situation than to worry about whether the timeoutnode is active or not.
Back to top
View user's profile Send private message
lium
PostPosted: Mon Sep 23, 2013 6:11 am    Post subject: Reply with quote

Disciple

Joined: 17 Jul 2002
Posts: 184

Thanks for reply
For
Quote:
Consider overriding the Constructor in a JCN.


I am wondering if this is to go with user-defined node.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Sep 23, 2013 6:43 am    Post subject: Reply with quote

Jedi Knight

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

lium wrote:
Thanks for reply
For
Quote:
Consider overriding the Constructor in a JCN.


I am wondering if this is to go with user-defined node.


No, not user-defined node. JCN = Java Compute Node. The suggestion is to override the constructor for the child class of MbJavaComputeNode class you defined already.
_________________
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
lium
PostPosted: Mon Sep 23, 2013 7:00 am    Post subject: Reply with quote

Disciple

Joined: 17 Jul 2002
Posts: 184

I am sorry but I am little confused with the term "Constructor".

Are you suggesting I override the evaluate() method or
provide public void MbJavaComputeNode().

If you refer to provide public void MbJavaComputeNode(), then My understanding is: I should provide a variable in instance level to flag if it has been sent or not?
If going with instance variable, I do not have to invoke public void MbJavaComputeNode()

Could you please kindly clarify more?

Thanks,
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Sep 23, 2013 7:13 am    Post subject: Reply with quote

Jedi Knight

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

Please read this and see if it helps you.

http://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html
_________________
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
lium
PostPosted: Mon Sep 23, 2013 7:21 am    Post subject: Reply with quote

Disciple

Joined: 17 Jul 2002
Posts: 184

I know what is constructor, but I am confused with your methodology you mentioned.

I constructed the following code which works well, however, could you please clarify if this is what you mentioned:

import com.ibm.broker.javacompute.MbJavaComputeNode;
import com.ibm.broker.plugin.*;

public class CheckUserBalance_Initialize extends MbJavaComputeNode {
private boolean sent = false;

public void evaluate(MbMessageAssembly assembly) throws MbException {
MbOutputTerminal out = getOutputTerminal("out");
MbOutputTerminal alt = getOutputTerminal("alternate");

MbMessage message = assembly.getMessage();

// ----------------------------------------------------------
// Add user code below

// End of user code
// ----------------------------------------------------------

// The following should only be changed
// if not propagating message to the 'out' terminal
if (!sent)
{
sent = true;
out.propagate(assembly);
}
}

}
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Sep 23, 2013 7:25 am    Post subject: Reply with quote

Jedi Knight

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

http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac20805_.htm

The doc refers to onInitialize(). You can do that instead if you like.

If I were doing it, I would create a constructor for CheckUserBalance_Initialize that matches the same arg list as for MbJavaComputeNode (being sure to call the parent).
_________________
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
lium
PostPosted: Mon Sep 23, 2013 7:49 am    Post subject: Reply with quote

Disciple

Joined: 17 Jul 2002
Posts: 184

Thanks for reply.

I think the onInitialize() works for lazy initialize. That is to say, before the first message is processed, It will finish initialization.
however, this lazy initialization will take longer time for processing the first message, which we want to avoid.

BTW, how can i get the MbJavaComputeNode constructor parameter list()?
I googled that, and could not find it.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Sep 23, 2013 8:42 am    Post subject: Reply with quote

Jedi Knight

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

You could try the constructor with zero parms, I cannot find reference either using Google.

The last time I did this, was related to pursuing a self-built in-memory cache in 2010 using a Singleton pattern. Since MB8, have no need to use anything other than the GlobalCache.

Keep poking at it till you get it to work for you. You are very close to solving.
_________________
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
lium
PostPosted: Mon Sep 23, 2013 9:23 am    Post subject: Reply with quote

Disciple

Joined: 17 Jul 2002
Posts: 184

Thanks for your reply.

I played the onInitialize(), this will get invoked every time the message flow starts or it is deployed. So it might not be that lazy.

Actually, I am trying to implement cache, right now, I used TimeoutNotification node in Automatic mode with long interval + JCN which will load cache data from external files.
So far it goes well.

I don't like the GlobalCache option, which seems to have dependency on WebSphere extreme
Back to top
View user's profile Send private message
Simbu
PostPosted: Mon Sep 23, 2013 9:37 am    Post subject: Reply with quote

Master

Joined: 17 Jun 2011
Posts: 289
Location: Tamil Nadu, India

lium wrote:


I don't like the GlobalCache option, which seems to have dependency on WebSphere extreme


you can use embedded global cache which doesn't require external eXtreme Scale product.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/topic/com.ibm.etools.mft.doc/bn23782_.htm
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Sep 23, 2013 9:42 am    Post subject: Reply with quote

Jedi Knight

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

lium wrote:
Thanks for your reply.

I played the onInitialize(), this will get invoked every time the message flow starts or it is deployed. So it might not be that lazy.

Actually, I am trying to implement cache, right now, I used TimeoutNotification node in Automatic mode with long interval + JCN which will load cache data from external files.
So far it goes well.

I don't like the GlobalCache option, which seems to have dependency on WebSphere extreme


You really re-invented the wheel, but yours is much more square.
_________________
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 Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » disable TimeoutNotification node in Automatic mode
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.