Author |
Message
|
kathir |
Posted: Mon Sep 26, 2011 4:16 am Post subject: java compute node |
|
|
Apprentice
Joined: 12 Sep 2011 Posts: 30
|
Please could some help on how to use java compute node to read a propery file ? |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Sep 26, 2011 4:41 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You write Java code to read a file, and then treat it as properties.
But DO NOT DO THIS.
Use User Defined Properties *instead*.
Write Java code to access User Defined Properties.
And strongly consider getting a significant amount of training on a) the java programming language, b) Message Broker. In that order. You have not demonstrated any competence in either one, and this may lead to you creating solutions that are not viable in a production environment. Which may lead you to getting fired. Aside from the potentially millions of dollars of damage your bad code could cause - depending on who you work for. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Sep 26, 2011 4:45 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
zpat |
Posted: Mon Sep 26, 2011 5:04 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Better to use the FileRead node.
I have seen developers using Java code to read/write files, SFTP files and access databases directly instead of using WMB facilities to do this.
JCNs are really dangerous in the hands of those who understand Java and don't understand WMB. I wish I could apply an ACL to them! |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Sep 26, 2011 5:24 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
zpat wrote: |
JCNs are really dangerous in the hands of those who understand Java and don't understand WMB. |
And twice as bad for those that don't understand Java OR WMB. |
|
Back to top |
|
 |
Gaya3 |
Posted: Mon Sep 26, 2011 5:49 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
mqjeff wrote: |
zpat wrote: |
JCNs are really dangerous in the hands of those who understand Java and don't understand WMB. |
And twice as bad for those that don't understand Java OR WMB. |
I agree agree agree well said
This is what happening now in the market  _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
zpat |
Posted: Mon Sep 26, 2011 6:25 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Some developers mistakenly believe that WMB is just a container for a series of Java programs invoked in sequence (using JCNs). It's partly a cultural issue of not asking for help. Much better to ask than to mis-understand. We like to be asked how to best do things (before or instead of "why doesn't this work").
In general terms, if you can't do it without using a JCN, then you shouldn't be doing it using a JCN. Using a JCN is primarily a syntax option over ESQL and not an invitation to use external JAR files. Any use of a JAR file in WMB should be cleared with your WMB expert to ensure it is really necessary. In most cases it is due to a lack of knowledge of the standard WMB features. |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Sep 26, 2011 6:50 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Quote: |
In general terms, if you can't do it without using a JCN, then you shouldn't be doing it using a JCN.
|
There is an exception to that general rule. These are the cases where class libraries for certain things make life easy. for example TAM. Trying to manage them from ESQL is a PITA. If you knew me, you would know that I'm (apart from probably Vitor ) the last person to recomment JCN's. _________________ 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 |
|
 |
Vitor |
Posted: Mon Sep 26, 2011 8:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smdavies99 wrote: |
I'm (apart from probably Vitor ) the last person to recomment JCN's. |
You'll never steal last place from me.... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
joebuckeye |
Posted: Mon Sep 26, 2011 9:06 am Post subject: |
|
|
 Partisan
Joined: 24 Aug 2007 Posts: 365 Location: Columbus, OH
|
zpat wrote: |
I have seen developers using Java code to read/write files, SFTP files and access databases directly instead of using WMB facilities to do this.
JCNs are really dangerous in the hands of those who understand Java and don't understand WMB. I wish I could apply an ACL to them! |
I once had a new broker developer (with Java experience) ask me to put the MQ jar files into /var/mqsi/shared-classes.
We had a little talk about what was appropriate for JCN's and what was not. |
|
Back to top |
|
 |
|