Author |
Message
|
integrated |
Posted: Thu Oct 15, 2009 12:31 pm Post subject: ESQL - Read contents of a file |
|
|
Newbie
Joined: 15 Oct 2009 Posts: 6
|
I am new to ESQL. whats are the function/statement to read the contents of a file from a specified location using ESQL.
I have a requirement where as part of message flow need to read a file and map some values from the file in incoming message.
Customer does not want to use database for having mapping data in tables. They wanted it to be in files on disk only.
Thanks for ur help |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Oct 15, 2009 12:57 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Have you looked at the product documentation? (hint there is a link at the top of the page to the info centre)
This question (or a similar variant thereof) has been asked many times before in this foum.
Take a look at the infocentre and other questions in this forum and then by all means come back with other questions. _________________ 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: Thu Oct 15, 2009 12:58 pm Post subject: Re: ESQL - Read contents of a file |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
integrated wrote: |
I am new to ESQL. whats are the function/statement to read the contents of a file from a specified location using ESQL. |
There are no such functions or statements. Use the FileInput node. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
integrated |
Posted: Thu Oct 15, 2009 1:50 pm Post subject: |
|
|
Newbie
Joined: 15 Oct 2009 Posts: 6
|
FileInput Node: Once file read, file input node has only options:delete/move. But i need the file to be just read and no action taken after? how can this be achieved ? |
|
Back to top |
|
 |
Gaya3 |
Posted: Thu Oct 15, 2009 11:28 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
integrated wrote: |
FileInput Node: Once file read, file input node has only options:delete/move. But i need the file to be just read and no action taken after? how can this be achieved ? |
you can opt the Move funtion to move file to an archive folder.
Or think about reading the file through Java Compute node. _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
zpat |
Posted: Thu Oct 15, 2009 11:33 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
It's better to store such data in a database table. |
|
Back to top |
|
 |
broker_new |
Posted: Fri Oct 16, 2009 7:58 am Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
It would be nice if IBM provides in WMBv7.0
For everything that we can't do in ESQL, there is a way i.e JAVA probably PHP in future. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Oct 16, 2009 8:08 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Personal comment
Java has a log going for it BUT too many people rely on Properties files for just about everything. I had to support an application that read in over 30 different properties files just to process one JMS Message. Then for the next message it read ALL the properties files again.
Arrrggghhhhh!
Needless to say it ran like a 3 legged dog in the Greyhound Derby.
When I design Flows that need something like a properties file I tend to use a database table. If the flow is expected to process 10's of messages a second, I don't read the table for every message. Instead I use a timerNode connected to a Compute Node that reads the table(without any read locks) once every 10 seconds or so.
In my experience these 'properties files' don't change very often and are often pretty irrelevant to the proper operation of the application.
Just my personal thoughts. _________________ 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 |
|
 |
mymq |
Posted: Tue Oct 20, 2009 1:19 am Post subject: |
|
|
Centurion
Joined: 01 Mar 2007 Posts: 101 Location: US-Greenwille
|
after reading the file, why dont u write the file using FileOutputNode into some other desired location and make use of it later? _________________ --SRK-- |
|
Back to top |
|
 |
mymq |
Posted: Tue Oct 20, 2009 1:21 am Post subject: |
|
|
Centurion
Joined: 01 Mar 2007 Posts: 101 Location: US-Greenwille
|
But, better to use JAVA code to do the needful _________________ --SRK-- |
|
Back to top |
|
 |
zpat |
Posted: Tue Oct 20, 2009 1:46 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Run a flow on a timer basis to load the file (fileinput node) into a database table.
Do not attempt to use WMB like a standard app server.
Use the IBM builtin facilities and use some lateral thinking to find a way. |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Oct 20, 2009 3:08 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
zpat wrote: |
Do not attempt to use WMB like a standard app server.
Use the IBM builtin facilities and use some lateral thinking to find a way. |
There are a number of regular posts in this forum that (and I'm guessing here) seem to indicate that people are indeed trying to use Broker as an AppServer and as they are probably used to coding in Java(nowt wrong in that as I dabble a bit myself) the use of 'Properties Files' is pretty widespread.
I was recently faces with this sort of probme and Iwent back to the designed and asked them the question.
How often or if ever will the values stored in those files change once the system goes into production?
The answer came back, Pretty well never
Then I said that I'll stick them in a DB table and have done with it.
They couldn't really object as there was one less file to :-
- Deploy
- Accidentally get deleted
- be maintained
I wrote a little Java App that allowed the admins to set any value in the table and everyone was happy. _________________ 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 |
|
 |
|