Author |
Message
|
Namita |
Posted: Fri Jul 03, 2009 3:36 am Post subject: read .property/txt file in message broker |
|
|
Newbie
Joined: 03 Jul 2009 Posts: 1
|
Hi,
I am new to Message Broker. I am Using Message Broker v.6.0. I need to read property file in my message flow. Can anyone help me out how to read the property file and load the data in Environment tree.
Thanks
Namita |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jul 03, 2009 3:46 am Post subject: Re: read .property/txt file in message broker |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Namita wrote: |
I need to read property file in my message flow. |
Why not supply the information as User Defined Properties to the flow? Easier and more flexible. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jul 03, 2009 4:09 am Post subject: Re: read .property/txt file in message broker |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Namita wrote: |
Hi,
I am new to Message Broker. I am Using Message Broker v.6.0. I need to read property file in my message flow.
Thanks
Namita |
Let me guess...
You are a Java programmer who is trying to use Message Broker as if it were WAS (Websphere Application Server).
Message Broker is really intended as a High Performance Message Processing System. You have to approach Flow design in a very differnt way from desiging a WAS application. I made a similar mistake when I started WAS application programming.
If you do read a properties file in the mainstream flow code then just think of the possible performance implications if you have to start processing 100+ messages per second. There are better ways to get what to all intents & Purposes is static data from a text file into a broker flow. If the data is hardly ever going to change them the suggestion made by Vitor is pretty good.
There are posts in this forum that discuss some of the options. _________________ 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 |
|
 |
Ward |
Posted: Mon Nov 30, 2009 9:35 am Post subject: |
|
|
 Voyager
Joined: 27 Jun 2001 Posts: 98 Location: Europe
|
UDP are fine for "few" parameters that "hardly ever change". You don't want having to manage a flow with 20+ UDP's. Also, don't like the fact that you need to redeploy your flow "just to change your property file" but well, could still live with that...
The performance excuse doesn't do it for me either. The whole point about a property file is that you load it ones, during initialisation (startup) of the flow into shared rows and then not have to redo this for every message. The fact that message broker (still) does not supply something like that is... how do you call it... Unfortunate! _________________ IBM Certified Solution Designer -- WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
----------------------------
Visit Boat Dimensions |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 30, 2009 9:50 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Ward wrote: |
UDP are fine for "few" parameters that "hardly ever change". You don't want having to manage a flow with 20+ UDP's. |
It's not a problem at all. Works fine. And highly controlable - one less component to manage (no additional file).
Ward wrote: |
The performance excuse doesn't do it for me either. The whole point about a property file is that you load it ones, during initialisation (startup) of the flow into shared rows and then not have to redo this for every message. |
This impacts your flow design. How does the flow determine if it's just started, just been restarted or if the property file has just been changed? What happens if the property file is changed while the flow is running, possibly mid-transaction?
UDPs deal with all of these issues. Lovely. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Nov 30, 2009 10:06 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
I was onced faced with this problem.
After lots of dicussions/arguments we settled on the following.
-Treat the properties file as a read only database table (in the flow that is)
-Read the table using a non locking read into a set of shared values.
-Re-read the table every 10 (user defineable) seconds via a timer node.
I asked the people proposing the use of properties files "How often will the values in the files change"
The couldn't answer it but they said that they would change.
I ran some stats on the table after 2 years of production use processing often close to a million messages a day, the values hadn't changed one iota. _________________ 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 |
|
 |
Ward |
Posted: Mon Nov 30, 2009 10:35 am Post subject: |
|
|
 Voyager
Joined: 27 Jun 2001 Posts: 98 Location: Europe
|
Using a database is the way we work for the moment as well. Values do change, but this is controlled by our operational team who restart impacted flows.
Only with Broker v7 you don't really need a database anymore to run your broker. It would be nice if we had not to rely on the database for our configuration parameters either... _________________ IBM Certified Solution Designer -- WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
----------------------------
Visit Boat Dimensions |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Nov 30, 2009 11:49 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi,
Ward wrote: |
Using a database is the way we work for the moment as well. Values do change, but this is controlled by our operational team who restart impacted flows.
Only with Broker v7 you don't really need a database anymore to run your broker. It would be nice if we had not to rely on the database for our configuration parameters either... |
Why don't you load the parameters into cache memory and update it when parameters are updated ?
Ward wrote: |
The performance excuse doesn't do it for me either. The whole point about a property file is that you load it ones, during initialisation (startup) of the flow into shared rows and then not have to redo this for every message. The fact that message broker (still) does not supply something like that is... how do you call it... Unfortunate! |
Which product are you comparing it to, that supplies this functionality ? and how does it implement it ?
Regards. |
|
Back to top |
|
 |
Ward |
Posted: Mon Nov 30, 2009 12:18 pm Post subject: |
|
|
 Voyager
Joined: 27 Jun 2001 Posts: 98 Location: Europe
|
the closest you have to cache are those shared rows... there's nothing at broker or execution level you can set/alter from outside your flow...
I'm not comparing, but a property file is what you'd use in any lower level programming language. _________________ IBM Certified Solution Designer -- WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
----------------------------
Visit Boat Dimensions |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 30, 2009 2:10 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Ward wrote: |
I'm not comparing, but a property file is what you'd use in any lower level programming language. |
But WMB isn't a low level programming language, and as has been said before this isn't WAS.
From a control standpoint, operational teams like UDPs exactly because of the control they offer, which can be hard to achieve with files or databases.
It's also true that such "configurable" parameters never seem to need changing as often as the business and design teams seem to think....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Nov 30, 2009 8:56 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi,
Ward wrote: |
the closest you have to cache are those shared rows... there's nothing at broker or execution level you can set/alter from outside your flow... |
Here you go, IA91. You can cache at execution and broker level. You can set/alter from outside the flow.
Ward wrote: |
I'm not comparing, but a property file is what you'd use in any lower level programming language. |
Truthfully, I've not seen property files being used for business data loading, only for operational data.
Perhaps the reason the product does not come with this functionality inbuilt is that not everyone will need/use it. And it would be a considerable overhead on performance.
Regards. |
|
Back to top |
|
 |
Ward |
Posted: Tue Dec 01, 2009 2:49 am Post subject: |
|
|
 Voyager
Joined: 27 Jun 2001 Posts: 98 Location: Europe
|
IA91 looks interesting, thx.
will look at it more deeply and then choose between that and a java compute node to load a .properties file ourself _________________ IBM Certified Solution Designer -- WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
----------------------------
Visit Boat Dimensions |
|
Back to top |
|
 |
mqmatt |
Posted: Tue Dec 01, 2009 4:46 am Post subject: |
|
|
 Grand Master
Joined: 04 Aug 2004 Posts: 1213 Location: Hursley, UK
|
BTW, as of 6.1.0.2, String based UDPs can be modified without requiring a redeploy of your flows. |
|
Back to top |
|
 |
Ward |
Posted: Tue Dec 01, 2009 5:17 am Post subject: |
|
|
 Voyager
Joined: 27 Jun 2001 Posts: 98 Location: Europe
|
thx mqmatt,
will check if this can help us...
the property I'm looking at is not a standard "name-value" property. The value is an XML structure that could be 1-2kb. Not really what UDP's are made for but I'll investigate a bit more anyway. _________________ IBM Certified Solution Designer -- WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
----------------------------
Visit Boat Dimensions |
|
Back to top |
|
 |
broker_new |
Posted: Mon Mar 01, 2010 8:47 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
Hi Matt,
Would you please forward any link or the steps about the string based UDP's which sounds interesting. We could leverage it rather than reading property files...... _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
|