|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
accessing an XML file in a bar or alternative |
« View previous topic :: View next topic » |
Author |
Message
|
powerlord |
Posted: Thu Jun 03, 2010 11:40 pm Post subject: accessing an XML file in a bar or alternative |
|
|
Novice
Joined: 02 Sep 2005 Posts: 19
|
Hi -
I have an XML file which effectively has the 'rules' for how my flow is going to operate on messages that arrive. i.e. a static routing table basically.
i.e. if X and Y and Z>3 then process like ABC, etc
I want this XML file to be read in by the broker once, cached in memory and then access it via XPATH expressions or some other mechanism to 'run the rules' on each message as they arrive.
So, basically I need a way of reading this file into the broker where I can then use SHARED to access across my message flow instances.
Now, I could use file input node, but I really don't want to have a dependancy on the local file system.
Ideally I want to just deploy the flow in a bar file, with the XML routing table in it, and have the flow pick it up from inside the bar.
However it looks like file input node won't do this.
I'd imagine I could do it in java, but would rather stay in ESQL if I can.
The only other thing I can think of is sticking the message on a queue, and reading it off the queue, either each time a message is processed non-destructively, or into SHARED storage.
However, this still gives a dependancy on deployment of populating the queue, which I don't like.
So, looking for ideas really ?
stu |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jun 04, 2010 1:44 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There are no operators, commands, or functions in ESQL to access data outside the logical message tree. No files, no email, no network, no nothing.
Except a database.
Stick your table in a user defined property. |
|
Back to top |
|
 |
powerlord |
Posted: Fri Jun 04, 2010 2:39 am Post subject: |
|
|
Novice
Joined: 02 Sep 2005 Posts: 19
|
I think you have misunderstood me (I've been MBing for 6 years)
I could use a fileInputNode to load the XML into an ESQL variable (i.e. the logical message tree) easily enough.
i.e. I was asking of the best ways to INSERT the data into the inputRoot or Environment, from where obviously ESQL could access it.
But yes, I had already considered the possibility of a bar overide, storing the XML into a single string, and then have the ESQL parse this into an XMLNS parser tree.
At present that's the best solution I can come up with. |
|
Back to top |
|
 |
fatherjack |
Posted: Fri Jun 04, 2010 4:20 am Post subject: |
|
|
 Knight
Joined: 14 Apr 2010 Posts: 522 Location: Craggy Island
|
I'm confused.
First of all you said
powerlord wrote: |
I want this XML file to be read in by the broker once, cached in memory |
Now you are saying
powerlord wrote: |
I was asking of the best ways to INSERT the data into the inputRoot or Environment, from where obviously ESQL could access it. |
Either way, I'm with mqjeff - stick it in a database. _________________ Never let the facts get in the way of a good theory. |
|
Back to top |
|
 |
powerlord |
Posted: Fri Jun 04, 2010 4:38 am Post subject: |
|
|
Novice
Joined: 02 Sep 2005 Posts: 19
|
DB not an option - it is not part of the solution.
both of these quotes are the same.
i.e. a mechanism to get it into the env, followed by a mechanism to read it efficiently (i.e. only one off read from file or whatever).
so unclear why it's confusing.
"I was asking of the best ways to INSERT the data into the inputRoot or Environment (read it into broker), from where obviously ESQL could access it (via cached storage - SHARED keyword).
However, thanks anyway.
So far - my original plan still seems best.
stu |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jun 04, 2010 4:40 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
fatherjack wrote: |
Either way, I'm with mqjeff - stick it in a database. |
Actually, I really meant
powerlord wrote: |
But yes, I had already considered the possibility of a bar overide, storing the XML into a single string, and then have the ESQL parse this into an XMLNS parser tree. |
Except of course, I wouldn't use an XMLNS parser tree, I'd use an XMLNSC tree. Or I'd use a multi-valued user defined property... (maybe those are only in v7? Good reason to move to v7).
There doesn't appear to be a good reason to NOT use a user defined property, given the constraints mentioned. |
|
Back to top |
|
 |
powerlord |
Posted: Fri Jun 04, 2010 5:11 am Post subject: |
|
|
Novice
Joined: 02 Sep 2005 Posts: 19
|
XMLNS - sorry typo.
ok, looks like we are agreed - user defined property it is.
cheers
stu |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|