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 ResourceBundle

Post new topic  Reply to topic
 JAVA ResourceBundle « View previous topic :: View next topic » 
Author Message
scravr
PostPosted: Wed Jun 05, 2013 11:03 am    Post subject: JAVA ResourceBundle Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

HI to All,

I have a simple flow mqinput->compute->mqoutput
Compute node calls a JAVA function xyz which calls LoadProperties function to load data from File_resources.properties (in JAVA project: config and bin directories) as a ResourceBundle.
Changing values on File_resources file does not take effect (in debugger testing) unless bar is regenerated.
File_resources.properties file is not included in BAR.


public static Vector<mydata> LoadProperties()
{
ResourceBundle rb = ResourceBundle.getBundle("File_resources");
Enumeration <String> keys = rb.getKeys();
Vector<mydata> _mydata = new Vector<mydata>();
String[] IpPort;
while (keys.hasMoreElements()) {
String key = keys.nextElement();
String value = rb.getString(key);
...
...
...
}
return _mydata;
}



here is File_resources:
node1=xxx
node2=yyy




How can i get the new changes loaded in run time (and debugger time) without rebuilding bar?
any ideas?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
lancelotlinc
PostPosted: Wed Jun 05, 2013 11:05 am    Post subject: Reply with quote

Jedi Knight

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

You mean for every MQ message, you're going to read properties ? Whats wrong with UDPs? What does this help you do that you cannot do with UDPs or BFOs?
_________________
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
scravr
PostPosted: Wed Jun 05, 2013 11:08 am    Post subject: Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

This eventually will change to STATIC.

also there are many key=value elements. UDP would not name it.

How can ResourceBundle be refreshed without rebuild/deploy bar ?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
lancelotlinc
PostPosted: Wed Jun 05, 2013 11:27 am    Post subject: Reply with quote

Jedi Knight

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

scravr wrote:
How can ResourceBundle be refreshed without rebuild/deploy bar ?


Use HashMap and have it be maintained by a constructor of a Java object that gets called at EG start time or when manually invoked by a utility function.

You seem to be reinventing the wheel. If you are on V8+, you should be using the global cache to do what you are doing.

You can reload the global cache objects any time you want.

Why custom code all the things that global cache gives you ?
_________________
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
mqjeff
PostPosted: Wed Jun 05, 2013 11:57 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Why use global cache or a properties file when you can use User Defined Properties?
Back to top
View user's profile Send private message
kash3338
PostPosted: Wed Jun 05, 2013 7:02 pm    Post subject: Re: JAVA ResourceBundle Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

scravr wrote:
Changing values on File_resources file does not take effect (in debugger testing) unless bar is regenerated.


How often do you change the values in the properties file?

scravr wrote:
How can i get the new changes loaded in run time (and debugger time) without rebuilding bar?
any ideas?


Using UDP is the best approach for this and that is the purpose of UDP's. If you still feel hard to maintain the Key-Value pairs in UDP, you can go for SHARED variables and have a logic to flush them every time a update is made on the properties file. Do Not CALL a Java function for every message.
Back to top
View user's profile Send private message Send e-mail
Esa
PostPosted: Wed Jun 05, 2013 10:00 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

V 8 User Defined Configurable Services are refreshed automatically. No need to cache the data.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » JAVA ResourceBundle
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.